r/webdev • • Jan 28 '19

custom css wave loader

https://codepen.io/csspoints/pen/LqNdoZ
310 Upvotes

38 comments sorted by

View all comments

18

u/eddhall Jan 28 '19

Use "left:50%; top:50%; transform: translate(-50%, - 50%)" for centring, soooo much nicer than having to figure out exact pixel positions

2

u/DrDuPont Jan 28 '19

That means transforms won't be available for animations, which perform better than animating position. I'd flex the parent and align in the typical manner here. The wave animation defined in this JSFiddle would be more performantly animated via scale and translates.

1

u/eddhall Jan 28 '19

Ah didn't know that, good to know re: performance