fuck it ship it

This commit is contained in:
cirroskais 2024-03-31 23:43:58 -04:00
parent f85681bd9d
commit f6cb57ddb8
No known key found for this signature in database
GPG key ID: 5FC73EBF2678E33D
6 changed files with 54 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 KiB

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 KiB

After

Width:  |  Height:  |  Size: 379 KiB

View file

@ -1,11 +1,13 @@
<script> <script>
import { scale } from "svelte/transition"; import { scale } from "svelte/transition";
import { Map, Gamepad2, Disc3 } from "lucide-svelte"; import { Map, Gamepad2, Disc3 } from "lucide-svelte";
import { writable } from "svelte/store";
import { audioMethod } from "./config.json";
import { gameDetails } from "./lib/events"; import { gameDetails } from "./lib/events";
import Slideshow from "./lib/Slideshow.svelte"; import Slideshow from "./lib/Slideshow.svelte";
import Playlist from "./lib/Playlist.svelte"; import Playlist from "./lib/Playlist.svelte";
import { writable } from "svelte/store"; import Radio from "./lib/Radio.svelte";
let title = writable(); let title = writable();
</script> </script>
@ -14,7 +16,11 @@
<div in:scale class="h-screen w-screen"> <div in:scale class="h-screen w-screen">
<div class="h-full w-full flex justify-center items-center absolute blur-sm"> <div class="h-full w-full flex justify-center items-center absolute blur-sm">
<Slideshow /> <Slideshow />
<Playlist {title} /> {#if audioMethod === "playlist"}
<Playlist {title} />
{:else if audioMethod === "radio"}
<Radio {title} />
{/if}
</div> </div>
<div class="h-full w-full flex justify-center items-center relative z-10"> <div class="h-full w-full flex justify-center items-center relative z-10">
<div class="w-[42rem] grid grid-cols-3 gap-2"> <div class="w-[42rem] grid grid-cols-3 gap-2">

View file

@ -1,10 +1,16 @@
{ {
"imageDuration": 10, "imageDuration": 10,
"images": ["/img/1.jpg", "/img/2.jpg", "/img/3.jpg", "/img/4.jpg", "/img/5.jpg", "/img/6.jpg", "/img/7.jpg", "/img/8.jpg"], "images": ["/img/1.jpg", "/img/2.jpg", "/img/3.jpg", "/img/4.jpg", "/img/5.jpg", "/img/6.jpg", "/img/7.jpg", "/img/8.jpg"],
"audioMethod": "radio",
"radio": "https://noise.madhouselabs.net",
"radioServerName": "dope",
"playlist": [ "playlist": [
{ "title": "MF DOOM - Rapp Snitch Knishes", "location": "/audio/Rapp Snitch Knishes.mp3" }, { "title": "MF DOOM - Rapp Snitch Knishes", "location": "/audio/Rapp Snitch Knishes.mp3" },
{ "title": "Modjo - Lady (Hear Me Tonight)", "location": "/audio/Lady.mp3" }, { "title": "Modjo - Lady (Hear Me Tonight)", "location": "/audio/Lady.mp3" },
{ "title": "EVABOY - is there a point (girl u know)", "location": "/audio/is there a point (girl u know).mp3" }, { "title": "EVABOY - is there a point (girl u know)", "location": "/audio/is there a point (girl u know).mp3" },
{ "title": "snuffles - SPOTS", "location": "/audio/SPOTS.mp3" } { "title": "snuffles - SPOTS", "location": "/audio/SPOTS.mp3" }
] ]
} }

View file

@ -1,12 +1,11 @@
<script> <script>
import { playlist } from "../config.json"; import { playlist } from "../config.json";
export let title;
let index = Math.floor(Math.random() * playlist.length), let index = Math.floor(Math.random() * playlist.length),
selected = playlist[index], selected = playlist[index],
volume = 0.05; volume = 0.05;
export let title;
title.set(selected.title); title.set(selected.title);
function ended() { function ended() {

38
src/lib/Radio.svelte Normal file
View file

@ -0,0 +1,38 @@
<script>
import { radio, radioServerName } from "../config.json";
export let title;
let listenUrl,
volume = 0.05;
setInterval(async () => {
const response = await fetch(radio + "/status-json.xsl");
const body = await response.json();
const data = body.source?.length
? body.icestats.source?.find((s) => {
return s.server_name === radioServerName;
})
: body.icestats.source;
title.set(`${data.artist} - ${data.title}`);
}, 1000 * 5);
async function main() {
const response = await fetch(radio + "/status-json.xsl");
const body = await response.json();
const data = body.source?.length
? body.icestats.source?.find((s) => {
return s.server_name === radioServerName;
})
: body.icestats.source;
listenUrl = data.listenurl;
title.set(`${data.artist} - ${data.title}`);
}
main();
</script>
<audio src={listenUrl} bind:volume autoplay></audio>