186 lines
4.3 KiB
HTML
186 lines
4.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
<title>Host - Jaka To Melodia</title>
|
|
|
|
<link rel="stylesheet" href="/pattern.css" />
|
|
<script src="/socket.js"></script>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
--fgcolor: #e77021;
|
|
--bgcolor: #f97a1e;
|
|
--pattern: 22px;
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
min-height: 100vh;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
padding: 1rem;
|
|
}
|
|
|
|
.container {
|
|
width: 100%;
|
|
max-width: 600px;
|
|
border-radius: 1rem;
|
|
padding: 2rem;
|
|
background: #1a1a1a;
|
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
|
|
}
|
|
|
|
h1 {
|
|
text-align: center;
|
|
margin-bottom: 1.5rem;
|
|
color: #f0f0f0;
|
|
font-size: 2rem;
|
|
}
|
|
|
|
.track-info {
|
|
background: var(--bgcolor);
|
|
border-radius: 0.75rem;
|
|
padding: 1.5rem;
|
|
margin-bottom: 2rem;
|
|
color: white;
|
|
text-align: center;
|
|
}
|
|
|
|
.track-info .artist {
|
|
font-size: 1.25rem;
|
|
font-weight: 600;
|
|
margin-bottom: 0.5rem;
|
|
opacity: 0.95;
|
|
}
|
|
|
|
.track-info .track {
|
|
font-size: 1.5rem;
|
|
font-weight: 700;
|
|
}
|
|
|
|
.section {
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.section-title {
|
|
font-size: 0.875rem;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
color: #999;
|
|
margin-bottom: 0.75rem;
|
|
}
|
|
|
|
.button-group {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
|
|
gap: 0.75rem;
|
|
}
|
|
|
|
button {
|
|
padding: 1rem;
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
color: white;
|
|
background: var(--bgcolor);
|
|
border: none;
|
|
border-radius: 0.5rem;
|
|
cursor: pointer;
|
|
transition: transform 0.2s, box-shadow 0.2s;
|
|
box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
|
|
}
|
|
|
|
button:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 6px 20px rgba(255, 68, 68, 0.6);
|
|
}
|
|
|
|
button:active {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
/* @media (prefers-color-scheme: dark) {
|
|
|
|
|
|
h1 {
|
|
|
|
}
|
|
|
|
.section-title {
|
|
|
|
}
|
|
|
|
button {
|
|
background: linear-gradient(135deg, #cc9900 0%, #cc0000 100%);
|
|
}
|
|
} */
|
|
</style>
|
|
</head>
|
|
<body class="patterned">
|
|
<div class="container">
|
|
<h1>Host Panel</h1>
|
|
|
|
<div class="track-info">
|
|
<div class="track" id="track">—</div>
|
|
<div class="artist" id="artist">—</div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<div class="section-title">Playback</div>
|
|
<div class="button-group">
|
|
<button onclick="socket.host('play')">Play</button>
|
|
<button onclick="socket.host('pause')">Pause</button>
|
|
<button onclick="socket.host('next')">Next</button>
|
|
<button onclick="socket.host('clear')">Clear</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<div class="section-title">Points</div>
|
|
<div class="button-group">
|
|
<button onclick="socket.host('points', { points: 0.5 })">+0.5</button>
|
|
<button onclick="socket.host('points', { points: 1 })">+1</button>
|
|
<button onclick="socket.host('points', { points: 2 })">+2</button>
|
|
<button onclick="socket.host('nextPlayer')">Next Player</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<div class="section-title">QR Code</div>
|
|
<div class="button-group">
|
|
<button onclick="socket.host('showQr', { show: true })">Show QR</button>
|
|
<button onclick="socket.host('showQr', { show: false })">Hide QR</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- <div class="section">
|
|
<div class="section-title">Scoreboard</div>
|
|
<div class="button-group">
|
|
<button onclick="socket.host('showScoreboard', { show: true })">Show Scoreboard</button>
|
|
<button onclick="socket.host('showScoreboard', { show: false })">Hide Scoreboard</button>
|
|
</div>
|
|
</div> -->
|
|
</div>
|
|
|
|
<script>
|
|
const socket = new Socket('host')
|
|
|
|
const artistElement = document.querySelector('#artist')
|
|
const trackElement = document.querySelector('#track')
|
|
|
|
// Use custom event listener for metadata updates
|
|
socket.on('metadata', metadata => {
|
|
artistElement.textContent = metadata.author
|
|
trackElement.textContent = metadata.track
|
|
})
|
|
</script>
|
|
</body>
|
|
</html>
|