hlsa/index.html
2024-11-20 07:55:44 -05:00

67 lines
1.6 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>How long since a message was blocked in Vencord</title>
<style>
img {
width: 20%;
margin-top: 40px;
}
body {
background-color: #2b2e33;
color: white;
font-family: sans-serif;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
}
#counter {
font-size: 4.3rem;
font-family: monospace;
margin: 0;
color: #5865f2;
}
h3 {
font-size: 1rem;
}
</style>
</head>
<body>
<div class="container">
<img src="duke.png" />
<h1>It has been</h1>
<p id="counter">00:00:01</p>
<h3>since a message has been blocked in Vencord.</h3>
</div>
<script>
let lastAutomoddedTime = Date.now();
function updateTimer() {
const now = Date.now();
const totalSeconds =
Math.floor(now / 1000) -
Math.floor(lastAutomoddedTime / 1000);
const hours = Math.floor(totalSeconds / 3600);
const minutes = Math.floor(totalSeconds / 60) - hours * 60;
const seconds = totalSeconds - minutes * 60 - hours * 3600;
document.querySelector("#counter").innerHTML = `${
hours !== 0 ? `${hours}:` : ""
}${minutes}:${seconds.toString().padStart(2, "0")}`;
}
const ws = new WebSocket("wss://hlsa.nin0.dev/ws");
ws.onmessage = (d) => {
const data = JSON.parse(d.data);
console.log(data);
lastAutomoddedTime = data.lastAutomoddedTime;
setInterval(updateTimer, 500);
};
</script>
</body>
</html>