A simple Express web server with a vanilla JS and RxJS Frontend for sequentially displaying a collection of gifs. Gifs from the collection can also be configured to reappear every x gifs (for example a logo).
This project was used as a learning tool for npm as a task runner, JS Promises, RxJS Observables, JS Classes Vs Generator functions and Docker.
$ docker pull soon/gif-tvRun the following command to start the container with the default gifs and port configuration.
$ docker run --rm -it -p 3000:3000 soon/gif-tvAlternatively, run the following command to configure port, gif collection and those gifs which should be repeated.
$ docker run --rm -it -p 3000:3000 -v [/PATH/TO/YOUR/GIFS]:/src/app/public/assets/GIFS -v [/PATH/TO/YOUR/REGULARGIFS/CONFIG.JSON]:/src/app/config/regularGifsInfo.JSON soon/gif-tvNote that the JSON file for the repeating gifs (called regularGifs within gif-tv) should be structured as follows. As many gifs as desired can be added to the array.
[{
"filename": "SOON_Logo_v4.gif",
"frequency": 20
}, {
"filename": "Soon_3D_v1.gif",
"frequency": 30
}]$ open http://127.0.0.1:[PORT SELECTED IN DOCKER RUN COMMAND]/$ npm i$ npm run buildThe site will be generated in the public directory.
$ npm run watchGifs must be copied into src/assets/GIFS
In the regularGifsInfo.JSON file configure the filenames and frequencies of the gifs you would like to appear on a regular basis. As many gifs as desired can be added to the array.
[{
"filename": "SOON_Logo_v4.gif",
"frequency": 20
}, {
"filename": "Soon_3D_v1.gif",
"frequency": 30
}]$ npm run serveAccess the server:
$ open http://127.0.0.1:3000/- Randomise gif playback
- SOON_ gif every 5th
- Recursive search of gif folder
- Improve npm build / watch tasks
- Configure Docker
- Next button
- Animate between gifs