-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
174 lines (161 loc) · 8.12 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
<head>
<title>KRLX</title>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="#">KRLX</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarColor02">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#" >Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#" onclick="require('electron').remote.getCurrentWindow().loadFile('schedule.html')">Schedule</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#" onclick="require('electron').shell.openExternal('https://willbeddow.com/krlxdesktop')">About</a>
</li>
</ul>
</div>
</nav>
<script defer src="https://use.fontawesome.com/releases/v5.8.1/js/brands.js" integrity="sha384-rUOIFHM3HXni/WG5pzDhA1e2Js5nn4bWudTYujHbbI9ztBIxK54CL4ZNZWwcBQeD" crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.8.1/js/fontawesome.js" integrity="sha384-EMmnH+Njn8umuoSMZ3Ae3bC9hDknHKOWL2e9WJD/cN6XLeAN7tr5ZQ0Hx5HDHtkS" crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.8.1/js/all.js" integrity="sha384-g5uSoOSBd7KkhAMlnQILrecXvzst9TdC09/VM+pjDTCM+1il8RHz5fKANTFFb+gQ" crossorigin="anonymous"></script>
<link rel="stylesheet" href="node_modules/bootswatch/dist/sketchy/bootstrap.min.css">
</head>
<!-- Purechat Widget -->
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-5">
<div class="row">
<h1>Currently On</h1>
</div>
<div class="row">
<div class="col-md-12" id="currshow">
</div>
</div>
<div class="row"></div>
<div class="row">
<div class="col-md-12">
<div id="message-card" class="card border-primary">
<div id="messages-title" class="card-header">
Status & Updates
</div>
<div class="card-body">
<h4 id="message-inner-title" class="card-title">Messages:</h4>
<p id="messages" class="card-text"></p>
<h4 id="updates-title" class="card-title">Updates</h4>
<p id="updates"></p>
<h4 class="card-title">Status: <span id="currstatus"><span class="badge badge-pill badge-info">Loading...</span></span></h4>
</div>
<div class="card-footer">
<div class="row">
Made with ❤️ by Will Beddow '22
<br>
© <script>document.write(new Date().getFullYear())</script>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="row">
<div class="col-md-12">
<div class="row">
<h1>Songs</h1>
</div>
<div class="row">
<div id="songs">
</div>
<div>
<ul class="pagination">
<li id="last-song" class="song-page page-item disabled">
<a onclick="set_songs(-1)" class="page-link" href="#">«</a>
</li>
<li class="song-page page-item active">
<a onclick="set_songs(1)" class="page-link" href="#">1</a>
</li>
<li class="song-page page-item">
<a onclick="set_songs(2)" class="page-link" href="#">2</a>
</li>
<li class="song-page page-item">
<a onclick="set_songs(3)" class="page-link" href="#">3</a>
</li>
<li class="song-page page-item">
<a onclick="set_songs(4)" class="page-link" href="#">4</a>
</li>
<li id="next-song" class="song-page page-item">
<a onclick="set_songs(0)" class="page-link" href="#">»</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<h1>Upcoming</h1>
<div class="col-md-12" id="upcoming">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
</div>
</div>
</div>
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script>
window.jQuery = window.$ = require('jquery');
</script>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript" src="https://app.purechat.com//assets/widget-script.100181.js"></script>
<script type='text/javascript' data-cfasync='false'>$(document).ready(function(){
window.purechatApi = { l: [], t: [], on: function () { this.l.push(arguments); } }; (function () { var done = false; var script = document.createElement('script'); script.async = true; script.type = 'text/javascript'; script.src = 'https://app.purechat.com/VisitorWidget/WidgetScript'; document.getElementsByTagName('HEAD').item(0).appendChild(script); script.onreadystatechange = script.onload = function (e) { if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) { var w = new PCWidget({c: '47c7413c-6718-46f1-80d3-3c6defd2db13', f: true }); done = true; } }; })();
});
</script>
<script src="page.js"></script>
</body>
<footer class="navbar fixed-bottom">
<div class="col-md-1">
</div>
<div class="col-md-6">
<a href="#" id="audioControl"><img class="img-fluid" src="assets/play.svg" width="50" height="50"></a>
<!--<img class=img-fluid" width=50 height=50 src="assets/play.svg">-->
<audio id="stream" data-seek="off" data-time="off" style="display:none">
<!--<source src="http://krlx.out.airtime.pro:8000/krlx_a.m3u" type='audio/mpeg;codecs="mp3"'></source> -->
<source src="http://garnet.krlx.org:8000/krlx" type='audio/mpeg;codecs="mp3"'>
</audio>
</div>
<script>
let play_button = '<img class="img-fluid" src="assets/play.svg" width="50" height="50">';
let pause_button = '<img class="img-fluid" src="assets/pause.svg" width="50" height="50">'
let yourAudio = document.getElementById('stream'),
ctrl = document.getElementById('audioControl');
function do_playpause(){
let visitor = require('electron').remote.getCurrentWindow().visitor;
visitor.event("Music", method).send();
// Update the Button
var pause = ctrl.innerHTML === pause_button;
ctrl.innerHTML = pause ? play_button : pause_button;
// Update the Audio
var method = pause ? 'pause': 'play';
var bufferLength = yourAudio.buffered.length;
if (bufferLength >= 1){
bufferLength--;
console.log("Buffering");
// Seek to the end of the stream regardless
yourAudio.currentTime = yourAudio.buffered.end(bufferLength);
}
yourAudio[method]();
// Prevent Default Action
return false;
}
ctrl.onclick = function () {
return do_playpause();
};
</script>
</footer>