From 933e3b7e5a3a18a8c3f315f6c0d8c2375ceecb3c Mon Sep 17 00:00:00 2001 From: gammelalf Date: Tue, 24 Jan 2023 13:35:59 +0100 Subject: Added dev data --- web/src/lib/devData.json | 27 +++++++++++++++++++++++++++ web/src/routes/+page.svelte | 6 ++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 web/src/lib/devData.json (limited to 'web') diff --git a/web/src/lib/devData.json b/web/src/lib/devData.json new file mode 100644 index 0000000..9f99e61 --- /dev/null +++ b/web/src/lib/devData.json @@ -0,0 +1,27 @@ +[ + { "title": "Deutschland", "artist": "Rammstein", "uri": "1", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "2", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "3", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "4", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "5", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "6", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "7", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "8", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "9", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "10", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "11", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "12", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "13", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "14", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "15", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "16", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "17", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "18", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "19", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "20", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "21", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "22", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "23", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "24", "source": "dev", "weight": 0 }, + { "title": "Deutschland", "artist": "Rammstein", "uri": "25", "source": "dev", "weight": 0 } +] diff --git a/web/src/routes/+page.svelte b/web/src/routes/+page.svelte index 28177e2..dd23681 100644 --- a/web/src/routes/+page.svelte +++ b/web/src/routes/+page.svelte @@ -5,11 +5,13 @@ import pauseSVG from '../svg/pause.svg'; import type { WsMessage, Song, SearchResponse } from '../lib/api'; import API from '../lib/api'; + import devData from '../lib/devData.json'; + import { dev } from '$app/environment'; API.baseUrl = '/'; let status: 'paused' | 'playing' = 'paused'; let currentSong: Song | null = null; - let playlist: Array = []; + let playlist: Array = dev ? devData : []; let votes: Map = new Map(); let search = ''; @@ -167,7 +169,7 @@ overflow-y: scroll; display: flex; flex-direction: column; - align-items: center; + align-items: center; } } @media not (max-width: 50em) { -- cgit v1.2.3