aboutsummaryrefslogtreecommitdiff
path: root/web/src
diff options
context:
space:
mode:
authorgammelalf <gammelalf@hopfen.space>2023-01-25 21:22:38 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2023-02-24 12:47:40 +0100
commitc0c4bea988208f75fa4534b807a026de3f619eaf (patch)
tree5e46b190f877ce4af8a6134c9f33a05c120a94c3 /web/src
parent933e3b7e5a3a18a8c3f315f6c0d8c2375ceecb3c (diff)
downloadWRMS-c0c4bea988208f75fa4534b807a026de3f619eaf.tar.gz
WRMS-c0c4bea988208f75fa4534b807a026de3f619eaf.zip
Switched from SvelteKit to Svelte
Diffstat (limited to 'web/src')
-rw-r--r--web/src/app.d.ts12
-rw-r--r--web/src/app.html13
-rw-r--r--web/src/assets/add.svg (renamed from web/src/svg/add.svg)0
-rw-r--r--web/src/assets/pause.svg (renamed from web/src/svg/pause.svg)0
-rw-r--r--web/src/assets/play.svg (renamed from web/src/svg/play.svg)0
-rw-r--r--web/src/assets/stop.svg (renamed from web/src/svg/stop.svg)0
-rw-r--r--web/src/index.css52
-rw-r--r--web/src/lib/devData.json27
-rw-r--r--web/src/main.svelte (renamed from web/src/routes/+page.svelte)14
-rw-r--r--web/src/main.ts7
-rw-r--r--web/src/routes/+page.ts1
-rw-r--r--web/src/vite-env.d.ts2
12 files changed, 67 insertions, 61 deletions
diff --git a/web/src/app.d.ts b/web/src/app.d.ts
deleted file mode 100644
index f59b884..0000000
--- a/web/src/app.d.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-// See https://kit.svelte.dev/docs/types#app
-// for information about these interfaces
-declare global {
- namespace App {
- // interface Error {}
- // interface Locals {}
- // interface PageData {}
- // interface Platform {}
- }
-}
-
-export {};
diff --git a/web/src/app.html b/web/src/app.html
deleted file mode 100644
index 2404d44..0000000
--- a/web/src/app.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <title>WRMS</title>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <link rel="stylesheet" href="%sveltekit.assets%/client.css" />
- %sveltekit.head%
- </head>
- <body>
- %sveltekit.body%
- </body>
-</html>
diff --git a/web/src/svg/add.svg b/web/src/assets/add.svg
index 55d75aa..55d75aa 100644
--- a/web/src/svg/add.svg
+++ b/web/src/assets/add.svg
diff --git a/web/src/svg/pause.svg b/web/src/assets/pause.svg
index 6559131..6559131 100644
--- a/web/src/svg/pause.svg
+++ b/web/src/assets/pause.svg
diff --git a/web/src/svg/play.svg b/web/src/assets/play.svg
index 59855de..59855de 100644
--- a/web/src/svg/play.svg
+++ b/web/src/assets/play.svg
diff --git a/web/src/svg/stop.svg b/web/src/assets/stop.svg
index 76301a5..76301a5 100644
--- a/web/src/svg/stop.svg
+++ b/web/src/assets/stop.svg
diff --git a/web/src/index.css b/web/src/index.css
new file mode 100644
index 0000000..58fba29
--- /dev/null
+++ b/web/src/index.css
@@ -0,0 +1,52 @@
+:root {
+ --background: #222222;
+ --primary: white;
+ --secondary: gray;
+}
+
+html {
+ width: 100%;
+ overflow: hidden;
+}
+
+body {
+ position: fixed;
+ overflow-y: scroll;
+ -webkit-overflow-scrolling: touch;
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ background-color: var(--background);
+ color: var(--primary);
+}
+
+a {
+ color: yellow;
+ text-decoration: none;
+}
+a:hover {
+ color: orange;
+}
+
+.flex-column {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.flex-row {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+}
+
+.icon-button {
+ --icon-size: 4em;
+ border: none;
+ background-color: transparent;
+}
+.icon-button > img {
+ width: var(--icon-size);
+ height: var(--icon-size);
+ filter: invert(100%);
+}
diff --git a/web/src/lib/devData.json b/web/src/lib/devData.json
deleted file mode 100644
index 9f99e61..0000000
--- a/web/src/lib/devData.json
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- { "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/main.svelte
index dd23681..38b3699 100644
--- a/web/src/routes/+page.svelte
+++ b/web/src/main.svelte
@@ -1,17 +1,15 @@
<script lang="ts">
import { onDestroy, onMount } from 'svelte';
- import addSVG from '../svg/add.svg';
- import playSVG from '../svg/play.svg';
- 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';
+ import addSVG from './assets/add.svg';
+ import playSVG from './assets/play.svg';
+ import pauseSVG from './assets/pause.svg';
+ import type { WsMessage, Song, SearchResponse } from './lib/api';
+ import API from './lib/api';
API.baseUrl = '/';
let status: 'paused' | 'playing' = 'paused';
let currentSong: Song | null = null;
- let playlist: Array<Song> = dev ? devData : [];
+ let playlist: Array<Song> = [];
let votes: Map<string, 'up' | 'down'> = new Map();
let search = '';
diff --git a/web/src/main.ts b/web/src/main.ts
new file mode 100644
index 0000000..099b842
--- /dev/null
+++ b/web/src/main.ts
@@ -0,0 +1,7 @@
+import App from './main.svelte';
+
+const app = new App({
+ target: document.body
+});
+
+export default app;
diff --git a/web/src/routes/+page.ts b/web/src/routes/+page.ts
deleted file mode 100644
index 189f71e..0000000
--- a/web/src/routes/+page.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const prerender = true;
diff --git a/web/src/vite-env.d.ts b/web/src/vite-env.d.ts
new file mode 100644
index 0000000..4078e74
--- /dev/null
+++ b/web/src/vite-env.d.ts
@@ -0,0 +1,2 @@
+/// <reference types="svelte" />
+/// <reference types="vite/client" />