formatting

This commit is contained in:
raven 2022-12-22 00:03:10 -05:00
parent de53661ff2
commit a549671e70

View File

@ -5,7 +5,7 @@
<head></head> <head></head>
<title>Samsung TVController</title> <title>Samsung TVController</title>
<style> <style>
body { body {
background-color: #101010; background-color: #101010;
color: #ffffff; color: #ffffff;
@ -22,8 +22,8 @@
footer { footer {
color: #ffffff; color: #ffffff;
} }
</style> </style>
<script> <script>
let rootURL = "https://grwh.work:3031" let rootURL = "https://grwh.work:3031"
let pass = prompt("Enter the password!", ""); let pass = prompt("Enter the password!", "");
let text; let text;
@ -53,8 +53,8 @@
console.log(e) console.log(e)
e = e || window.event; e = e || window.event;
// Handle
if (e.key == "w" || e.code == "Numpad8" ) { if (e.key == "w" || e.code == "Numpad8") {
fetch(rootURL + "/up") fetch(rootURL + "/up")
.then(function (response) { .then(function (response) {
return response.json(); return response.json();
@ -64,9 +64,8 @@
}) })
} }
// Handle
if (e.key == "a" || e.code == "Numpad4") { if (e.key == "a" || e.code == "Numpad4") {
fetch(rootURL + "/left" ) fetch(rootURL + "/left")
.then(function (response) { .then(function (response) {
return response.json(); return response.json();
}) })
@ -74,7 +73,7 @@
if (data == 1) return console.log("Command: LEFT - SENT!") if (data == 1) return console.log("Command: LEFT - SENT!")
}) })
} }
// Handle
if (e.key == "s" || e.key == "2") { if (e.key == "s" || e.key == "2") {
fetch(rootURL + "/down") fetch(rootURL + "/down")
.then(function (response) { .then(function (response) {
@ -84,10 +83,9 @@
if (data == 1) return console.log("Command: DOWN - SENT!") if (data == 1) return console.log("Command: DOWN - SENT!")
}) })
} }
// Handle
// Handle
if (e.key == "d" || e.code == "Numpad6") { if (e.key == "d" || e.code == "Numpad6") {
fetch(rootURL + "/right" ) fetch(rootURL + "/right")
.then(function (response) { .then(function (response) {
return response.json(); return response.json();
}) })
@ -105,6 +103,7 @@
if (data == 1) return console.log("Command: ENTER - SENT!") if (data == 1) return console.log("Command: ENTER - SENT!")
}) })
} }
if (e.key == "x" || e.code == "NumpadDecimal") { if (e.key == "x" || e.code == "NumpadDecimal") {
fetch(rootURL + "/back") fetch(rootURL + "/back")
.then(function (response) { .then(function (response) {
@ -146,7 +145,6 @@
} }
if (e.key == "m" || e.code == "Numpad0") { if (e.key == "m" || e.code == "Numpad0") {
fetch(rootURL + "/mute") fetch(rootURL + "/mute")
.then(function (response) { .then(function (response) {
@ -184,13 +182,13 @@
document.getElementById("view").innerHTML = "<meta http-equiv=\"refresh\" content=3;> <CENTER>THE PASSWORD PROVIDED WAS INCORRECT!" document.getElementById("view").innerHTML = "<meta http-equiv=\"refresh\" content=3;> <CENTER>THE PASSWORD PROVIDED WAS INCORRECT!"
} }
}) })
</script> </script>
</head> </head>
<body> <body>
<center> <center>
<div id="view"></div> <div id="view"></div>
<center> <center>
</body> </body>
</html> </html>