Utilities for Rays ("God Rays", Sunshine) #18736
rozsazoltan
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There was a discussion on Discord about some code related to rays, but based on TailwindCSS.
crswll provided a quick solution that puts the styles found on CodePen into a utility:
In the meantime, I did the same, but with functional utilities I added a bit of customization: if you only need one color,
rays-{color}
works, but you can also declare custom rays with the--rays-*
namespace. The direction of the rays can also be set withrays-deg-{number}
, and the animation can be triggered separately withrays-move
. (source)Warning
There's not much thought behind it, so unexpected bugs may occur. If you note them down in this thread, we can refine it later.
Warning
Animations come with higher system requirements, which isn't ideal for commercial products. While this code is functional and produces beautiful rays, it isn't optimized for the best possible performance. Just have fun.
Just why not:
Beta Was this translation helpful? Give feedback.
All reactions