Skip to content

Instantly share code, notes, and snippets.

@Anthonyg5005
Last active May 26, 2024 08:54
Show Gist options
  • Select an option

  • Save Anthonyg5005/0810177a73965d2b490adc98dbe809c7 to your computer and use it in GitHub Desktop.

Select an option

Save Anthonyg5005/0810177a73965d2b490adc98dbe809c7 to your computer and use it in GitHub Desktop.
web redirect to discord user
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: #313338;
color: #cecece;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
flex-direction: column;
}
.note {
position: fixed;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
font-size: 12px;
color: #cecece;
}
a {
color: #00A8FC;
}
@media (max-width: 980px) {
h1 {
font-size: 80px;
}
p {
font-size: 40px;
}
.note {
font-size: 30px;
}
}
</style>
<script>
function updateTimer() {
var countdownElement = document.getElementById("countdown");
var countdownValue = parseInt(countdownElement.innerText);
if (countdownValue > 0) {
countdownValue--;
countdownElement.innerText = countdownValue;
setTimeout(updateTimer, 1000);
} else {
window.location.href = "discord://discord.com/users/ID_HERE"; //replace "ID_HERE" with your Discord ID
}
}
window.onload = function() {
setTimeout(updateTimer, 1000);
};
</script>
</head>
<body>
<h1>Opening in Discord...</h1>
<p>You will be redirected in <span id="countdown">5</span> seconds.</p>
<p>If you don't have the Discord app installed, <a href="https://discord.com/users/ID_HERE">click here</a> to use the web version.</p> <!--replace "ID_HERE" with your Discord ID-->
<div class="note">Note: This page is not associated with Discord.</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment