You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can define default click animation presets in headmatter/frontmatter:
234
+
235
+
```yaml
236
+
---
237
+
clickAnimation: up
238
+
---
239
+
```
240
+
241
+
Or specify them per element with directive modifiers:
242
+
243
+
```md
244
+
<divv-click>Uses default animation preset defined in frontmatter</div>
245
+
<divv-click.scale>Scales up when showing and scales down when hiding</div>
246
+
<divv-click.fade.right>Composes multiple animations: fade and right</div>
247
+
<divv-click.none>No animation for this element</div>
248
+
```
249
+
250
+
There are some built-in presets available for you to use:
251
+
252
+
-`fade`: Fade in from opacity 0.5 to 1
253
+
-`fade-in`: Fade in from opacity 0 to 1
254
+
-`up`: Translate 20px up
255
+
-`down`: Translate 20px down
256
+
-`left`: Translate 20px left
257
+
-`right`: Translate 20px right
258
+
-`scale`: Scale to 0.9
259
+
-`none`: Disables animation for this element
260
+
261
+
And you can also define your own presets with custom CSS rules for `.slidev-vclick-anim-{presetName}`:
262
+
263
+
```css
264
+
.slidev-vclick-anim-pop.slidev-vclick-hidden {
265
+
transform: scale(0.96) translateY(8px);
266
+
}
267
+
```
268
+
231
269
### Element Transitions {#element-transitions}
232
270
233
271
When you apply the `v-click` directive to your elements, it will attach the class name `slidev-vclick-target` to it. When the elements are hidden, the class name `slidev-vclick-hidden` will also be attached. For example:
0 commit comments