Merge branch 'main' of https://repos.hackathon.bz.it/2025-summer/team-1
This commit is contained in:
commit
6a50dc4c86
9 changed files with 27 additions and 26 deletions
|
@ -3,10 +3,10 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="%sveltekit.assets%/favicon.ico" />
|
<link rel="icon" href="%sveltekit.assets%/favicon.ico" />
|
||||||
|
<link rel="manifest" href="manifest.json" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body data-sveltekit-preload-data="hover" class="h-max">
|
<body data-sveltekit-preload-data="hover" class="h-max">
|
||||||
<div style="display: contents">%sveltekit.body%</div>
|
<div style="display: contents">%sveltekit.body%</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -7,9 +7,8 @@
|
||||||
|
|
||||||
let picked_suggestions: string[] = $state([])
|
let picked_suggestions: string[] = $state([])
|
||||||
|
|
||||||
async function vote(idx: number, amount: number, songId: string) {
|
async function vote(amount: number, songId: string) {
|
||||||
if (picked_suggestions.includes(songId)) return console.log("rejecting vote")
|
if (picked_suggestions.includes(songId)) return console.log("rejecting vote")
|
||||||
suggestions[idx].upvote += amount
|
|
||||||
await fetch(`/api/song/voting?room=${roomId}&song=${songId}&increment=${amount}`, { method: "POST" })
|
await fetch(`/api/song/voting?room=${roomId}&song=${songId}&increment=${amount}`, { method: "POST" })
|
||||||
picked_suggestions.push(songId)
|
picked_suggestions.push(songId)
|
||||||
console.log("accepted vote")
|
console.log("accepted vote")
|
||||||
|
@ -26,7 +25,7 @@
|
||||||
<p>No suggestions yet! Try to add a new one using the Add button</p>
|
<p>No suggestions yet! Try to add a new one using the Add button</p>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#each suggestions as sug, idx}
|
{#each suggestions as sug}
|
||||||
<div
|
<div
|
||||||
class="flex h-[80px] w-full flex-row gap-2 rounded-md border-dark-pine-muted bg-light-pine-overlay p-2 shadow-md duration-100 hover:bg-dark-pine-base/20 dark:bg-dark-pine-overlay hover:dark:bg-light-pine-base/20"
|
class="flex h-[80px] w-full flex-row gap-2 rounded-md border-dark-pine-muted bg-light-pine-overlay p-2 shadow-md duration-100 hover:bg-dark-pine-base/20 dark:bg-dark-pine-overlay hover:dark:bg-light-pine-base/20"
|
||||||
>
|
>
|
||||||
|
@ -48,7 +47,8 @@
|
||||||
class={!picked_suggestions.includes(sug.uuid) ? "text-light-pine-green duration-100 hover:scale-150 dark:text-dark-pine-green" : "text-light-pine-muted dark:text-dark-pine-muted"}
|
class={!picked_suggestions.includes(sug.uuid) ? "text-light-pine-green duration-100 hover:scale-150 dark:text-dark-pine-green" : "text-light-pine-muted dark:text-dark-pine-muted"}
|
||||||
disabled={!!picked_suggestions.includes(sug.uuid)}
|
disabled={!!picked_suggestions.includes(sug.uuid)}
|
||||||
onclick={async () => {
|
onclick={async () => {
|
||||||
await vote(idx, 1, sug.uuid)
|
sug.upvode += 1
|
||||||
|
await vote(1, sug.uuid)
|
||||||
}}><ThumbsUp /></button
|
}}><ThumbsUp /></button
|
||||||
>
|
>
|
||||||
<p class="font-semibold text-light-pine-text dark:text-dark-pine-text">{sug.upvote}</p>
|
<p class="font-semibold text-light-pine-text dark:text-dark-pine-text">{sug.upvote}</p>
|
||||||
|
@ -56,7 +56,8 @@
|
||||||
class={!picked_suggestions.includes(sug.uuid) ? "text-light-pine-red duration-100 hover:scale-150 dark:text-dark-pine-red" : "text-light-pine-muted dark:text-dark-pine-muted"}
|
class={!picked_suggestions.includes(sug.uuid) ? "text-light-pine-red duration-100 hover:scale-150 dark:text-dark-pine-red" : "text-light-pine-muted dark:text-dark-pine-muted"}
|
||||||
disabled={!!picked_suggestions.includes(sug.uuid)}
|
disabled={!!picked_suggestions.includes(sug.uuid)}
|
||||||
onclick={async () => {
|
onclick={async () => {
|
||||||
await vote(idx, -1, sug.uuid)
|
sug.upvode += 1
|
||||||
|
await vote(-1, sug.uuid)
|
||||||
}}><ThumbsDown /></button
|
}}><ThumbsDown /></button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
window.location.href = "/room/new"
|
window.location.href = "/room/create"
|
||||||
}}
|
}}
|
||||||
class="fixed right-4 bottom-4 flex flex-row gap-1 rounded-xl bg-light-pine-blue p-2 text-dark-pine-text sm:right-20 md:right-40 lg:right-80 dark:bg-dark-pine-blue"
|
class="fixed right-4 bottom-4 flex flex-row gap-1 rounded-xl bg-light-pine-blue p-2 text-dark-pine-text sm:right-20 md:right-40 lg:right-80 dark:bg-dark-pine-blue"
|
||||||
>
|
>
|
||||||
|
|
BIN
frontend/static/android-chrome-192x192.png
Normal file
BIN
frontend/static/android-chrome-192x192.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
BIN
frontend/static/android-chrome-512x512.png
Normal file
BIN
frontend/static/android-chrome-512x512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 142 KiB |
BIN
frontend/static/apple-touch-icon.png
Normal file
BIN
frontend/static/apple-touch-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
BIN
frontend/static/favicon-16x16.png
Normal file
BIN
frontend/static/favicon-16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 768 B |
BIN
frontend/static/favicon-32x32.png
Normal file
BIN
frontend/static/favicon-32x32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
|
@ -1,21 +1,21 @@
|
||||||
{
|
{
|
||||||
"name": "Chillbox Music Player",
|
"name": "Chillbox Music Player",
|
||||||
"short_name": "Chillbox",
|
"short_name": "Chillbox",
|
||||||
"start_url": "/",
|
"start_url": "/",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"background_color": "#334155",
|
"background_color": "#334155",
|
||||||
"theme_color": "#334155",
|
"theme_color": "#334155",
|
||||||
"orientation": "portrait-primary",
|
"orientation": "portrait-primary",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "/icon-512.png",
|
"src": "/android-chrome-512x512.png",
|
||||||
"sizes": "512x512",
|
"sizes": "512x512",
|
||||||
"type": "image/png"
|
"type": "image/png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "/icon-192.png",
|
"src": "/android-chrome-192x192.png",
|
||||||
"sizes": "192x192",
|
"sizes": "192x192",
|
||||||
"type": "image/png"
|
"type": "image/png"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue