Video wird geladen...
Video konnte nicht geladen werden
CSS Tip! ✨ Trigonometric functions (sin, cos, etc.) are landing in CSS 🙌 Use them in animations & layouts 😯 How about these images laid out along a sine wave using scoped custom properties? img { translate: 0 calc(sin(var(--index) * 50%)); 👈 } CodePen.IO link below! 👇
229,233 Aufrufe • vor 3 Jahren •via X (Twitter)
10 Kommentare

Here's that @CodePen link! 🚀 Tap the page to toggle the layout 👇 Trigonometric functions in CSS are currently supported in Safari and Firefox. They should land in Chrome 111 🤞 What else could you use them for? 🧐

Not even 12 months ago, I posted this 😅 Looks like I've got some demos to make 👀

@CodePen Would you please stop repeatedly exploding my brain?

@CodePen Sorry, I don’t want to learn maths again 😭

@CodePen Wait what, this wasn't even on my list of css features to wait for.

@CodePen Ha – A little gift from CSS 🎁 I'm kinda excited to see all the interesting ways people might use it. I've got a few ideas lined up when I can sit down with it.

@CodePen For me I will mostly use them for Designing loaders, and snake games. I don't see much of use case as of now.. Need to take shower to generate new ideas.💡

@CodePen This might be one of the coolest and most helpful tweets I've seen in a bit.

@CodePen Also nice to see `translate` instead of `transform: translate()`

@CodePen Now this looks something fun to play with.
