-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (24 loc) · 946 Bytes
/
index.js
File metadata and controls
27 lines (24 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// メールアドレスのBase64デコード
function decodeBase64(encoded) {
return decodeURIComponent(atob(encoded).split('').map(function(c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
}
function initializeEmailLink(encodedEmail, linkId) {
const email = decodeBase64(encodedEmail);
const emailLink = document.getElementById(linkId);
emailLink.href = "mailto:" + email;
}
// リダイレクト処理
function startRedirectCountdown(url, countdownSeconds) {
const redirectMessage = document.getElementById("redirect-message");
let seconds = countdownSeconds;
const interval = setInterval(function() {
seconds--;
redirectMessage.textContent = `${seconds}秒後にホームページにリダイレクトされます。`;
if (seconds === 0) {
clearInterval(interval);
window.location.href = url;
}
}, 1000);
}