-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
309 lines (271 loc) · 9 KB
/
Copy pathindex.html
File metadata and controls
309 lines (271 loc) · 9 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<!DOCTYPE html>
<html>
<head>
<title><3</title>
<link href="https://fonts.googleapis.com/css2?family=Handlee&display=swap" rel="stylesheet">
<style>
:root {
--color-env: #FFB7C5;
--color-env2: #ff9aad;
--color-flap: #ff8da1;
--color-bg: #ed7fca;
--color-heart: #ff85a2;
--color-sparkle: #fff;
--wax-red: #c04040;
}
#envelope {
position: relative;
width: 280px;
height: 180px;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
margin: 0 auto;
top: 150px;
background-color: var(--color-flap);
box-shadow: 0 4px 20px rgba(0,0,0,.1);
cursor: pointer;
}
.front {
position: absolute;
width: 0;
height: 0;
z-index: 3;
}
.flap {
border-left: 140px solid transparent;
border-right: 140px solid transparent;
border-bottom: 82px solid transparent;
border-top: 98px solid var(--color-flap);
transform-origin: top;
pointer-events: none;
}
.pocket {
border-left: 140px solid var(--color-env);
border-right: 140px solid var(--color-env);
border-bottom: 90px solid var(--color-env2);
border-top: 90px solid transparent;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
}
.letter {
position: relative;
background-color: #e0d9dd;
width: 90%;
margin: 0 auto;
height: 90%;
top: 5%;
border-radius: 6px;
box-shadow: 0 2px 26px rgba(0,0,0,.08);
padding: 15px;
box-sizing: border-box;
}
.letter:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-image: linear-gradient(180deg,
rgba(255,255,255,0.00) 25%,
rgba(255,231,236,0.70) 55%,
rgba(255,231,236,1.00) 100%);
}
.message {
position: relative;
z-index: 2;
font-family: 'Handlee', cursive;
color: #d46a84;
text-align: center;
line-height: 1;
padding-top: 0px;
}
.message p {
margin: 10px 0;
font-size: 1em;
text-shadow: 0 2px 3px rgba(0,0,0,0.1);
}
@keyframes float {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-10px); }
}
.envlope-wrapper {
height: 380px;
margin-top: 50px;
animation: float 3s ease-in-out infinite;
}
.open .flap {
transform: rotateX(180deg);
transition: transform 0.4s ease, z-index 0.6s;
z-index: 1;
}
.close .flap {
transform: rotateX(0deg);
transition: transform 0.4s 0.6s ease, z-index 1s;
z-index: 5;
}
.close .letter {
transform: translateY(0px);
transition: transform 0.4s ease, z-index 1s;
z-index: 1;
}
.open .letter {
transform: translateY(-150px) rotate(-2deg);
transition: transform 0.4s 0.6s ease, z-index 0.6s;
z-index: 2;
}
.letter-corner {
position: absolute;
width: 20px;
height: 20px;
border: 2px solid #ffd1dc;
border-radius: 5px;
z-index: 3;
}
.corner-tl { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.corner-br { bottom: 10px; right: 10px; border-left: none; border-top: none; }
.hearts, .sparkles {
position: absolute;
top: 90px;
left: 0;
right: 0;
z-index: 2;
}
.heart, .sparkle {
position: absolute;
bottom: 0;
pointer-events: none;
}
.heart:before,
.heart:after {
content: "";
position: absolute;
left: 25px;
top: 0;
width: 25px;
height: 40px;
background: var(--color-heart);
border-radius: 25px 25px 0 0;
transform: rotate(-45deg);
transform-origin: 0 100%;
}
.heart:after {
left: 0;
transform: rotate(45deg);
transform-origin: 100% 100%;
}
.sparkle {
width: 8px;
height: 8px;
background: var(--color-sparkle);
border-radius: 50%;
animation: sparkleTwinkle 1s infinite;
}
.close .heart,
.close .sparkle {
opacity: 0;
animation: none;
}
.a1 { left: 20%; transform: scale(0.6); animation: slideUp 4s linear infinite, sideSway 2s ease-in-out infinite alternate; }
.a2 { left: 55%; animation: slideUp 5s linear infinite, sideSway 4s ease-in-out infinite alternate; }
.a3 { left: 10%; transform: scale(0.8); animation: slideUp 7s linear infinite, sideSway 2s ease-in-out infinite alternate; }
.s1 { left: 30%; animation: sparkleUp 3s linear infinite; }
.s2 { left: 60%; animation: sparkleUp 4s linear infinite; }
.s3 { left: 45%; animation: sparkleUp 5s linear infinite; }
@keyframes slideUp {
0% { top: 0; }
100% { top: -600px; }
}
@keyframes sideSway {
0% { margin-left: 0; }
50% { margin-left: 50px; }
100% { margin-left: 0; }
}
@keyframes sparkleUp {
0% { transform: translateY(0); opacity: 1; }
100% { transform: translateY(-500px) rotate(360deg); opacity: 0; }
}
@keyframes sparkleTwinkle {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.5); }
}
body {
background: url('https://media.giphy.com/media/vL4CaBuA4o6kVi7ocS/giphy.gif?cid=790b7611pldpuott7d0dg0c6taixudik3hd331atvnld9q3d&ep=v1_gifs_search&rid=giphy.gif&ct=g') no-repeat center center fixed;
background-size: cover;
}
.reset {
text-align: center;
margin-top: 50px;
}
.reset button {
font-weight: 600;
transition: all 0.3s ease;
background-color: var(--color-env);
border: 2px solid var(--color-env2);
border-radius: 20px;
color: white;
padding: 12px 25px;
margin: 10px;
font-size: 16px;
cursor: pointer;
box-shadow: 0 5px 20px rgba(0,0,0,0.15);
font-family: Arial, sans-serif;
}
.reset button:hover {
background-color: var(--color-env2);
transform: translateY(-3px) scale(1.05);
box-shadow: 0 7px 25px rgba(0,0,0,0.2);
}
</style>
</head>
<body>
<div class="envlope-wrapper">
<div id="envelope" class="close">
<div class="wax-seal"></div>
<div class="front flap"></div>
<div class="front pocket"></div>
<div class="letter">
<div class="letter-corner corner-tl"></div>
<div class="letter-corner corner-br"></div>
<div class="message">
<p>Лиза</p>
<p>хоть ты иногда и пакостишь, но</p>
<p>я тебя люблю, как никого и никогда</p>
<p>от сашечки <3</p>
</div>
</div>
<div class="hearts">
<div class="heart a1"></div>
<div class="heart a2"></div>
<div class="heart a3"></div>
</div>
<div class="sparkles">
<div class="sparkle s1"></div>
<div class="sparkle s2"></div>
<div class="sparkle s3"></div>
</div>
</div>
</div>
<div class="reset">
<button id="open">Открыть</button>
<button id="reset">Закрыть</button>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
const envelope = $('#envelope');
const btnOpen = $("#open");
const btnReset = $("#reset");
envelope.on('click', open);
btnOpen.on('click', open);
btnReset.on('click', close);
function open() {
envelope.removeClass("close").addClass("open");
}
function close() {
envelope.removeClass("open").addClass("close");
}
});
</script>
</body>
</html>