Created the redirect module

This commit is contained in:
2023-01-08 03:27:47 +01:00
parent e6b11fee5f
commit 8cdf6fca6c
2 changed files with 73 additions and 0 deletions

View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Automatische Weiterleitung</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
background-color: #f1f1f1;
font-family: 'Courier New', serif;
min-height: 100vh;
display: flex;
align-items: center;
}
a {
text-decoration: none;
}
span {
color: #0d6efd;
}
</style>
</head>
<body>
<div class="container">
<div class="text-center">
<h1>Automatische Weiterleitung</h1>
<p>Du wirst in <span id="time"><%= meta.timer %></span> Sekunden auf <span><%= meta.shortenUrl%></span> weitergeleitet.</p>
<a onclick="history.back()" href="#">Abbrechen</a>
</div>
</div>
</body>
<script>
let seconds = <%= meta.timer %>;
setInterval(() => {
seconds--;
document.getElementById("time").innerText = seconds;
if (seconds === 0) location.href = "<%= meta.shortenUrl %>";
}, 1000, 0);
</script>
</html>