Repository navigation
Expand file tree
/
Copy pathredirect.html
More file actions
94 lines (86 loc) · 4.22 KB
/
Copy pathredirect.html
File metadata and controls
94 lines (86 loc) · 4.22 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<link rel="alternate" hreflang="ja" href="https://www.hima-server.com/">
<title>Redirecting...</title>
<meta name="description" content="暇人鯖のホームページです">
<meta name="keywords" content="暇人鯖,discord,minecraft">
<meta name="theme-color" content="#ffff00">
<meta property="og:title" content="Redirecting...">
<meta property="og:description" content="暇人鯖のホームページです">
<meta property="og:image" content="https://www.hima-server.com/img/logo.png">
<meta property="og:url" content="https://www.hima-server.com">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Redirecting...">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Redirecting...">
<meta name="twitter:description" content="暇人鯖のホームページです">
<meta name="twitter:image" content="https://www.hima-server.com/img/logo.png">
<meta name="twitter:url" content="https://www.hima-server.com">
<meta name="twitter:site" content="@hima_discord">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<link rel="apple-touch-icon" sizes="2048x2048" href="https://www.hima-server.com/img/icon.png">
<link rel="stylesheet" href="/style.css" type="text/css">
</head>
<body>
<div class="main-content">
<h3 id="is-javascript-enabled">このメッセージが消えずに表示されている場合、ページが正しく表示されていません。JavaScriptを有効にしてください。</h3>
<h2 id="redirecting-msg"></h2>
<div id="redirecting-description"></div>
<div id="confirmation-box">
<p id="confirmation-text">
以下のURLにリダイレクトします。<br>
<strong id="url-placeholder"></strong><br>
よろしいですか?
</p>
<button class="confirm" id="confirm-yes">はい</button>
<button class="cancel" id="confirm-no">いいえ</button>
</div>
</div>
<script>
const urlParams = new URLSearchParams(window.location.search);
const redirectUrl = urlParams.get('url');
const confirmationText = document.getElementById('confirmation-text');
const urlPlaceholder = document.getElementById('url-placeholder');
if (redirectUrl) {
const urlWithoutHttp = redirectUrl.replace(/^https?:\/\//, '').endsWith('/') ? redirectUrl.replace(/^https?:\/\//, '').slice(0, -1) : redirectUrl.replace(/^https?:\/\//, '');
console.log(urlWithoutHttp)
urlPlaceholder.textContent = `${urlWithoutHttp}`;
document.getElementById('confirm-yes').addEventListener('click', function() {
document.getElementById('confirmation-box').style.display = 'none';
document.getElementById('redirecting-msg').textContent = 'Redirecting...';
document.getElementById('redirecting-description').innerHTML = `
<p>
切り替わらない場合、<a href="${redirectUrl}">コチラ</a>をクリックしてください。
<p>
`;
setTimeout(() => {
window.location.href = redirectUrl;
}, 3000);
});
document.getElementById('confirm-no').addEventListener('click', function() {
document.getElementById('confirmation-box').style.display = 'none';
document.getElementById('redirecting-msg').textContent = 'Cancelled.';
document.getElementById('redirecting-description').innerHTML = `
<p>
ウィンドウを閉じます。
<p>
`;
setTimeout(() => {
window.close();
}, 3000);
});
} else {
document.getElementById('confirm-yes').style.display = 'none';
document.getElementById('confirm-no').style.display = 'none';
confirmationText.textContent = 'リダイレクト先のURLがありません。';
setTimeout(() => {
window.close();
}, 3000);
}
</script>
<script src="/scripts/functions.js"></script>
<script src="/scripts/script.js"></script>
</body>
</html>