forked from rfa/radioweb
rfa style
This commit is contained in:
parent
d7f2a21fdf
commit
ebba4a649e
99
index.html
99
index.html
@ -1,39 +1,82 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title></title>
|
<title>APR</title>
|
||||||
</head>
|
<style>
|
||||||
|
body {
|
||||||
|
background: #000;
|
||||||
|
color: #ddd;
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
|
||||||
<style>
|
h1 {
|
||||||
#history {
|
color: rgba(0,0,0,.1);
|
||||||
list-style: none;
|
font-family: sans-serif;
|
||||||
}
|
font-size-adjust: 0.62;
|
||||||
|
font-synthesis: 12px;
|
||||||
|
font-variant-ligatures: unset;
|
||||||
|
font-variant: all-petite-caps;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
text-align: center;
|
||||||
|
text-shadow: 0px 0px 2px #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
#history > :first-child {
|
h1 .wide {
|
||||||
font-weight: bold;
|
letter-spacing: 9px;
|
||||||
}
|
color: rgba(0,0,0,.9);
|
||||||
</style>
|
}
|
||||||
|
|
||||||
<body>
|
audio, #history {
|
||||||
<audio controls src="https://radio.anarchyplanet.org:8443/radio.ogg"></audio>
|
width: 80vw;
|
||||||
|
max-width: 1140px;
|
||||||
|
min-width: 320px;
|
||||||
|
border: 1px solid #888;
|
||||||
|
}
|
||||||
|
|
||||||
<ul id="history">
|
#history {
|
||||||
</ul>
|
font-size: 1.2rem;
|
||||||
|
margin: 1rem auto;
|
||||||
|
padding:1rem 0;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
<script>
|
#history > :first-child {
|
||||||
var url = 'wss://radio.anarchyplanet.org/ws';
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
var c = new WebSocket(url);
|
#history li:nth-child(even) {
|
||||||
c.onmessage = function(msg){
|
background: #1d1d1d;
|
||||||
document.title = msg.data;
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
var hist = document.getElementById("history");
|
<h1>Anarchy PlⒶnet Radio</h1>
|
||||||
|
|
||||||
hist.insertAdjacentHTML("afterbegin", `<li>${msg.data}</li>`);
|
<audio id="player" controls src="https://radio.anarchyplanet.org:8443/radio.ogg"></audio>
|
||||||
|
|
||||||
if(hist.childElementCount >= 10) {
|
<ul id="history"></ul>
|
||||||
hist.removeChild(hist.lastChild);
|
|
||||||
}
|
<script>
|
||||||
}
|
var player = document.getElementById('player');
|
||||||
</script>
|
var rng = Math.floor(Math.random() * 10000);
|
||||||
</body>
|
player.src = player.src + '?nocache=' + rng;
|
||||||
|
|
||||||
|
var url = 'wss://radio.anarchyplanet.org/ws';
|
||||||
|
var ws = new WebSocket(url);
|
||||||
|
|
||||||
|
ws.onmessage = function(msg){
|
||||||
|
document.title = msg.data + " - APR";
|
||||||
|
|
||||||
|
var hist = document.getElementById("history");
|
||||||
|
|
||||||
|
hist.insertAdjacentHTML("afterbegin", `<li>${msg.data}</li>`);
|
||||||
|
|
||||||
|
if(hist.childElementCount >= 10) {
|
||||||
|
hist.removeChild(hist.lastChild);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user