feat: introduce named animation presets for v-click#2501
feat: introduce named animation presets for v-click#2501DEmmaRL wants to merge 27 commits intoslidevjs:mainfrom
Conversation
✅ Deploy Preview for slidev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@slidev/client
create-slidev
create-slidev-theme
@slidev/parser
@slidev/cli
@slidev/types
commit: |
|
Currently, Describe the solution you'd likeI propose bringing named animation presets to the core. This system allows for:
Proposed APIFrontmatter: ---
clickAnimation: fade-up
---Directive modifiers: <div v-click.scale>This pops in</div>Suggested Presets: Why this proposal?I've already been implementing this pattern manually in my recent presentations using custom CSS and frontmatter, and it significantly improves the "feeling" of the slides. Describe alternatives you've considered
* Manual CSS/UnoCSS: Similar to CSS Override, while possible, it requires a lot of boilerplate to manage the transition between .slidev-vclick-hidden and the active state for transforms. Presets would standardize these common motion patterns as first-class citizens. |
|
Hi, please excuse the accidental push , I was working on this in my fork and didn't mean to open the PR just yet. But, since it's already visible, I’d love to use this as a starting point for a proposal. I’ve been using these presets in my personal presentations to avoid writting too many css classes for simple entrance effects, and it's been quite helpful for my workflow. I’m fully aware of the importance of keeping the core lean, (I saw some old PR/issues antecedents to v-click that could be related, that's why I wanted to create an issue before posting my local changes, but now it's public haha) so I’m totally open to feedback on whether this fits the project's direction or if it should remain as a user-land implementation. Just wanted to share a feature that has been useful for me, I would understand if it's found not enterely necessary or not having enough use cases. |
…ecessary and caussing issues
|
Thanks for proposing this idea! This looks like a useful feature, I'd definitely like to see it merged. We just need some docs and minor updates to the demo slides ( A few questions though:
|
docs/guide/animations.md
Outdated
| .slidev-vclick-target[data-click-animation='pop'].slidev-vclick-hidden { | ||
| transform: scale(0.96) translateY(8px); | ||
| } | ||
| ``` |
There was a problem hiding this comment.
I documentred how to create & use custom presets in here
|
Thanks for the suggestions! Just pushed an update:
I also added a dev warning for multiple animation modifiers (not 100% sure if it's ok) . LMK if this looks better or need something else or if I did not addressed what you said, I am a little excited with this feature! |
|
Thanks for the update! I have a few suggestions:
|
|
1 - You are right! I'll remove it. I updated the PR with new related changes |
|
I am seeing your changes, seems cool, you simplified a lot thanks ! I just have a concern about fade, you transformed it to a dim of 0.5 opacity and not a "fade-in" transition, is it on pourpuse? Do we want fade to be a dim ? because in that case maybe it should be a good idea to create another one that has the |
…eness and fix the overflow on the slide
|
Hi, I did a mistake on the documentation that makes the slide to have an overflow, I fixed it |
No description provided.