forked from sm1ky/redirect-page
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathindex.html
More file actions
145 lines (129 loc) · 4.6 KB
/
index.html
File metadata and controls
145 lines (129 loc) · 4.6 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redirect Page</title>
<style>
/* Импорт шрифта */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;600&display=swap');
/* Основные стили для тела */
body {
font-family: 'Ubuntu', sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
text-align: center;
overflow: hidden;
transition: background-color 0.3s, color 0.3s;
}
/* Светлая тема */
body.light {
background-color: #F5F5F5;
color: #333;
}
/* Темная тема */
body.dark {
background-color: #161b22;
color: #ddd;
}
/* Фон с текстурой */
body::after {
content: '';
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-image: url('https://i.ibb.co/HqRwCSL/Pattern-Copy-1.png');
background-repeat: no-repeat;
background-size: cover;
background-position: center;
opacity: 0.2;
pointer-events: none;
z-index: 1;
}
.container {
background: rgba(255, 255, 255, 0.2);
padding: 30px;
border-radius: 15px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
backdrop-filter: blur(10px);
max-width: 400px;
width: 90%;
position: relative;
z-index: 2;
}
h1 {
font-size: 24px;
margin-bottom: 20px;
}
p {
font-size: 14px;
margin-top: 20px;
color: #888;
}
a.button {
display: inline-block;
padding: 15px 30px;
font-size: 20px;
font-weight: bold;
border-radius: 50px;
text-decoration: none;
color: #ffffff;
background: #0b7285;
background-size: 400% 400%;
transition: transform 0.3s ease, box-shadow 0.3s ease;
animation: gradientAnimation 5s ease-in-out infinite;
}
a.button:hover {
transform: translateY(-3px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function () {
const currentURL = window.location.href;
let redirectTo = decodeURIComponent(currentURL.split('redirect_to=')[1] || '');
const language = navigator.language || navigator.userLanguage;
const isRussian = language.startsWith('ru');
const titleText = isRussian ? 'Продолжить' : 'Continue';
const buttonText = isRussian ? 'Нажмите сюда, чтобы продолжить' : 'Click here to proceed';
const instructionsText = isRussian
? 'Переадресация произойдёт автоматически в течение 5 секунд.\nЕсли этого не произошло, нажмите на кнопку выше.'
: 'You will be redirected automatically within 5 seconds.\nIf nothing happens, please click the button above.';
// document.getElementById('title').innerText = titleText;
const linkEl = document.getElementById('redirectLink');
linkEl.innerText = buttonText;
linkEl.href = redirectTo;
document.getElementById('instructions').innerText = instructionsText;
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.body.classList.add('dark');
} else {
document.body.classList.add('light');
}
let redirectTimer;
if (redirectTo) {
redirectTimer = setTimeout(() => {
window.location.href = redirectTo;
}, 5000);
linkEl.addEventListener('click', function () {
clearTimeout(redirectTimer);
});
} else {
alert(isRussian ? 'Не указана ссылка для перенаправления.' : 'No redirect link specified.');
}
});
</script>
</head>
<body>
<div class="container">
<!-- <h1 id="title">Continue</h1> -->
<a id="redirectLink" class="button" href="#" target="_blank">Click here to proceed</a>
<p id="instructions">To continue, please click the button above.</p>
</div>
</body>
</html>