-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
136 lines (121 loc) · 3.47 KB
/
Copy pathindex.html
File metadata and controls
136 lines (121 loc) · 3.47 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
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Привет</title>
<style>
@font-face {
font-family: 'MyFont';
src: url('font.ttf') format('truetype');
font-weight: normal;
font-style: normal;
font-display: swap;
}
:root{
--glow-size: 700px;
}
html,body{
height:100%;
margin:0;
padding:0;
overflow:hidden;
font-family: 'MyFont', system-ui, Arial, sans-serif;
display:flex;
align-items:center;
justify-content:center;
transition: background 5s ease; /* плавная смена градиента */
}
.wrap{
position:relative;
display:inline-flex;
align-items:center;
justify-content:center;
}
#text{
position:relative;
z-index:2;
font-size:8em; /* чуть меньше, чем до этого */
color: white;
transform: translateY(110%);
opacity:0;
transition: transform 1.2s ease-out, opacity 1.2s ease-out;
text-align:center;
white-space:nowrap;
text-shadow: 0 20px 40px rgba(0,0,0,0.7); /* большая тень */
}
/* Круг под текстом, теперь без белого свечения */
.wrap::before{
content:"";
position:absolute;
z-index:1;
left:50%;
top:50%;
transform:translate(-50%,-50%) scale(1);
width:var(--glow-size);
height:var(--glow-size);
border-radius:50%;
background: var(--circle-bg, rgba(255,255,255,0.1));
pointer-events:none;
animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
0% { transform:translate(-50%,-50%) scale(0.95);}
50% { transform:translate(-50%,-50%) scale(1.05);}
100% { transform:translate(-50%,-50%) scale(0.95);}
}
#text.show{
transform: translateY(0);
opacity:1;
}
</style>
</head>
<body>
<div class="wrap">
<div id="text">Привет</div>
</div>
<script>
function randHex(){
return '#'+Math.floor(Math.random()*0xFFFFFF).toString(16).padStart(6,'0');
}
let colors = Array.from({length:6}, randHex);
function setBackgroundGradient(){
colors = Array.from({length:6}, randHex);
document.body.style.background = `radial-gradient(circle at 50% 50%, ${colors.join(', ')})`;
}
function setCircleGradient(){
const base = colors[0];
function hexToRGBA(hex,a){
const c = hex.replace('#','');
const bigint = parseInt(c,16);
const r = (bigint>>16)&255;
const g = (bigint>>8)&255;
const b = bigint&255;
return `rgba(${r},${g},${b},${a})`;
}
const circleBg = hexToRGBA(base,0.35); // просто цвет круга без свечения
document.documentElement.style.setProperty('--circle-bg', circleBg);
}
// Устанавливаем начальный фон и круг
setBackgroundGradient();
setCircleGradient();
// Плавная смена градиента каждые 5 секунд
setInterval(()=>{
setBackgroundGradient();
setCircleGradient();
},5000);
// Анимация появления текста
const text = document.getElementById('text');
setTimeout(()=> text.classList.add('show'), 80);
// Закрытие через 3 секунды после появления
setTimeout(()=>{
try{
window.open('','_self');
window.close();
}catch(e){
console.warn('close blocked', e);
}
}, 3100);
</script>
</body>
</html>