-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Animate Plugin #18
Animate Plugin #18
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dope
@@ -0,0 +1,113 @@ | |||
# animate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there plans to move to a docs folder and just the docs for this? Seems like it would work really well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hah #16
absolutely agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
{ | ||
'[class*="stagger-"] > *': { | ||
'--stagger-delay': '0s', | ||
'transition-delay': `calc(var(--animate-index) * ${staggerInterval.default} + var(--stagger-delay))`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa wild
^ This latest commit is super handy for applying animations on elements that might already specify one of the properties you are trying to transition. Previously, for example, using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool 👍
Easier version of the README to read here
This was directly inspired by some Viget.com work and a general trend towards our designers wanting to apply these more often.
The README explains the purpose and usage, but one thing I'm especially curious about the verbiage in general that I used. I'll admit that an
animate
plugin is not obviously different from theanimation
utilities, but it's a rather tricky thing to pin down in a simple name. In short, this generates utilities that would generally be used with Intersection Observer in order to achieve "animate on scroll" or "scroll reveal" type functionalities (those are both existing library names). This plugin isn't intrinsically tied to scrolling, though, so not sure how much that makes sense to mention.In addition, I went with
animate-
andstagger-
utilities -- let me know how you feel about all these as well!Demo
Made a CodePen with some of the outputted utilities to demonstrate some of these (the
triggerClass
is just being toggled in asetInterval
as opposed to being added via Intersection Observer):https://codepen.io/gregkohn/pen/abNVQry?editors=1000