This repository has no description
2.0 kB
83 lines
1<!doctype html>
2
3<html lang="en">
4<head>
5 <meta charset="utf-8">
6 <meta name="viewport" content="width=device-width, initial-scale=1">
7
8 <title>The_Playlist Voting!</title>
9<style>
10#good {
11 display: block;
12 width: 100%;
13 border: none;
14 background-color: #04AA6D;
15 padding: 14px;
16 margin: 14px 0 0 0;
17 height: 100px;
18 font-size: 16px;
19 cursor: pointer;
20 text-align: center;
21}
22#bad {
23 display: block;
24 width: 100%;
25 border: none;
26 background-color: red;
27 padding: 14px;
28 height: 100px;
29
30 margin: 14px 0 0 0;
31 font-size: 16px;
32 cursor: pointer;
33 text-align: center;
34}
35</style>
36
37</head>
38
39<body>
40 <div id=votenote></div>
41 <button id=good type="button"> GUT </button>
42
43 <button id=bad type="button"> SCHLECHT </button>
44 <center>
45 Currently Running: <br/><div>
46 <b id=current></b>
47 </div>
48 <div id=vote>
49 </div>
50 <audio controls autoplay="autoplay">
51 <source src="https://radio.lassul.us/radio.ogg" type="audio/ogg">
52 Your browser does not support the audio element.
53 </audio>
54 </center>
55
56 <script>
57 document.getElementById("good").onclick=async ()=>{
58 let result = await fetch("https://radio.lassul.us/good", {"method": "POST"})
59 document.getElementById("vote").textContent = "Dieses Lied findest du gut"
60 };
61 document.getElementById("bad").onclick=async ()=>{
62 let result = await fetch("https://radio.lassul.us/skip", {"method": "POST"})
63 document.getElementById("vote").textContent = "Dieses Lied findest du schlecht"
64 document.getElementById("bad").disabled = true
65 window.setTimeout(function(){
66 document.getElementById("bad").disabled = false
67 }, 100000)
68
69 };
70
71 async function current() {
72 let result = await fetch("https://radio.lassul.us/current", {"method": "GET"})
73 let data = await result.json()
74 document.getElementById("current").textContent = data.name
75 }
76 window.onload = function() {
77 window.setInterval('current()', 10000)
78 current()
79 }
80
81 </script>
82</body>
83</html>