workbykait commited on
Commit
d4f7b1c
·
verified ·
1 Parent(s): 6d3f5a8

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +369 -19
index.html CHANGED
@@ -1,19 +1,369 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>RADIO ACCORDION</title>
7
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
8
+ <style>
9
+ * {
10
+ margin: 0;
11
+ padding: 0;
12
+ box-sizing: border-box;
13
+ }
14
+ body {
15
+ background: #000 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><rect width="40" height="40" fill="%23000"/><path d="M0 0h1v40h-1zM0 0v1h40v-1zM39 0v40h1v-40zM0 39h40v1h-40z" fill="%23111111"/></svg>') repeat;
16
+ color: #eee;
17
+ font-family: 'Courier New', Courier, monospace;
18
+ line-height: 1.5;
19
+ }
20
+ header {
21
+ padding: 30px 40px;
22
+ border-bottom: 1px solid #222;
23
+ background: #000;
24
+ }
25
+ h1 {
26
+ font-size: 3.2rem;
27
+ letter-spacing: 6px;
28
+ text-transform: uppercase;
29
+ }
30
+ .subtitle {
31
+ font-size: 1rem;
32
+ color: #555;
33
+ margin-top: 8px;
34
+ }
35
+ main {
36
+ max-width: 1100px;
37
+ margin: 0 auto;
38
+ padding: 40px;
39
+ }
40
+ .accordion-section {
41
+ margin-bottom: 60px;
42
+ }
43
+ .section-title {
44
+ font-size: 2.4rem;
45
+ text-transform: uppercase;
46
+ letter-spacing: 3px;
47
+ padding: 15px 20px;
48
+ background: #111;
49
+ border: 1px solid #222;
50
+ cursor: pointer;
51
+ user-select: none;
52
+ display: flex;
53
+ justify-content: space-between;
54
+ align-items: center;
55
+ }
56
+ .section-title::after {
57
+ content: "▼";
58
+ font-size: 1.1rem;
59
+ transition: transform 0.2s;
60
+ }
61
+ .section-title.open::after {
62
+ transform: rotate(180deg);
63
+ }
64
+ .section-content {
65
+ display: none;
66
+ border: 1px solid #222;
67
+ border-top: none;
68
+ background: #0a0a0a;
69
+ }
70
+ .section-content.open {
71
+ display: block;
72
+ }
73
+ .station {
74
+ border-bottom: 1px solid #222;
75
+ padding: 25px 30px;
76
+ }
77
+ .station:last-child {
78
+ border-bottom: none;
79
+ }
80
+ .location {
81
+ font-size: 1.3rem;
82
+ color: #777;
83
+ margin-bottom: 10px;
84
+ text-transform: uppercase;
85
+ letter-spacing: 1px;
86
+ }
87
+ .name {
88
+ font-size: 2rem;
89
+ margin-bottom: 8px;
90
+ }
91
+ .meta {
92
+ font-size: 1.2rem;
93
+ color: #888;
94
+ margin-bottom: 18px;
95
+ }
96
+ .controls button {
97
+ background: #000;
98
+ color: #ccc;
99
+ border: 1px solid #444;
100
+ padding: 12px 24px;
101
+ font-size: 1.1rem;
102
+ font-family: inherit;
103
+ cursor: pointer;
104
+ margin-right: 12px;
105
+ }
106
+ .controls button:hover {
107
+ background: #222;
108
+ color: #fff;
109
+ }
110
+ #player {
111
+ position: fixed;
112
+ bottom: 0;
113
+ left: 0;
114
+ right: 0;
115
+ background: #000;
116
+ border-top: 1px solid #222;
117
+ padding: 20px 40px;
118
+ display: flex;
119
+ align-items: center;
120
+ gap: 30px;
121
+ flex-wrap: wrap;
122
+ z-index: 10;
123
+ }
124
+ #player-info {
125
+ flex: 1;
126
+ min-width: 200px;
127
+ }
128
+ #player-station {
129
+ font-size: 1.8rem;
130
+ font-weight: bold;
131
+ }
132
+ #player-track {
133
+ font-size: 1.2rem;
134
+ color: #777;
135
+ margin-top: 6px;
136
+ }
137
+ #player-controls button {
138
+ background: #000;
139
+ color: #ccc;
140
+ border: 1px solid #444;
141
+ padding: 14px 24px;
142
+ font-size: 1.4rem;
143
+ min-width: 70px;
144
+ }
145
+ #player-controls button:hover {
146
+ background: #222;
147
+ color: #fff;
148
+ }
149
+ audio {
150
+ display: none;
151
+ }
152
+ @media (max-width: 768px) {
153
+ main { padding: 20px; }
154
+ header { padding: 20px; }
155
+ h1 { font-size: 2.4rem; }
156
+ .section-title { font-size: 1.9rem; }
157
+ .name { font-size: 1.7rem; }
158
+ #player { padding: 15px; gap: 15px; flex-direction: column; text-align: center; }
159
+ }
160
+ </style>
161
+ </head>
162
+ <body>
163
+
164
+ <header>
165
+ <h1>RADIO</h1>
166
+ <div class="subtitle">RAW STREAMS – ACCORDION LAYOUT – BLACK GRID</div>
167
+ </header>
168
+
169
+ <main>
170
+
171
+ <div class="accordion-section">
172
+ <div class="section-title" onclick="toggleSection(this)">UNITED STATES</div>
173
+ <div class="section-content">
174
+
175
+ <div class="station">
176
+ <div class="location">SAN FRANCISCO, CA</div>
177
+ <div class="name">GROOVE SALAD</div>
178
+ <div class="meta">Chill / Downtempo – SomaFM</div>
179
+ <div class="controls">
180
+ <button onclick="play(1)">PLAY</button>
181
+ <button onclick="stop()">STOP</button>
182
+ </div>
183
+ </div>
184
+
185
+ <div class="station">
186
+ <div class="location">SAN FRANCISCO, CA</div>
187
+ <div class="name">BEAT BLENDER</div>
188
+ <div class="meta">House / Electronic – SomaFM</div>
189
+ <div class="controls">
190
+ <button onclick="play(2)">PLAY</button>
191
+ <button onclick="stop()">STOP</button>
192
+ </div>
193
+ </div>
194
+
195
+ <div class="station">
196
+ <div class="location">LOS ANGELES, CA</div>
197
+ <div class="name">RADIO PARADISE</div>
198
+ <div class="meta">Eclectic Rock</div>
199
+ <div class="controls">
200
+ <button onclick="play(3)">PLAY</button>
201
+ <button onclick="stop()">STOP</button>
202
+ </div>
203
+ </div>
204
+
205
+ <div class="station">
206
+ <div class="location">SAN FRANCISCO, CA</div>
207
+ <div class="name">SECRET AGENT</div>
208
+ <div class="meta">Lounge / Spy – SomaFM</div>
209
+ <div class="controls">
210
+ <button onclick="play(4)">PLAY</button>
211
+ <button onclick="stop()">STOP</button>
212
+ </div>
213
+ </div>
214
+
215
+ <div class="station">
216
+ <div class="location">SAN FRANCISCO, CA</div>
217
+ <div class="name">LUSH</div>
218
+ <div class="meta">Ambient / Dream – SomaFM</div>
219
+ <div class="controls">
220
+ <button onclick="play(5)">PLAY</button>
221
+ <button onclick="stop()">STOP</button>
222
+ </div>
223
+ </div>
224
+
225
+ </div>
226
+ </div>
227
+
228
+ <div class="accordion-section">
229
+ <div class="section-title" onclick="toggleSection(this)">UNITED KINGDOM</div>
230
+ <div class="section-content">
231
+
232
+ <div class="station">
233
+ <div class="location">LONDON</div>
234
+ <div class="name">BBC RADIO 1</div>
235
+ <div class="meta">Pop / Dance Hits</div>
236
+ <div class="controls">
237
+ <button onclick="play(7)">PLAY</button>
238
+ <button onclick="stop()">STOP</button>
239
+ </div>
240
+ </div>
241
+
242
+ <div class="station">
243
+ <div class="location">MANCHESTER / LONDON</div>
244
+ <div class="name">BBC 6 MUSIC</div>
245
+ <div class="meta">Alternative / Indie</div>
246
+ <div class="controls">
247
+ <button onclick="play(8)">PLAY</button>
248
+ <button onclick="stop()">STOP</button>
249
+ </div>
250
+ </div>
251
+
252
+ </div>
253
+ </div>
254
+
255
+ </main>
256
+
257
+ <div id="player">
258
+ <div id="player-info">
259
+ <div id="player-station">NO STATION SELECTED</div>
260
+ <div id="player-track">Select and play a station above</div>
261
+ </div>
262
+ <div id="player-controls">
263
+ <button onclick="prev()"><i class="fa-solid fa-backward"></i></button>
264
+ <button id="mainPlay" onclick="toggle()"><i class="fa-solid fa-play"></i> PLAY</button>
265
+ <button onclick="next()"><i class="fa-solid fa-forward"></i></button>
266
+ </div>
267
+ </div>
268
+
269
+ <audio id="audio" crossorigin="anonymous"></audio>
270
+
271
+ <script>
272
+ const stations = [
273
+ {id:1, name:"GROOVE SALAD", stream:"https://ice1.somafm.com/groovesalad-128-mp3", location:"SAN FRANCISCO, CA", genre:"Chill / Downtempo"},
274
+ {id:2, name:"BEAT BLENDER", stream:"https://ice1.somafm.com/beatblender-128-mp3", location:"SAN FRANCISCO, CA", genre:"House / Electronic"},
275
+ {id:3, name:"RADIO PARADISE", stream:"https://stream.radioparadise.com/mp3-128", location:"LOS ANGELES, CA", genre:"Eclectic Rock"},
276
+ {id:4, name:"SECRET AGENT", stream:"https://ice1.somafm.com/secretagent-128-mp3", location:"SAN FRANCISCO, CA", genre:"Lounge / Spy"},
277
+ {id:5, name:"LUSH", stream:"https://ice1.somafm.com/lush-128-mp3", location:"SAN FRANCISCO, CA", genre:"Ambient / Dream"},
278
+ {id:7, name:"BBC RADIO 1", stream:"https://stream.live.vc.bbcmedia.co.uk/bbc_radio_one", location:"LONDON", genre:"Pop / Dance Hits"},
279
+ {id:8, name:"BBC 6 MUSIC", stream:"https://stream.live.vc.bbcmedia.co.uk/bbc_6music", location:"MANCHESTER / LONDON", genre:"Alternative / Indie"}
280
+ ];
281
+
282
+ let currentIndex = -1;
283
+ let isPlaying = false;
284
+ const audio = document.getElementById('audio');
285
+ const playerStation = document.getElementById('player-station');
286
+ const playerTrack = document.getElementById('player-track');
287
+ const mainPlayBtn = document.getElementById('mainPlay');
288
+
289
+ function toggleSection(el) {
290
+ el.classList.toggle('open');
291
+ const content = el.nextElementSibling;
292
+ content.classList.toggle('open');
293
+ }
294
+
295
+ function play(id) {
296
+ currentIndex = stations.findIndex(s => s.id === id);
297
+ if (currentIndex === -1) return;
298
+ const st = stations[currentIndex];
299
+ audio.src = st.stream;
300
+ audio.play().catch(e => console.log("Play failed:", e));
301
+ isPlaying = true;
302
+ updatePlayer();
303
+ }
304
+
305
+ function stop() {
306
+ audio.pause();
307
+ audio.currentTime = 0;
308
+ isPlaying = false;
309
+ updatePlayer();
310
+ }
311
+
312
+ function toggle() {
313
+ if (currentIndex === -1) return;
314
+ if (isPlaying) {
315
+ audio.pause();
316
+ } else {
317
+ audio.play().catch(()=>{});
318
+ }
319
+ isPlaying = !isPlaying;
320
+ updatePlayer();
321
+ }
322
+
323
+ function prev() {
324
+ if (currentIndex <= 0) currentIndex = stations.length - 1;
325
+ else currentIndex--;
326
+ play(stations[currentIndex].id);
327
+ }
328
+
329
+ function next() {
330
+ if (currentIndex >= stations.length - 1) currentIndex = 0;
331
+ else currentIndex++;
332
+ play(stations[currentIndex].id);
333
+ }
334
+
335
+ function updatePlayer() {
336
+ if (currentIndex === -1) {
337
+ playerStation.textContent = "NO STATION SELECTED";
338
+ playerTrack.textContent = "Select above";
339
+ mainPlayBtn.innerHTML = '<i class="fa-solid fa-play"></i> PLAY';
340
+ return;
341
+ }
342
+ const st = stations[currentIndex];
343
+ playerStation.textContent = st.name + " – " + st.location;
344
+ playerTrack.textContent = st.genre + (isPlaying ? " • LIVE" : " • PAUSED");
345
+ mainPlayBtn.innerHTML = isPlaying
346
+ ? '<i class="fa-solid fa-pause"></i> PAUSE'
347
+ : '<i class="fa-solid fa-play"></i> PLAY';
348
+ }
349
+
350
+ // Fake status messages
351
+ const messages = ["SIGNAL ACTIVE", "TRANSMISSION LIVE", "NO METADATA", "CARRIER DETECTED"];
352
+ setInterval(() => {
353
+ if (isPlaying && currentIndex !== -1) {
354
+ const rnd = Math.floor(Math.random() * messages.length);
355
+ playerTrack.textContent = messages[rnd] + " • " + stations[currentIndex].genre;
356
+ }
357
+ }, 15000);
358
+
359
+ audio.onplay = () => { isPlaying = true; updatePlayer(); };
360
+ audio.onpause = () => { isPlaying = false; updatePlayer(); };
361
+
362
+ // Init
363
+ window.onload = () => {
364
+ currentIndex = 0;
365
+ updatePlayer();
366
+ };
367
+ </script>
368
+ </body>
369
+ </html>