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