File tree Expand file tree Collapse file tree 5 files changed +19
-2
lines changed Expand file tree Collapse file tree 5 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ const props = defineProps({
3434 type: String ,
3535 default: ' ' ,
3636 },
37+ duration: {
38+ type: Number ,
39+ default: configs .magicMoveDuration ,
40+ },
3741})
3842
3943const steps = JSON .parse (lz .decompressFromBase64 (props .stepsLz )) as KeyedTokensInfo []
@@ -158,8 +162,7 @@ onMounted(() => {
158162 :animate =" !isPrintMode"
159163 :options =" {
160164 globalScale: scale * zoom,
161- // TODO: make this configurable later
162- duration: 800,
165+ duration: $props.duration,
163166 stagger: 1,
164167 }"
165168 />
Original file line number Diff line number Diff line change @@ -86,4 +86,5 @@ export const HEADMATTER_FIELDS = [
8686 'wakeLock' ,
8787 'seoMeta' ,
8888 'notesAutoRuby' ,
89+ 'magicMoveDuration' ,
8990]
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ export function getDefaultConfig(): SlidevConfig {
5050 notesAutoRuby : { } ,
5151 duration : '30min' ,
5252 timer : 'stopwatch' ,
53+ magicMoveDuration : 800 ,
5354 }
5455}
5556
Original file line number Diff line number Diff line change @@ -305,6 +305,12 @@ export interface HeadmatterConfig extends TransitionOptions {
305305 * @default 'stopwatch'
306306 */
307307 timer ?: 'stopwatch' | 'countdown'
308+ /**
309+ * Duration for shiki magic move transitions in milliseconds
310+ *
311+ * @default 800
312+ */
313+ magicMoveDuration ?: number
308314}
309315
310316export interface Frontmatter extends TransitionOptions {
Original file line number Diff line number Diff line change 545545 "markdownDescription" : " Timer mode" ,
546546 "default" : " stopwatch"
547547 },
548+ "magicMoveDuration" : {
549+ "type" : " number" ,
550+ "description" : " Duration for shiki magic move transitions in milliseconds" ,
551+ "markdownDescription" : " Duration for shiki magic move transitions in milliseconds" ,
552+ "default" : 800
553+ },
548554 "defaults" : {
549555 "$ref" : " #/definitions/Frontmatter" ,
550556 "description" : " Default frontmatter options applied to all slides" ,
You can’t perform that action at this time.
0 commit comments