fuck it ship it
This commit is contained in:
parent
f85681bd9d
commit
f6cb57ddb8
6 changed files with 54 additions and 5 deletions
BIN
public/img/6.jpg
BIN
public/img/6.jpg
Binary file not shown.
Before Width: | Height: | Size: 303 KiB After Width: | Height: | Size: 159 KiB |
BIN
public/img/7.jpg
BIN
public/img/7.jpg
Binary file not shown.
Before Width: | Height: | Size: 351 KiB After Width: | Height: | Size: 379 KiB |
|
@ -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">
|
||||||
|
|
|
@ -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" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
38
src/lib/Radio.svelte
Normal 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>
|
Loading…
Reference in a new issue