From 7db8172431ad6c5f0cd2ec82a65c2007be90befc Mon Sep 17 00:00:00 2001 From: Matt Copperwaite Date: Sat, 18 Nov 2023 12:36:35 +0000 Subject: [PATCH] notes about how to run locally --- README.md | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8929f37..aa377d5 100644 --- a/README.md +++ b/README.md @@ -4,23 +4,45 @@ You can submit radio stations from YouTube as Pull Requests, or fork this repo to create your own playlist. -## Enable Auto Play - -Some browsers block automatic playing of videos. You may have to go to YouTube to enable this to get Static to work. - ## How does it work - There is a hidden iframe that switches between different URLs for embedded live streams from YouTube based on the station you select. The code here hooks in to an unofficial API in YouTube that allows you to pause a stream. +### Enable Auto Play + +Some browsers block automatic playing of videos. You may have to go to YouTube to enable this to get Static to work. + The backgrounds are videos from giphy that are loaded in a video element in the background. -## Updating Stations +### Updating Stations Update the streams JSON in `src/data` to listen to your preferred live streams. It currently only works with YouTube. -## Updating Backgrounds +### Updating Backgrounds Update the backgrounds JSON in `src/data` to select relaxing animations to have in the background. Note that they are played at 50% speed to make them even more relaxing. +## Development + +You can run this locally by building with webpack, putting all the files together in a public directory and hosting a static server there. + +From the root of this repo: + +```bash +npx webpack-cli +mkdir -p public +cp main/dist/main.js main/dist/main.js.map public +cp main/src/html/index.html public +cp main/src/css/main.css public +cp main/src/data/* public +``` + +### Testing JS changes + +```bash +npx webpack-cli && cp dist/main.js* public/ && python3 -m http.server -d public/ +``` + +Then opening your browser at the URL it displays + ## License AGPLv3