Repository navigation
Expand file tree
/
Copy pathremote.php
More file actions
179 lines (171 loc) · 10.3 KB
/
Copy pathremote.php
File metadata and controls
179 lines (171 loc) · 10.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
/**
* Mobile Remote. URL: remote.php?room=XXX&guest=GID&nick=NAME&color=HEX&status=approved|pending
* - Search songs, add to queue, vote, react, favorites, AI DJ
* - If status=pending, shows a "waiting for host approval" screen.
*/
require_once __DIR__ . '/lib/config.php';
$cfg = config_get();
$roomId = strtoupper(trim($_GET['room'] ?? ''));
$guestId = (int)($_GET['guest'] ?? 0);
$nick = $_GET['nick'] ?? 'Guest';
$color = $_GET['color'] ?? '#ff5a5f';
$status = $_GET['status'] ?? 'approved';
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>Queueoke · Remote</title>
<link rel="stylesheet" href="assets/css/app.css">
<style>
body { padding-bottom: 70px; }
.topbar { position: sticky; top: 0; z-index: 100; background: rgba(18,18,31,0.85);
padding: 12px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--panel-2);
backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.topbar .avatar { width: 34px; height: 34px; }
.topbar .nick { font-weight: 700; }
.conn-status { margin-left: auto; font-size: .8rem; color: var(--muted);
display: inline-flex; align-items: center; gap: 6px; }
.conn-status .dot { width: 8px; height: 8px; border-radius: 50%;
background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse-dot 1.5s ease infinite; }
.conn-status.live .dot { background: var(--green); box-shadow: 0 0 8px var(--green); animation: none; }
.conn-status.live { color: var(--green); }
.conn-status.waiting .dot { background: var(--amber); }
.conn-status.error .dot { background: var(--red); box-shadow: 0 0 8px var(--red); animation: none; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.tabs { display: flex; gap: 6px; padding: 10px 12px; position: sticky; top: 57px; z-index: 99;
background: rgba(8,8,15,0.85); border-bottom: 1px solid var(--panel-2); overflow-x: auto;
backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.tab { padding: 8px 16px; border-radius: 999px; background: var(--panel); font-weight: 600; font-size: .88rem; white-space: nowrap; transition: background var(--t-fast), color var(--t-fast); border: 1px solid transparent; }
.tab.active { background: var(--grad-pink); color: #fff; box-shadow: var(--glow-pink); border-color: transparent; }
.pane { padding: 16px; display: none; }
.pane.active { display: block; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.search-row { display: flex; gap: 8px; margin-bottom: 14px; }
.search-row .input { flex: 1; }
.result { display: flex; gap: 10px; padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid transparent; margin-bottom: 8px; align-items: center; transition: background var(--t-fast), border-color var(--t-fast); }
.result:hover { background: var(--panel-2); border-color: var(--panel-3); }
.result img { width: 96px; height: 54px; object-fit: cover; border-radius: 8px; background: var(--bg-2); }
.result .meta { flex: 1; min-width: 0; }
.result .t { font-weight: 600; font-size: .92rem; }
.result .s { color: var(--muted); font-size: .78rem; }
.result .acts { display: flex; flex-direction: column; gap: 4px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; background: var(--panel-2);
display: flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: transform var(--t-fast), background var(--t-fast); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.fav-on { background: var(--amber); color: #1a1a2e; }
.icon-btn.add { background: var(--grad-pink); color: #fff; box-shadow: var(--glow-pink); }
.qitem { display: flex; gap: 10px; padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid transparent; margin-bottom: 8px; align-items: center; transition: background var(--t-fast); }
.qitem:hover { background: var(--panel-2); }
.qitem.playing { background: var(--grad-pink); border-color: rgba(255,45,120,0.3); }
.qitem.playing .t { color: #fff; }
.qitem.playing .s { color: rgba(255,255,255,0.8); }
.qitem .pos { width: 24px; text-align: center; font-weight: 800; color: var(--purple); }
.qitem img { width: 56px; height: 40px; object-fit: cover; border-radius: 6px; }
.qitem .meta { flex: 1; min-width: 0; }
.qitem .t { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qitem .s { color: var(--muted); font-size: .76rem; }
.soundboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sfx { aspect-ratio: 1; border-radius: 16px; background: var(--panel); border: 1px solid var(--panel-2); display: flex;
flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 2rem; font-weight: 800;
transition: transform var(--t-fast), background var(--t-fast), box-shadow var(--t-fast); }
.sfx:active { transform: scale(0.94); background: var(--grad-pink); box-shadow: var(--glow-pink); }
.sfx .lbl { font-size: .72rem; font-weight: 600; color: var(--muted); }
.moods { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.mood { padding: 8px 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-2); font-size: .85rem; font-weight: 600; transition: background var(--t-fast), border-color var(--t-fast); }
.mood.active { background: var(--grad-pink); color: #fff; border-color: transparent; box-shadow: var(--glow-pink); }
.pending-screen { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 24px; }
.pending-screen .big { font-size: 4rem; animation: pulse 1.4s ease infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }
</style>
</head>
<body>
<div class="topbar">
<div class="avatar" style="background:<?= htmlspecialchars($color) ?>"><?= htmlspecialchars(mb_substr($nick,0,1)) ?></div>
<div>
<div class="nick"><?= htmlspecialchars($nick) ?></div>
<div class="small muted">Room <?= htmlspecialchars($roomId) ?></div>
</div>
<div class="conn-status <?= $status === 'approved' ? 'live' : 'waiting' ?>" id="conn-status"><span class="dot"></span> <?= $status === 'approved' ? 'live' : 'connecting' ?></div>
</div>
<!-- Pending approval screen (hidden by default if already approved) -->
<div class="pending-screen<?= $status === 'approved' ? ' hidden' : '' ?>" id="pending-screen">
<div class="big">⏳</div>
<div class="h1">Waiting for host approval</div>
<div class="muted">The TV host will let you in shortly. Hang tight!</div>
<div class="small muted" style="margin-top:8px">Room <?= htmlspecialchars($roomId) ?></div>
</div>
<!-- Main app (hidden until approved) -->
<div id="app"<?= $status === 'approved' ? '' : ' class="hidden"' ?>>
<div class="tabs">
<button class="tab active" data-tab="search">🔍 Search</button>
<button class="tab" data-tab="queue">📋 Queue</button>
<button class="tab" data-tab="dj">🤖 AI DJ</button>
<button class="tab" data-tab="favs">⭐ Favorites</button>
<button class="tab" data-tab="sfx">🎉 React</button>
</div>
<!-- SEARCH -->
<div class="pane active" id="pane-search">
<div class="search-row">
<input class="input" id="search-input" placeholder="Search karaoke songs..." autocomplete="off">
</div>
<div id="search-results"><div class="muted small">Type to search millions of karaoke tracks.</div></div>
</div>
<!-- QUEUE -->
<div class="pane" id="pane-queue">
<div class="section-title">Now playing</div>
<div id="now-playing"><div class="muted small">Nothing playing yet.</div></div>
<div class="section-title" style="margin-top:14px">Up next</div>
<div id="upcoming"><div class="muted small">Queue is empty.</div></div>
</div>
<!-- AI DJ -->
<div class="pane" id="pane-dj">
<div class="section-title">Pick a mood for instant suggestions</div>
<div class="moods" id="moods">
<button class="mood" data-mood="Party Belters">🎉 Party Belters</button>
<button class="mood" data-mood="Rock Anthems">🎸 Rock Anthems</button>
<button class="mood" data-mood="Pop Nostalgia">💿 Pop Nostalgia</button>
<button class="mood" data-mood="Emotional Duets">💔 Emotional Duets</button>
<button class="mood" data-mood="Chill Vibes">🌙 Chill Vibes</button>
</div>
<div id="dj-results"><div class="muted small">Tap a mood to get AI-curated karaoke picks.</div></div>
</div>
<!-- FAVORITES -->
<div class="pane" id="pane-favs">
<div class="section-title">Your signature tracks (saved on this phone)</div>
<div id="fav-list"><div class="muted small">No favorites yet. Tap the ⭐ on a song to save it.</div></div>
</div>
<!-- SOUNDBOARD -->
<div class="pane" id="pane-sfx">
<div class="section-title">Hype up the singer</div>
<div class="soundboard">
<button class="sfx" data-r="applause">👏<span class="lbl">Applause</span></button>
<button class="sfx" data-r="cheer">🎉<span class="lbl">Cheer</span></button>
<button class="sfx" data-r="airhorn">📯<span class="lbl">Airhorn</span></button>
<button class="sfx" data-r="gong">🔔<span class="lbl">Gong</span></button>
<button class="sfx" data-r="chime">✨<span class="lbl">Chime</span></button>
<button class="sfx" data-r="boo">🍅<span class="lbl">Boo</span></button>
<button class="sfx" data-r="confetti">🎊<span class="lbl">Confetti</span></button>
</div>
<div class="small muted" style="margin-top:14px">Reactions play through the TV speakers and trigger confetti on the big screen.</div>
</div>
</div>
<script>
window.QUEUEOKE_CFG = {
pusher_key: '<?= htmlspecialchars($cfg['PUSHER_KEY']) ?>',
pusher_cluster: '<?= htmlspecialchars($cfg['PUSHER_CLUSTER']) ?>',
api_base: 'api',
room_id: '<?= htmlspecialchars($roomId) ?>',
guest_id: <?= $guestId ?>,
nick: '<?= htmlspecialchars($nick) ?>',
color: '<?= htmlspecialchars($color) ?>',
status: '<?= htmlspecialchars($status) ?>',
};
</script>
<script src="https://js.pusher.com/8.2.0/pusher.min.js"></script>
<script src="assets/js/common.js"></script>
<script src="assets/js/remote.js"></script>
</body>
</html>