
The Apple Watch comes with a stock app called Breathe that reminds you to… breathe. There’s actually more to it than that, it’s a self wellness app of sorts, that reminds you to take a brief moment out of your stressful day and focus on your breathing to encourage relaxation. Additionally, the app has a minimalistic interface with a nice animation.
I thought it would be fun (and relaxing) to recreate the design, particularly in vanilla CSS. Here’s how far I got, which feels pretty close.
Making the circles
First things first, we need a set of circles that make up that flower looking design. The app itself adds a circle to the layout for each minute that is added to the timer, but we’re going to stick with a static set of six for this demo. It feels like we could get tricky by using ::before
and ::after
to reduce the HTML markup, but we can keep it simple.
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
We’re going to make the full size of each circle 125px
which is an arbitrary number. The important thing is that the default state of the circles should be all of them stacked on top of one another. We can use absolute positioning to do that.
.circle {
border-radius: 50%;
height: 125px;
position: absolute;
transform: translate(0, 0);
width: 125px;
}
Note that we’re using the translate
function of the transform
property to center everything. I had originally tried using basic top, right, bottom, left
properties but found later that animating translate
is much smoother. I also originally thought that positioning the circles in the full expanded state would be the best place to start, but also found that the animations were cumbersome to create that way because it required resetting each one to center. Lessons learned!
If we were to stop here, there would be nothing on the screen and that’s because we have not set a background
color. We’ll get to the nice fancy colors used in the app in a bit, but it might be helpful to add a white background for now with a hint of opacity to help see what’s happening as we work.
We need a container!
You may have noticed that our circles are nicely stacked, but nowhere near the actual center of the viewport. We’re going to need to wrap these bad boys in a parent element that we can use to position the entire bunch. Plus, that container will serve as the element that pulses and rotates the entire set later. That was another lesson I had to learn the hard way because I stubbornly did not want the extra markup of a container and thought I could work around it.
We’re calling the container .watch-face
here and setting it to the same width and height as a single circle.
<div class="watch-face">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
Now, we can add a little flex
to the body element to center everything up.
body {
background: #000;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
Next up, animate the circles
At this point, I was eager to see the circles positioned in that neat floral, overlapping arrangement. I knew that it would be difficult to animate the exact position of each circle without seeing them positioned first, so I overrode the transform
property in each circle to see where they’d land.
We could set up a class for each circle, but using :nth-child
seems easier.
.circle:nth-child(1) {
transform: translate(-35px, -50px);
}
/* Skipping 2-5 for brevity... */
.circle:nth-child(6) {
transform: translate(35px, 50px);
}
It took me a few swings and misses to find coordinates that worked. It ultimately depends on the size of the circles and it may take some finessing.
Armed with the coordinates, we can register the animations. I removed the transform
coordinates that were applied to each :nth-child
and moved them into keyframes:
@keyframes circle-1 {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(-35px, -50px);
}
}
/* And so on... */
I have to admit that the way I went about it feels super clunky because each circle has it’s own animation. It would be slicker to have one animation that can rule them all to push and re-center the circles, but maybe someone else reading has an idea and can share it in the comments.
Now we can apply those animations to each :nth-child
in place of transform
:
.circle:nth-child(1) {
animation: circle-1 4s ease alternate infinite;
}
/* And so on... */
Note that we set the animation-timing-function
to ease
because that feels smooth…at least to me! We also set the animation-direction
to alternate
so it plays back and forth and set the animation-iteration-count
to inifinite
so it stays running.
Color, color, color!
Oh yeah, let’s paint this in! From what I can tell, there are really only two colors in the design and the opacity is what makes it feel like more of a spectrum.
The circles on the left are a greenish color and the ones on the right are sorta blue. We can select the odd-numbered circles to apply the green and the even-numbered ones to apply the blue.
.circle:nth-child(odd) {
background: #61bea2;
}
.circle:nth-child(even) {
background: #529ca0;
}
Oh, and don’t forget to remove the white background from the .circle
element. It won’t hurt anything, but it’s nice to clean up after ourselves. I admittedly forgot to do this on the first go.
It’s also at this point that others in the comments have suggested that replacing opacity
for mix-blend-mode
with a value of screen
makes for a nicer way to blend the colors of the circles. I’ve since updated the demos and the code.
Pulse and rotate
Remember that pesky .watch-face
container we created? Well, we can animate it to pulse the circles in and out while rotating the entire bunch.
I had totally forgotten that transform
functions can be chained together. That makes things a little cleaner because it allows us to apply scale()
and rotate()
on the same line.
@keyframes pulse {
0% {
transform: scale(.15) rotate(180deg);
}
100% {
transform: scale(1);
}
}
…and apply that to the .watch-face
element.
.watch-face {
height: 125px;
width: 125px;
animation: pulse 4s cubic-bezier(0.5, 0, 0.5, 1) alternate infinite;
}
Like the circles, we want the animation to run both ways and repeat infinitely. In this case, the scale drops to a super small size as the circles stack on top of each other and the whole thing rotates halfway on the way out before returning back on the way in.
I’ll admit that I am not a buff when it comes to finding the right animation-timing-function
for the smoothest or exact animations. I played with cubic-bezier
and found something I think feels pretty good, but it’s possible that a stock value like ease-in
would work just as well.
All together now!
Here’s everything smushed into the same demo.
If you’re having a stressful day, even you don’t have an apple watch, you can gaze into the CSS animation you’ve created and lull yourself into tranquility.
Make sure you don’t keep all of this peacefulness to yourself, and pass along your newly discovered knowledge.
animation css
css animation examples
css animation delay
css rotate animation
css hover animation
css animation generator
text animation css
css animation transition
css text animation
css keyframe animation
css animation fade in
css loading animation
css button animation
css bounce animation
css animation shorthand
css animation properties
css animation tutorial
animation delay css
css typing animation
css animation on hover
css shake animation
css flip animation
loading animation css
css scroll animation
css transform animation
css animation property
css animation infinite
css background animation
css slide animation
css pulse animation
rotate animation css
css animation repeat
hover animation css
typing animation css
css animation library
css spin animation
css fade in animation
css border animation
trigger css animation on scroll
css animation keyframes
button animation css
image animation css
css gradient animation
css animation examples with code
css animation loop
css underline animation
css delay animation
flip animation css
css image animation
hover css animation
animation css jquery
animation in css
css animation fill mode
background animation css
css animation not working
fade in animation css
css animation steps
css animation on click
css slide in animation
css transition animation
css animation ease
css animation rotate
css animation on scroll
css blink animation
css rotation animation
css transition vs animation
animation css example
css image animation effects
css animation effects
css animation scale
css keyframes animation
css webkit animation
animation text css
svg animation css
css animation name
css animation easing
css animation direction
css background image animation
delay animation css
animation css shorthand
css scale animation
scroll animation css
css tricks animation
border animation css
css loop animation
css animation bounce
css text animation examples
css progress bar animation
css sprite animation
animation css examples
css background animation examples
css animation duration
keyframe animation css
css animation hover
css 3d animation
css color animation
css wave animation
animation steps css
animation with css
css pause animation
css keyframe animation generator
simple css animation
css slide down animation
css svg animation
css animation libraries
bounce animation css
keyframes animation css
css text animation effects
css glow animation
scrolling animation css
css animation types
css fade animation
css reverse animation
svg css animation
css animation speed
pure css animation
css animation text
javascript css animation
css menu animation
rotate css animation
css grow animation
animation direction css
css circle animation
css animation slide
css onclick animation
mdn css animation
css infinite animation
css animation background color
w3schools css animation
css animation background
css animation reverse
css flash animation
css line animation
slide animation css
css animation spin
css button hover animation
transition animation css
css animation tool
css loader animation
javascript trigger css animation
css animation forwards
css animation stay at end
floating animation css
css animation slide up
underline animation css
react css animation
css background gradient animation
css animation transform
css typing animation multiple lines
repeat animation css
css animation stop at end
css animation delay between iterations
webkit animation css
css animation syntax
learn css animation
animation image css
css keyframe animation examples
keyframes css animation
loop animation css
css animation performance
sprite animation css
simple text animation css
animation shorthand css
animation speed css
css animation-delay
css animation codepen
css animation tricks
css wiggle animation
css expand animation
css animation translate
css animation left to right
css background color animation
trigger css animation with javascript
css click animation
css animation on load
css repeat animation
css opacity animation
delay css animation
css animation blink
animation using css
css on scroll animation
css animation cheat sheet
css 3 animation
html css animation
animation property css
page flip animation css
css translate animation
css animation linear
gradient animation css
codepen css animation
css animation creator
css icon animation
css animation example
css animation play state
transition vs animation css
slide in animation css
shake animation css
spinning animation css
css page load animation
div animation css
animation css hover
animation button css
css animation code
spin animation css
css animation pulse
css on hover animation
animation name css
css animation framework
css animation move up and down
css marquee animation
css button click animation
css ease animation
text animation css codepen
animation fill mode css
css animation-name
css animation from to
fade animation css
css animation button
animation transition css
slide up animation css
css animation w3
w3 school css animation
css on click animation
css appear animation
loading css animation
infinite animation css
css animation fade out
animation css property
css animation scroll
css parallax animation
css color change animation
css animation list
animation on hover css
css animation fade in and out
background color animation css
webkit css animation
scroll css animation
css logo animation
reverse animation css
transform css animation
css floating animation
restart css animation
jquery css animation
animation css infinite
css animation builder
simple css loading animation
css card flip animation
css animation support
css animation editor
icons animation css
css animation:
css effects animation
font animation css
css border bottom animation
web animation css
jquery trigger css animation
css animation end
adobe css animation
css rainbow animation
css animation slide down
button css animation
opacity animation css
css zoom animation
css stars animation
css animation ie
transform animation css
css animation gallery
circle animation css
css fadein animation
css animation browser support
pause animation css
css slider animation
w3 css animation
css scrolling animation
popup animation css
css text animation generator
css restart animation
animation properties css
css falling animation
page animation css
text css animation
scale animation css
trigger css animation on click
css font animation
css continuous animation
material design animation css
slide down animation css
css animation vs javascript animation
css collapse animation
css accordion animation
css animation ease-in-out
css animation move
css animation demo
css animation stop
css animation tag
css scrolling text animation
scale css animation
bootstrap animation css
css spinner animation
css background animation loop
css text animation letter by letter
css animation maker
icon animation css
css animation class
bootstrap css animation
css timer animation
css expand collapse animation
pulse animation css
css animation shake
css rotate image animation
css animation on page load
animation hover css
css animation infinite loop
css animation-direction
basic css animation
css counter animation
toggle animation css
css trigger animation
css dropdown menu animation
bounce css animation
css background color change animation
css animation border
wave animation css
css animation mdn
type animation css
click animation css
cool css animation
scroll down animation css
css animation delay between loops
css fade in and out animation
css hamburger animation
css animation display none
page scroll animation css
fade css animation
css animation pulse effect
css animation tools
javascript css animation examples
fade out css animation
safari css animation
button border animation css
animation css not working
css animation height
animation infinite loop css
color animation css
css animation internet explorer
css blinking animation
css animation event listener
css drop animation
dropdown menu css animation
css blink text animation
css word animation
pulsing animation css
animation css rotate
keep animation state css
css animation only once
css transform animation jquery
animation duration css
css checkmark animation
animation css library
css grid animation
css type animation
animation delay css not working
css web animation
card animation css
animation not working css
css animation position
css shimmer animation
css animation-fill-mode
css image animation slideshow
css animation keyframe
css animation for text
w3schools animation css
css animation delay not working
webkit-animation-name css
code animation css
css animation move in circle
animation infinite css
css dropdown animation
animation slider css
css animation slide left to right
css animation once
css animation generator hover
css animation transitions
menu animation css
on scroll animation css
css reverse animation on mouse out
css animation appear
css image hover animation
create a css flipping animation
swipe animation css
animation types css
css text box animation
css trigger animation on scroll
css flashing animation
css hover underline animation
css slide animation on click
css animation cubic-bezier
svg animation css tricks
css placeholder animation
css text animation codepen
transition css animation
css navigation animation
css transition animation examples
css html animation
css text animation blink
css animation typing effect
animation in html css and javascript
css animation zoom on hover
animation css mdn
animation css w3schools
svg css animation examples
text animation css examples
css hover animation generator
start css animation on scroll
css down arrow animation
css animation slide in from right
text animation using css
css animation display
swing animation css
grid animation css
expand animation css
css animation opacity
fade in css animation
html css animation examples
css floating image animation
css fireworks animation
line animation css
christmas css animation
reveal animation css
css animation callback
css glow effect animation
blink animation css
on scroll css animation
css text flip animation
css animation variables
css animation easing functions
css transform rotate animation
chrome css animation
css animation tutorials
css animation random movement
water drop animation css
css box animation
stop css animation
css animation event
rotation animation css
css gradient background animation
css animation multiple transforms
css animation vs javascript
check mark animation css
dynamic css animation
opacity css animation
css animation transform translate
css reveal animation
keyframe animation css generator
css fire animation
animation-name css
css fade in fade out animation
css water animation
css animation for all browsers
firefox css animation
css fade in out animation
css text moving animation
check animation css
css fly in animation
flashing animation css
css animation right to left
css jquery animation
sass css animation
css animation duration infinite
css animation in and out
animation repeat css
css number counter animation
css animation trigger
css hover animation examples
css javascript animation examples
css animation snippets
css error message animation
css animation width
css animation color
animation css generator
animation css text
tutorial css animation
css bouncing animation
css animation with javascript
typewriter animation css
wobble animation css
css circle border animation
animation css 3
rainbow css animation
css animation vs transition
css text slide animation
css button border animation
handwriting animation css
html css text animation
css font color change animation
divi css animation
scroll based animation css
css grow and shrink animation
text typing animation css
css animation names
css animation hover effects
css zoom in animation
css color gradient animation
css flip animation on hover
css image animation on load
html css animation tutorial
translate3d css animation
dreamweaver css animation
css transformation animation
tab animation css
on hover css animation
fireworks animation css
continuous animation css
w3schools css image animation
rotate image css animation
how to make animation in css
use css animation to change the hover state of a button
css 3d animation generator
css smooth animation
css @keyframes animation
animation css forwards
css sliding animation
css clouds animation
css hover animation effects
menu icon animation css
snow animation css
sparkle animation css
css moving animation
reset css animation
jquery css with animation
css animation delay fade in
progress bar css animation
css div animation
how to trigger css animation with javascript
scroll down css animation
best animation css
tick animation css
text animation with css
cloud animation css
book css animation
css animation timing function
bouncing text animation css
html 5 css animation
blink css animation
animation css keyframes
css animation code generator
css animation time
javascript vs css animation
css vector animation
image animation using css
css animation once and stop
css animation up and down
text animation css generator
animation images css
css page flip animation
css animation timeline
search bar animation css
onclick animation css
css circle animation hover
css animation drop down
material design css animation
lynda css animation
animation effects in css
fadein css animation
what is css animation
html5 css animation examples
css animation play once
hide element before animation css
css animation fade in fade out
how to use css animation
animation effects css
css animation css
css light animation
smooth animation css
modal animation css
css rainbow background animation
animation library css
3d animation in css
css swing animation
css link animation
css show hide animation
animation examples css
css animation cycle
banner animation in css
image css animation
gallery animation css
glow animation css
animation reverse css
css rotate animation on hover
css animation online
progress animation css
css img animation
css 3d rotation animation
css image glow animation
box animation css
css table animation
best css animation library
css animation gradient
google material design animation css
css animation rotation
applied visual design: use css animation to change the hover state of a button
animation rotate css
css animation keep end state
animation css transform
css animation circle
flip image css animation
css animation linear infinite
image hover animation css
css animation all
moz animation css
css animation flicker
timer animation css
css header animation
css animation free
css animation sample
css text hover animation
ease animation css
css bar chart animation
background css animation
javascript animation vs css animation
css w3schools animation
ease css animation
css display none animation
jquery css animation duration
css animation display none to block
css class animation
css bubbles animation
circle css animation
javascript start css animation onclick
css animation fade
css animation ease in out
css swipe animation
applied visual design: create movement using css animation
css animation card flip
create css animation with javascript
animation on css
html css image animation
cool css animation examples
css transition transform animation
text reveal animation css
3d cube css animation
css -webkit-animation
3d rotate css animation
css writing animation
animation html css
css wobble animation
css character animation
css html5 animation
css text blink animation
css animation slide out left
simple css animation examples
flash animation css
flash css animation
css strikethrough animation
css animation multiple elements
css slide up animation
css ticker animation
css bubble animation
css animation properties list
css code for animation
css sine wave animation
heart animation css
multiple background images css animation
pop up animation css
css fade out animation
animation in html css and javascript kirupa pdf
animation in html and css
ease in css animation
css glitch animation
css animation click
css animation background image change
css vs jquery animation
scroll down arrow animation css
css animation fade in delay
css smoke animation
css animation scroll position
animation scroll css
add css animation
css waves animation
sliding animation css
circle loading animation css
css animation arrow
css image animation examples
css flip animation on click
jquery stop css animation
css hover off animation
animation stay at end css
css animation samples
animation css transition
css animation translate javascript values
css animation text examples
css animation typewriter
zoom in css animation
dropdown animation css
css photo animation
animation loop css
page flip css animation
matrix css animation
css animation slide in
loop css animation
css jiggle animation
carousel animation css
css hamburger menu animation
css animation choppy
css mouseover animation
animation blink css
marquee css animation
css animation scrolling text
css animation on display
javascript css animation library
css animation flip
animation on scroll css
css carousel animation
css flex animation
css animation image
css animation navigation
css page turn animation
css sprite animation example
css animation left to right loop
css animation course
reverse css animation
css text appear animation
html animation css
animation css ease
css animation pause
animation bounce css
css background animation generator
hamburger css animation
css animation alternate
css rainbow text animation
css add animation
css text typing animation
css animation pdf
mouse hover animation css
css animation slideshow
slide up css animation
css background image rotation animation
animation for css
css animation none
css animation smooth
animation css html
css animation effects examples
css animation jitter
animation css linear
css animation react
fade out animation css
wow css animation
css code for text animation effects
animation fade in css
css transform animation examples
css gradient animation generator
css svg animation tutorial
css text animation effect
spinner animation css
css animation wiggle
css slow animation
slide down css animation
css reset animation
keyframe css animation
css ring animation
3d css animation
animation css properties
animation css stop at end
css animation rotate loop
css animation-timing-function
css simple animation
how to use animation in css
css create animation
css alert animation
reset animation css
svg fill animation css
css button animation on hover
css picture animation
css spring animation
slider animation css
animation-direction css
css background animation effects
animation css code
cool css animation effects
css spin animation on hover
css animation bounce up and down
css page scroll animation
css jelly animation
examples of css animation
css animation loop forever
css text fade in animation
css text color animation
arrow animation css
css highlight animation
glitch animation css
set css animation javascript
css animation book
simple animation css
down arrow animation css
css image animation hover
animation css left to right
css animation loader-spinnter-left
matched card animation css
css animation no smoothing
css 4 animation
how to not make an animation repeat itself css
css animation text fade in mdn
css, slide animation
css animation infinite loop rotate
css background url animation
css ellipsis animation center
css animation spin and slow
css animation fallback ie10
css all animation
js css site theme animation diagonal cards
other css animation names
how to load animation to each section css
css infinite animation callback
css loading animation simple
background animation highlighting css
infinite animation css keyframe
iframe gallery css animation magnific lightbox
css animation on toggle
animation css for a tag
css animation scroll trigger
browser update css animation
an tudor css animation
confetti animation css
css trigger slide out animation after slide in animation
css background change color animation
swinging animation in css
css animation text going across screen
card shuffle animation css
fill animation css
css progress bar animation codepen
gpu accelerated rendering css animation
css shadow pulse animation
light effect css animation
css animation keyframe delay
svg css animation hamburger to close button
add a delay on a css animation loop
css animation webkit prefix
html css logo animation
css animation adobe edge
pop up animation css in div
how do i speed parts of a css animation
pause css animation on hover
background image animation-name css load
css enable animation
css change height animation
animation slide image right to left css
hover glow css animation
pop in css animation
css animation circles
css link hover border animation
black and white flashing animation css
css why does my slide animation only work once
animation in css slide in right make site wider
css animation scale ie pixel
canvas context rotate image css animation
animation javascript and css
sprite animation css using local file
create wave hand in css animation
bounce left animation css
animation css liquid photography
html css scroll down animation
css percentage circle animation
css animation class change
css animation line forms circle
css html animation demos
animation background position css
css image resizes after animation is done
css animation shorthand rotate
css animation end on last frame
change opacity with css animation
css i need animation to stay where it is after performed
arrow rotate css animation
css animation simulate item moving further away
css m60 animation
css keyframe animation center
call css animation on click
settimeout css animation
blender to css animation
javascript or css animation
play animation while scrolling css only
animation -delay property in css
css animation rotate clockwise
css voice text animation in speach bubble
css 3 border animation
css how to repeat animation not infinite
jquery detect css animation events
animation scale in css
image transparency css animation hover
animation css 切换时 页面元素向上移动
css vs scvg animation
how to add animation to websites css
css sliding animation slides
css transitions animation and transformations books
css light box animation
pausing an animation at end css
css background animation fade
border animation lagg css
underline animation html css
animation css rotation
i have an animation i want to affect my css
css image show animation
css svg animation commands
css text animation color change
css animation two images
css highlight animation hover
animation css scale retain translation
simple vector animation css
css hold top of ak animation
css matrix animation
on hover stop animation css
add css animation to image
css exploding animation
text change animation css
css play animation on load
javascript detect if css animation complete
how to create a css animation for loader
css rotate 90 degrees animation
how to make css animation bounce
how totrigger keyframes animation css
css scroll down start animation
addition in css animation
css zero gravity animation
display block animation css
animation for forms css
loop a css animation
text grows on animation css
css animation child element delay
js trigger css animation manually
css animation blink text
x animation css
slow bounce css animation
animation rotation css
css animation open box
animation-direction css values
css animation: scroll
css display block with animation
paper plane css animation
animation vs transition css
css animation where you have a line going across button
smooth open close animation css
number dropping animation, css
how to make materials 2 radio button animation in css
css animation fog
event listener breaks css animation
pure css icon animation
css animation moving dog
open page css animation
css animation transition out
trigger animation on visibility change pure css
card stacking animation css
css animation reverts afterward
css animation on button click
uploading css animation
css animation, toggle rotate on click w3schools
css spinning animation
3d text animation css
make a css animation repeat js
how to animation css typewriter
css random animation duration
css animation rectangle to circle
css spark animation
colour in outline animation css
how to repeat animation css
css scroll change background animation
css transition animation generator
css animation shapes
css underline animation hover
javascript css animation timer
html css animation move div center
css image animation when
css full screen animation
javascript get css animation state
css animation circle resize
css transition transform animation tutorial
css animation roadmap
cleaning animation css
how to do an animation css
simple animation webpage css
css slide up animation generator
translate3d animation css
animation logo css
css animation to slide 4 photos in next to each other
css animation different color for different element
css teardrop animation
image animation css panning
css record disappearing animation
css vibrate animation
star wars lightsaber css animation
css javascript animation framework
animation css or javascript
scroll css animation one page website tutorial
continuous position animation css
animation iteration count once hover css
css walking character animation
css animation linear-gradient 没用
how to safe an animation for css
css rotate div animation
jquery animation vs css
stop animation with css