codepo8 / slide-show

A full screen slide show for images and videos
https://codepo8.github.io/slide-show/slideshow.html
31 stars 15 forks source link
gifs slideshow videos

Vanilla JS Slide full screen slide show for videos and images

Why?

This is a scratch-your-own-itch project as I wanted a way to see images and videos full screen in my browser that loop.

Preview and Quicklook on MacOS are awesome but their treatment of GIFs and the inability for Quicklook to loop videos annoyed me, so I wrote this. You can see it in action in this YouTube Video

Slide show showing a picture of a dog with a lot of tennis balls

Features

Usage

You can use the slideshow by giving it a container to create all the elements in, define the different settings of the slideshow object:

<div id="slideshow-container"></div>
<script>
  let slideshow = {
    container: '#slideshow-container',
    media: [
    'ball.mp4','dinowalk.mp4','dirty.mp4',
    'goldiejump.mp4','step.mp4','tippy.mp4','wag.mp4'
    ],
    folder: 'imgs/',
    autoplay: 'yes'
  }
</script>
<script src="https://github.com/codepo8/slide-show/raw/main/slideshow.js"></script>

Automating the media collection

Currently I am using this on my hard drive running a local server and the index.php script. If you are using a Mac, PHP comes with the system. Go to the terminal, navigate to the folder where the slide show is and run:

$ php -S localhost:8000

Then you can navigate in you browser to localhost:8000 and the rest happens automatically.

The index.php script lists all the current folders in the directory the script is in and gives you list of all of them. Clicking the link of the name starts the slide show with the current folder. Feel free to check the script, but there isn't much magic there.