Archived
Private
Public Access
1
0
This repository has been archived on 2026-02-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ProjectBackup/C#/WebDesktopUpdater/updater.html
2022-09-04 12:45:01 +02:00

90 lines
2.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>WebDesktop Updater</title>
<style>
::-webkit-scrollbar {
width: 10px;
}
/* Track */
::-webkit-scrollbar-track {
background: none;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #282c34;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #323843;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
overflow: hidden;
}
#console {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 70%;
height: 70%;
padding: 10px;
background-color: #21252b;
font-family: monospace;
color: white;
overflow-y: scroll;
}
input {
position: absolute;
top: 95%;
left: 50%;
transform: translate(-50%, 0);
width: 100px;
height: 30px;
background: none;
border: 2px solid #397ef5;
border-radius: 5px;
transition: 200ms;
font-size: large;
}
input:hover {
background: #397ef5;
cursor: pointer;
}
</style>
</head>
<body>
<section id="console"></section>
<input id="btn" type="button" value="Update">
<script>
const output = document.getElementById("console");
const socket = new WebSocket(location.href.replace(location.protocol, "ws:"));
socket.onopen = () => socket.send("Ping");
socket.onmessage = (e) => {
output.innerText += e.data + "\n";
output.scrollTop = output.scrollHeight;
}
document.getElementById("btn").onclick = () => {
socket.send("Start");
};
</script>
</body>
</html>