Skip to content

Commit

Permalink
fix countdown
Browse files Browse the repository at this point in the history
  • Loading branch information
sukoneck committed Nov 28, 2024
1 parent 41c05ef commit cabb4e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/template.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
export const redirectTemplate = (message, redirectUrl, status) => `
export const redirectTemplate = (message, redirectUrl) => `
<!DOCTYPE html>
<html>
<head>
<title>Service Notice</title>
<script>
let count = 5;
let message = "${message}";
document.addEventListener('DOMContentLoaded', () => {
const messageEl = document.getElementById('message');
const interval = setInterval(() => {
Expand All @@ -13,7 +14,7 @@ export const redirectTemplate = (message, redirectUrl, status) => `
clearInterval(interval);
window.location.href = "${redirectUrl}";
} else {
messageEl.textContent = "${message} Redirecting in " + count + " seconds...";
messageEl.textContent = message + " Redirecting in " + count + " seconds...";
}
}, 1000);
});
Expand Down

0 comments on commit cabb4e6

Please sign in to comment.