hlsa/index.html

68 lines
1.6 KiB
HTML
Raw Normal View History

2024-11-19 08:18:35 -05:00
<!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 {
2024-11-20 07:55:44 -05:00
width: 20%;
2024-11-19 08:18:35 -05:00
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>
2024-11-20 07:55:44 -05:00
<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>
2024-11-19 08:18:35 -05:00
</body>
</html>