@@ -183,6 +183,72 @@ theme: seriph
183
183
Read more about [ How to use a theme] ( https://sli.dev/themes/use.html ) and
184
184
check out the [ Awesome Themes Gallery] ( https://sli.dev/themes/gallery.html ) .
185
185
186
+ ---
187
+
188
+ # Animations
189
+
190
+ Animations are powered by [ @vueuse/motion ] ( https://motion.vueuse.org/ ) .
191
+
192
+ ``` html
193
+ <div
194
+ v-motion
195
+ :initial =" { x: -80 }"
196
+ :enter =" { x: 0 }" >
197
+ Slidev
198
+ </div >
199
+ ```
200
+
201
+ <div class =" w-60 h-60 relative mt-6 " >
202
+ <div class =" relative w-40 h-40 " >
203
+ <img
204
+ v-motion
205
+ :initial="{ x: 800, y: -100, scale: 1.5, rotate: -50 }"
206
+ :enter="final"
207
+ class="absolute top-0 left-0 right-0 bottom-0"
208
+ src="https://sli.dev/logo-square.png"
209
+ />
210
+ <img
211
+ v-motion
212
+ :initial="{ y: 500, x: -100, scale: 2 }"
213
+ :enter="final"
214
+ class="absolute top-0 left-0 right-0 bottom-0"
215
+ src="https://sli.dev/logo-circle.png"
216
+ />
217
+ <img
218
+ v-motion
219
+ :initial="{ x: 600, y: 400, scale: 2, rotate: 100 }"
220
+ :enter="final"
221
+ class="absolute top-0 left-0 right-0 bottom-0"
222
+ src="https://sli.dev/logo-triangle.png"
223
+ />
224
+ </div >
225
+
226
+ <div
227
+ class="text-5xl absolute top-14 left-40 text-[#2B90B6] -z-1"
228
+ v-motion
229
+ :initial="{ x: -80, opacity: 0}"
230
+ :enter="{ x: 0, opacity: 1, transition: { delay: 2000, duration: 1000 } }">
231
+ Slidev
232
+ </div >
233
+ </div >
234
+
235
+ <!-- vue script setup scripts can be directly used in markdown, and will only affects current page -->
236
+ <script setup lang =" ts " >
237
+ const final = {
238
+ x: 0 ,
239
+ y: 0 ,
240
+ rotate: 0 ,
241
+ scale: 1 ,
242
+ transition: {
243
+ type: ' spring' ,
244
+ damping: 10 ,
245
+ stiffness: 20 ,
246
+ mass: 2
247
+ }
248
+ }
249
+ </script >
250
+
251
+ [ Learn More] ( https://sli.dev/guide/animations.html#motion )
186
252
187
253
---
188
254
@@ -235,7 +301,7 @@ C -->|Two| E[Result 2]
235
301
236
302
</div >
237
303
238
- Learn more about [ the syntax ] ( https://sli.dev/guide/syntax.html#diagrams )
304
+ [ Learn More ] ( https://sli.dev/guide/syntax.html#diagrams )
239
305
240
306
---
241
307
layout: center
0 commit comments