Re:Box Breathing
by dfabulich on Saturday January 28, 2017 @09:39PM
(#13511513)
I'm just learning CSS animations and thought I'd do one that way.
Or, as a data URI:
(Be sure to triple-click to select all.)
[ Parent
| on HN ]
I would leave a slight gap between the outer edge, it just feels claustrophobic when the blue and black parts touch. Also it needs some fancy speed up/slow down parts at the end of the exhale/inhale parts, it stops and starts too abruptly.
Otherwise it's pretty bang on.
Re:Box Breathing
by dingensundso on Sunday January 29, 2017 @05:29AM
(#13513504)
> <body><style>.circle{border-radius:50%;width:30vw;height:30vw;margin: auto}.breathe{animation:8s ease-in-out 0s infinite alternate breathe;}.inner{background-color:#07a;}.border{border:10px solid black;padding:10px;}@keyframes breathe{ 0%{transform:scale(1);} 25%{transform:scale(1);} 75%{transform:scale(0.25);} 100%{transform:scale(0.25);}}</style><div class="circle border"> <div class="inner circle breathe"></div></div></body>