-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
executable file
·709 lines (686 loc) · 20.1 KB
/
index.html
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
<!DOCTYPE html>
<html class="nojs" lang="en">
<head>
<title>AzuraCast | Player</title>
<meta charset="UTF-8" />
<meta http-equiv="x-ua-compatible" content="IE=Edge, chrome=1" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no"
/>
<meta
name="description"
id="description"
content="SPA audio player for the streaming stations provided by AzuraCast."
/>
<meta
name="author"
content="PeWe79 | @PeWe79 | https://cloudmu.id | https://github.com/PeWe79/AzuraCast-Player"
/>
<link rel="shortcut icon" href="favicon.ico" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link rel="preconnect" href="https://azuracast.com" />
<link rel="preconnect" href="https://cdnjs.cloudflare.com" />
<style type="text/css">
@keyframes _spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(359deg);
}
}
html,
body {
margin: 0;
padding: 0;
position: relative;
overflow: hidden;
min-height: 100vh;
background-color: #8086a0;
background-size: cover;
background: #c3e6fa; /* fallback for old browsers */
background: -webkit-linear-gradient(
to top,
#c3e6fa,
#4f527e
); /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(
to top,
#c3e6fa,
#4f527e
); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
background-color: #c3e6fa;
}
#_spnr {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 9999;
}
#_spnr {
text-align: center;
color: antiquewhite;
}
#_spnr path {
display: block;
margin: 0;
padding: 0;
transition: none;
}
#_spnr noscript {
max-width: 500px;
}
</style>
<script>
(function (w) {
document.documentElement.classList.remove("nojs");
w.addEventListener("pageshow", (e) => {
if (e.persisted) w.location.reload();
});
})(window);
</script>
</head>
<body>
<!-- initial spinner -->
<div id="_spnr">
<svg
height="100"
width="100"
version="1.1"
id="L7"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px"
y="0px"
viewBox="0 0 100 100"
enable-background="new 0 0 100 100"
xml:space="preserve"
>
<path
fill="#fff"
d="M31.6,3.5C5.9,13.6-6.6,42.7,3.5,68.4c10.1,25.7,39.2,38.3,64.9,28.1l-3.1-7.9c-21.3,8.4-45.4-2-53.8-23.3 c-8.4-21.3,2-45.4,23.3-53.8L31.6,3.5z"
>
<animateTransform
attributeName="transform"
attributeType="XML"
type="rotate"
dur="2s"
from="0 50 50"
to="360 50 50"
repeatCount="indefinite"
/>
</path>
<path
fill="#fff"
d="M42.3,39.6c5.7-4.3,13.9-3.1,18.1,2.7c4.3,5.7,3.1,13.9-2.7,18.1l4.1,5.5c8.8-6.5,10.6-19,4.1-27.7 c-6.5-8.8-19-10.6-27.7-4.1L42.3,39.6z"
>
<animateTransform
attributeName="transform"
attributeType="XML"
type="rotate"
dur="1s"
from="0 50 50"
to="-360 50 50"
repeatCount="indefinite"
/>
</path>
<path
fill="#fff"
d="M82,35.7C74.1,18,53.4,10.1,35.7,18S10.1,46.6,18,64.3l7.6-3.4c-6-13.5,0-29.3,13.5-35.3s29.3,0,35.3,13.5 L82,35.7z"
>
<animateTransform
attributeName="transform"
attributeType="XML"
type="rotate"
dur="2s"
from="0 50 50"
to="360 50 50"
repeatCount="indefinite"
/>
</path>
</svg>
<noscript>
This applications requires Javascript to run. Make sure Javascript is
enabled in your web browser settings and try again.
<a href="https://www.enable-javascript.com/" target="_blank"
>Visit this link</a
>
for more information on how to enable Javascript.
</noscript>
</div>
<!-- app root container -->
<div id="app" class="app-wrap">
<!-- app player container -->
<main id="player-wrap" class="player-wrap" style="opacity: 0">
<!-- bg absolute elements -->
<figure
id="player-bg"
class="player-bg"
style="background-image: url(public/img/bg.jpg)"
></figure>
<canvas
id="player-canvas"
class="player-canvas"
width="800"
height="400"
></canvas>
<!-- main player layout -->
<section class="player-layout">
<!-- player top header -->
<header class="player-header flex-row flex-middle flex-stretch">
<h2 class="player-logo text-clip flex-1">
<i class="ico ico-waveform"></i>
<a href="/" style="color: inherit; text-decoration: none">
<span style="cursor: pointer">AzuraCast - Player</span>
</a>
</h2>
<button
class="text-nowrap common-btn focus-text"
type="button"
@click="toggleSidebar( true )"
title="Open stations menu"
>
<i class="ico ico-menu"></i>
</button>
</header>
<!-- player middle content area -->
<main class="player-content flex-row">
<!-- default greet message -->
<section class="player-greet" v-if="!hasChannel && !hasErrors">
<div class="fx fx-slide-left push-bottom">
<h1>Pick a Station</h1>
</div>
<div class="fx fx-slide-left fx-delay-1 push-bottom">
This is a music streaming player for the channels provided by
AzuraCast. Just pick a station from the sidebar to the right to
start listening.
</div>
<div class="fx fx-slide-up fx-delay-2 pad-top">
<button
class="cta-btn focus-box"
type="button"
@click="toggleSidebar( true )"
>
<i class="ico ico-headphones"></i> View Stations
</button>
</div>
</section>
<!-- show selected channel info if possible -->
<section
class="player-channel flex-1"
v-if="hasChannel && !hasErrors"
:key="station.shortcode"
>
<div class="flex-autorow flex-top flex-stretch">
<!-- station details -->
<div class="flex-item flex-1">
<!-- station -->
<div class="push-bottom">
<div class="flex-row flex-middle pad-bottom">
<div class="fx fx-drop-in fx-delay-1">
<img
class="album-cover"
:src="npiTunes.art || songNow.art"
:alt="station.name"
/>
</div>
<div class="pad-left">
<h3 class="text-clip fx fx-fade-in fx-delay-2">
<span>{{ station.name }}</span>
</h3>
<div class="fx fx-fade-in fx-delay-3">
<fav-btn
:id="station.shortcode"
:active="station.favorite"
text="Favorite"
@change="toggleFavorite"
></fav-btn>
</div>
</div>
</div>
</div>
<!-- description -->
<div class="push-bottom pad-bottom fx fx-slide-up fx-delay-3">
<div class="push-bottom">
<span class="text-secondary"
>Mixed by DJ {{ station.name | toText( 'N/A' ) }}.</span
>
<br />
<span class="text-bright text-capitalize"
>{{ station.title }}</span
>
<span class="text-faded">Playlist:</span>
<span class="text-bright text-capitalize"
>{{ nowPlaying.playlist | toText( 'N/A' ) }}.</span
>
<br />
<span>{{ station.description }}</span>
</div>
<div class="flex-row flex-middle">
<div
class="fx fx-slide-up fx-delay-2 push-right"
v-if="station.infourl"
>
<a
class="cta-btn text-nowrap focus-box"
:href="station.infourl"
title="Channel page"
target="_blank"
>
<i class="ico ico-earth"></i> Webpage
</a>
</div>
<div
class="fx fx-slide-up fx-delay-3 push-right"
v-if="station.plsfile"
>
<a
class="cta-btn text-nowrap focus-box"
:href="station.plsfile"
title="Download PLS"
target="_blank"
>
<i class="ico ico-download"></i> PLS
</a>
</div>
<div
class="fx fx-slide-up fx-delay-4 push-right"
v-if="station.twitter"
>
<a
class="cta-btn text-nowrap focus-box"
:href="station.twitter"
title="Twitter page"
target="_blank"
>
<i class="ico ico-twitter"></i>
</a>
</div>
</div>
</div>
<!-- heading current playing -->
<div class="flex-row flex-middle push-bottom">
<div class="push-right">
<h5 class="text-nowrap fx fx-fade-in fx-delay-2">
<i class="ico ico-playing"></i> Now Playing
</h5>
</div>
<div
class="fx fx-slide-left fx-delay-3"
:key="station.mounts[0].listeners.current "
>
<i class="ico ico-headphones"></i> {{
station.mounts[0].listeners.current | toCommas( 0 ) }}
listening
</div>
</div>
<!-- current track -->
<div
class="card fx fx-slide-left fx-delay-4"
:key="nowPlaying.played_at"
>
<div>
<span class="text-secondary"
>{{ npiTunes.title || songNow.title | toText( 'N/A' ) }}</span
>
</div>
<div>
<span class="text-faded">From:</span>
<span class="text-bright"
>{{ npiTunes.album || songNow.album | toText( 'N/A' ) }}</span
>
</div>
<div>
<span class="text-faded">By:</span>
<span class="text-default"
>{{ npiTunes.artist || songNow.artist | toText( 'N/A' ) }}</span
>
</div>
</div>
<!-- If station doesn't support next song will be hiden -->
<div v-if="hasNextSong">
<!-- heading next -->
<div class="flex-row flex-middle push-bottom">
<div class="push-right">
<h6 class="text-nowrap fx fx-fade-in fx-delay-4">
<i
class="fa fa-arrow-circle-right"
style="font-size: 24px"
></i
> Playing Next
</h6>
</div>
</div>
<!-- next play -->
<div
class="card fx flex-row flex-top flex-stretch fx-delay-4"
>
<div>
<img
class="history-cover"
:alt="nextSong.title"
:src="nextitunes.art || nextSong.art"
/>
</div>
<div class="pad-left">
<div>
<span class="text-secondary"
>{{ nextSong.title | toText( 'N/A' ) }}</span
>
</div>
<div>
<span class="text-faded">Played at:</span>
<span class="text-default">
{{ getPlayAt(nextPlay.played_at) }}
</span>
</div>
<div>
<span class="text-faded">From:</span>
<span class="text-bright"
>{{ nextitunes.album || nextSong.album | toText( 'N/A' ) }}</span
>
</div>
<div>
<span class="text-faded">By:</span>
<span class="text-default"
>{{ nextSong.artist | toText( 'N/A' ) }}</span
>
</div>
</div>
</div>
</div>
</div>
<!-- songs list -->
<div class="flex-item flex-1">
<div class="push-bottom">
<h5 class="text-nowrap fx fx-fade-in fx-delay-1">
<i class="ico ico-collection"></i> Recent Tracks
</h5>
</div>
<div
class="card push-bottom fx fx-slide-left fx-delay-4"
v-if="!hasSongs"
>
There are no songs loaded yet for this station.
</div>
<ul class="player-tracklist push-bottom" v-if="hasSongs">
<li
v-for="(sh, i) of songsList"
class="card fx flex-row flex-top flex-stretch"
:class="'fx-slide-left fx-delay-' + ( i + 4 )"
>
<div>
<img
class="history-cover"
:alt="sh.song.title"
:src="sh.song.art"
/>
</div>
<div class="pad-left">
<div>
<span class="text-secondary"
>{{ sh.song.title | toText( 'N/A' ) }}</span
>
</div>
<div>
<span class="text-faded">From:</span>
<span class="text-bright"
>{{ sh.song.album | toText( 'N/A' ) }}</span
>
</div>
<div>
<span class="text-faded">By:</span>
<span class="text-default"
>{{ sh.song.artist | toText( 'N/A' ) }}</span
>
</div>
<div>
<span class="text-faded">Played: </span>
<span class="text-default">
{{ getPlayAt(sh.played_at) }}
</span>
</div>
</div>
</li>
</ul>
</div>
</div>
</section>
<!-- show error messages -->
<section
class="player-errors flex-1 text-center"
v-if="hasErrors"
key="errors"
>
<div class="push-bottom fx fx-drop-in fx-delay-1">
<i class="ico ico-unplugged text-huge"></i>
</div>
<div class="fx fx-slide-up fx-delay-2">
<h3>Oops, there's a problem!</h3>
</div>
<hr />
<div
v-for="( e, i ) of errors"
class="push-bottom fx fx-slide-up"
:class="'fx-delay-' + ( i + 3 )"
>
<span class="text-primary">{{ e }}</span>
</div>
<hr />
<button
class="cta-btn text-nowrap focus-box fx fx-slide-up fx-delay-4"
type="button"
@click="tryAgain"
>
<i class="ico ico-waveform"></i> Try again
</button>
</section>
</main>
<!-- player footer with controls -->
<footer class="player-footer flex-row flex-middle flex-space">
<!-- player controls -->
<section
class="player-controls flex-row flex-middle push-right"
:class="{ 'disabled': !canPlay }"
>
<button
class="common-btn focus-text"
type="button"
@click="togglePlay"
>
<i
v-if="loading"
class="ico ico-loader fx fx-spin-right"
key="wait"
></i>
<i
v-else-if="playing"
class="ico ico-stop fx fx-drop-in"
key="stop"
></i>
<i v-else class="ico ico-play fx fx-drop-in" key="play"></i>
</button>
<div class="form-slider push-left">
<span>
<i v-if="volume >= 75" class="ico ico-volume-4"></i>
<i v-else-if="volume >= 50" class="ico ico-volume-3"></i>
<i v-else-if="volume >= 25" class="ico ico-volume-2"></i>
<i v-else class="ico ico-volume-1"></i>
</span>
<input
class="common-slider"
type="range"
min="0"
max="100"
step="1"
value="100"
v-model="volume"
@change="saveVolume()"
/>
</div>
<div class="text-clip push-left">
<span>{{ timeDisplay }}</span>
<span class="text-faded" v-if="hasChannel"> | </span>
<span
class="fx fx-fade-in fx-delay-1"
v-if="hasChannel"
:key="station.shortcode"
>{{ station.name }}</span
>
</div>
</section>
</footer>
</section>
<!-- layout wrapper -->
<!-- player stations overlay + sidebar -->
<section
class="player-stations"
:class="{ 'active': sbActive, 'visible': sbVisible }"
@click="toggleSidebar( false )"
tabindex="-1"
ref="sidebarDrawer"
>
<aside class="player-stations-sidebar" @click.stop>
<!-- sidebar search -->
<header
class="player-stations-header flex-row flex-middle flex-stretch"
>
<div class="form-input push-right">
<i class="ico ico-search"></i>
<input
type="text"
placeholder="Search station..."
v-model="searchText"
/>
</div>
<button
class="common-btn focus-text"
type="button"
@click="toggleSidebar( false )"
title="Close stations menu"
>
<i class="ico ico-close"></i>
</button>
</header>
<!-- sidebar stations list -->
<ul class="player-stations-list">
<li
class="player-stations-list-item flex-row flex-top flex-stretch"
tabindex="0"
v-for="c of channelsList"
:key="c.shortcode"
@click="selectChannel( c, true )"
:class="{ 'active': c.active }"
:title="c.title"
>
<figure class="push-right">
<img class="history-cover" :src="c.imgLogo" :alt="c.name" />
</figure>
<aside class="flex-1">
<div class="flex-row flex-middle flex-space">
<div
class="player-stations-list-title text-bright text-clip"
>
{{ c.name }}
</div>
<div class="text-nowrap">
<span class="text-secondary"
><i class="ico ico-headphones"></i> {{
c.mounts[0].listeners.current | toCommas( 0 ) }}
</span
>
<fav-btn
:id="c.shortcode"
:active="c.favorite"
@change="toggleFavorite"
></fav-btn>
</div>
</div>
<div class="text-small">
<span class="text-faded text-uppercase text-small"
>{{ c.genre | toText }}</span
>
<br />
{{ c.description }}
</div>
</aside>
</li>
</ul>
<!-- sidebar sort options -->
<footer
class="player-stations-footer flex-row flex-middle flex-stretch"
>
<div class="flex-1 push-right">
<span
@click="toggleSortOrder()"
class="ico clickable"
:class="{ 'ico-sort-desc': sortOrder === 'desc', 'ico-sort-asc': sortOrder === 'asc' }"
> </span
>
<span class="text-faded">Sort: </span>
<span class="text-bright popover">
<span class="clickable">{{ sortLabel }}</span>
<span class="popover-box popover-top">
<button type="button" @click="sortBy( 'name', 'asc' )">
<i class="text-faded ico ico-sort-asc"></i> Station
Name
</button>
<button
type="button"
@click="sortBy( 'listeners', 'desc' )"
>
<i class="text-faded ico ico-headphones"></i>
Listeners Count
</button>
<button type="button" @click="sortBy( 'favorite', 'desc' )">
<i class="text-faded ico ico-favs-check"></i> Saved
Favorites
</button>
<button type="button" @click="sortBy( 'genre', 'asc' )">
<i class="text-faded ico ico-collection"></i> Music
Genre
</button>
</span>
</span>
</div>
<div>
<button
type="button"
@click.stop="saveFavorites()"
title="Download Favorites PLS"
>
<i class="ico ico-download"></i>
</button>
</div>
</footer>
</aside>
</section>
</main>
<!-- player -->
</div>
<!-- wrapper -->
<!-- app styles -->
<link rel="stylesheet" href="/public/css/fonts.css" />
<link rel="stylesheet" href="/public/bundles/app.min.css" />
<!-- app scripts -->
<script
src="//cdnjs.cloudflare.com/ajax/libs/three.js/96/three.min.js"
defer
></script>
<script
src="//cdnjs.cloudflare.com/ajax/libs/vue/2.7.14/vue.min.js"
defer
></script>
<script src="/public/bundles/app.min.js" defer></script>
</body>
</html>