slidevjs / slidev

Presentation Slides for Developers
https://sli.dev
MIT License
32.82k stars 1.33k forks source link

Feature Request: Timed auto advancement to next slide #1051

Open TadeSF opened 1 year ago

TadeSF commented 1 year ago

I discovered slidev recently and so far I absolutely love it. However, I have a feature request that is well supported in Slideshow Apps like PowerPoint or Keynote – switching to the next slide based on a timer rather then the need to klick.

Context: At the start of my presentation, I have a few slides with some introductory animations and audio files. It would be very nice to just start the first slide and let him continue autonomously based on the seconds I assigned each slide. E.g. the first advances after 5 seconds, the second after 10 seconds.

Since I am not very experienced in Vue I have no Idea how complex this would be (I am sure it is more complex then I think now) – but from my naive perspective this seems like a rather simple thing to implement: Define a "time" key in the header section of the slide and thereby trigger a timeout function that switches slides after the time is over.

I hope this is not redundant, but I couldn't find this feature in the docs and the issues.

If you point me in the right direction I would be more than happy to fork and try to implement this myself.

On a final note: Thank you so much for the great work – I am always blown away by the open source community and especially what you guys were able to create! Slidev grands me exactly the customisation tools I always missed when using PowerPoint.

John98Zakaria commented 6 months ago

Here is a prototype for your case :)


# Hello

---
preload: false
---
Slide 1

Preload false is needed so that the component doesn't get mounted and executes the timeout

<script setup>
import {onMounted} from 'vue';

onMounted(() => {

if ($slidev.nav.currentPage===$page.value){
  setTimeout(()=> {$slidev.nav.nextSlide()},2000)
}})

</script>

---

Slide 2

---

Slide 3
TadeSF commented 6 months ago

Thanks John98Zakaria, thats a smart idea. I would still prefer this as a build in feature, since it is a pretty common use case I guess :)

But for the time being it will work perfectly well.

septatrix commented 1 week ago

I would also like a general timer and an option to add time hints to slides which contain the timestamp when a slide should be reached (and left). When the presenter is on schedule the timer is displayed normally and when they are ahead of time or behind time the timer would become tinted in red/orange or similar