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 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6
+ <title>XQ Thối</title>
7
+ <style>
8
+ html, body {
9
+ margin: 0;
10
+ padding: 0;
11
+ overflow: hidden;
12
+ height: 100vh;
13
+ width: 100vw;
14
+ font-family: 'Arial Rounded MT Bold', sans-serif;
15
+ position: relative;
16
+ }
17
+
18
+ /* Video nền cho body */
19
+ #body-video-bg {
20
+ position: fixed;
21
+ top: 0;
22
+ left: 0;
23
+ width: 100%;
24
+ height: 100%;
25
+ object-fit: cover;
26
+ z-index: -2;
27
+ will-change: transform;
28
+ transform: translateZ(0);
29
+ backface-visibility: hidden;
30
+ }
31
+
32
+ /* Màu nền dự phòng khi video đang load */
33
+ body::before {
34
+ content: '';
35
+ position: fixed;
36
+ top: 0;
37
+ left: 0;
38
+ width: 100%;
39
+ height: 100%;
40
+ background: linear-gradient(to bottom right, #000000, #222222);
41
+ z-index: -3;
42
+ }
43
+
44
+ /* Khung chữ */
45
+ .container {
46
+ position: absolute;
47
+ border: 5px solid #8B4513;
48
+ padding: 40px;
49
+ border-radius: 20px;
50
+ background-color: rgba(255, 255, 255, 0.3);
51
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
52
+ overflow: hidden;
53
+ cursor: grab;
54
+ user-select: none;
55
+ }
56
+
57
+ .container:active {
58
+ cursor: grabbing;
59
+ }
60
+
61
+ /* Ô mini */
62
+ .mini-box {
63
+ position: absolute;
64
+ border: 3px solid #8B4513;
65
+ padding: 15px;
66
+ border-radius: 12px;
67
+ background-color: rgba(255, 255, 255, 0.25);
68
+ box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
69
+ overflow: hidden;
70
+ cursor: grab;
71
+ user-select: none;
72
+ width: 120px;
73
+ height: 120px;
74
+ }
75
+
76
+ .mini-box:active {
77
+ cursor: grabbing;
78
+ }
79
+
80
+ /* Video nền cho container */
81
+ .video-background {
82
+ position: absolute;
83
+ top: 0;
84
+ left: 0;
85
+ width: 100%;
86
+ height: 100%;
87
+ object-fit: cover;
88
+ z-index: -1;
89
+ border-radius: 15px;
90
+ will-change: transform;
91
+ transform: translateZ(0);
92
+ backface-visibility: hidden;
93
+ }
94
+
95
+ h1 {
96
+ font-size: 6rem;
97
+ color: #000000;
98
+ text-shadow: 0 0 25px #d2b48c, 0 0 40px #8B4513;
99
+ display: flex;
100
+ flex-direction: column;
101
+ align-items: center;
102
+ gap: 20px;
103
+ margin: 0;
104
+ position: relative;
105
+ z-index: 1;
106
+ }
107
+
108
+ .letter {
109
+ display: inline-block;
110
+ animation: floaty 3s ease-in-out infinite;
111
+ }
112
+
113
+ @keyframes floaty {
114
+ 0% { transform: translateY(0) rotate(0deg); }
115
+ 25% { transform: translateY(-8px) rotate(1deg); }
116
+ 50% { transform: translateY(0) rotate(0deg); }
117
+ 75% { transform: translateY(8px) rotate(-1deg); }
118
+ 100% { transform: translateY(0) rotate(0deg); }
119
+ }
120
+
121
+ .emoji {
122
+ position: absolute;
123
+ font-size: 26px;
124
+ animation: pop 1s ease-out forwards;
125
+ color: #8B4513;
126
+ pointer-events: none;
127
+ }
128
+
129
+ @keyframes pop {
130
+ 0% { transform: scale(1); opacity: 1; }
131
+ 100% { transform: scale(2); opacity: 0; top: -40px; }
132
+ }
133
+
134
+ .spider {
135
+ position: absolute;
136
+ font-size: 40px;
137
+ pointer-events: none;
138
+ transition: transform 0.1s linear;
139
+ }
140
+
141
+ .baby-spider {
142
+ position: absolute;
143
+ font-size: 20px;
144
+ pointer-events: none;
145
+ transition: transform 0.1s linear;
146
+ }
147
+
148
+ /* Khung hoa văn */
149
+ .border-frame {
150
+ position: absolute;
151
+ top: 0;
152
+ left: 0;
153
+ width: 100vw;
154
+ height: 100vh;
155
+ background-image: url('https://www.transparenttextures.com/patterns/circuit-board.png');
156
+ background-size: cover;
157
+ z-index: -1;
158
+ }
159
+ </style>
160
+ </head>
161
+ <body>
162
+
163
+ <!-- Video nền toàn màn hình -->
164
+ <video id="body-video-bg" autoplay loop muted playsinline preload="auto" loading="eager">
165
+ <source src="Background.mp4" type="video/mp4">
166
+ </video>
167
+
168
+ <!-- Khung hoa văn -->
169
+ <div class="border-frame"></div>
170
+
171
+ <!-- Khung chữ với nội dung -->
172
+ <div class="container">
173
+ <video class="video-background" autoplay loop muted playsinline preload="auto" loading="eager">
174
+ <source src="video.mp4" type="video/mp4">
175
+ </video>
176
+ <h1>
177
+ <span class="letter">emem</span>
178
+ <span class="letter">XQ</span>
179
+ <span class="letter">💗</span>
180
+ </h1>
181
+ </div>
182
+
183
+ <div id="spider" class="spider">💗</div>
184
+ <audio id="bg-music" src="music.mp3" preload="auto"></audio>
185
+
186
+ <script>
187
+ const spider = document.getElementById('spider');
188
+ const music = document.getElementById('bg-music');
189
+ const container = document.querySelector('.container');
190
+ let mouseX = window.innerWidth / 2;
191
+ let mouseY = window.innerHeight / 2;
192
+ let spiderX = mouseX, spiderY = mouseY;
193
+
194
+ // Mảng chứa tất cả các box (bao gồm cả box chính và mini boxes)
195
+ const boxes = [];
196
+
197
+ // Khởi tạo box chính
198
+ const mainBox = {
199
+ element: container,
200
+ x: window.innerWidth / 2,
201
+ y: window.innerHeight / 2,
202
+ velX: 0,
203
+ velY: 0,
204
+ isDragging: false,
205
+ dragOffsetX: 0,
206
+ dragOffsetY: 0
207
+ };
208
+ boxes.push(mainBox);
209
+
210
+ // Tạo 8 ô mini với video ngẫu nhiên
211
+ const miniBoxCount = 8;
212
+ for (let i = 0; i < miniBoxCount; i++) {
213
+ const miniBox = document.createElement('div');
214
+ miniBox.className = 'mini-box';
215
+
216
+ // Random chọn video
217
+ const videoSrc = Math.random() > 0.5 ? 'video.mp4' : 'Background.mp4';
218
+
219
+ miniBox.innerHTML = `
220
+ <video class="video-background" autoplay loop muted playsinline preload="auto" loading="eager">
221
+ <source src="${videoSrc}" type="video/mp4">
222
+ </video>
223
+ `;
224
+
225
+ document.body.appendChild(miniBox);
226
+
227
+ // Vị trí ngẫu nhiên
228
+ const boxData = {
229
+ element: miniBox,
230
+ x: Math.random() * (window.innerWidth - 150) + 75,
231
+ y: Math.random() * (window.innerHeight - 150) + 75,
232
+ velX: (Math.random() - 0.5) * 5,
233
+ velY: (Math.random() - 0.5) * 5,
234
+ isDragging: false,
235
+ dragOffsetX: 0,
236
+ dragOffsetY: 0
237
+ };
238
+
239
+ boxes.push(boxData);
240
+
241
+ // Thêm event listener cho mini box
242
+ miniBox.addEventListener('mousedown', (e) => startDrag(e, boxData));
243
+ miniBox.addEventListener('touchstart', (e) => startDrag(e, boxData));
244
+ }
245
+
246
+ const friction = 0.95;
247
+ const elasticity = 0.7;
248
+ const wallMargin = 50;
249
+
250
+ // Khởi tạo vị trí ban đầu cho box chính
251
+ mainBox.element.style.left = mainBox.x + 'px';
252
+ mainBox.element.style.top = mainBox.y + 'px';
253
+ mainBox.element.style.transform = 'translate(-50%, -50%)';
254
+
255
+ // Xử lý kéo thả
256
+ container.addEventListener('mousedown', (e) => startDrag(e, mainBox));
257
+ container.addEventListener('touchstart', (e) => startDrag(e, mainBox));
258
+
259
+ function startDrag(e, box) {
260
+ box.isDragging = true;
261
+ const touch = e.type === 'touchstart' ? e.touches[0] : e;
262
+ box.dragOffsetX = touch.clientX - box.x;
263
+ box.dragOffsetY = touch.clientY - box.y;
264
+ box.velX = 0;
265
+ box.velY = 0;
266
+ e.preventDefault();
267
+ }
268
+
269
+ document.addEventListener('mousemove', drag);
270
+ document.addEventListener('touchmove', drag);
271
+
272
+ function drag(e) {
273
+ boxes.forEach(box => {
274
+ if (box.isDragging) {
275
+ const touch = e.type === 'touchmove' ? e.touches[0] : e;
276
+ const newX = touch.clientX - box.dragOffsetX;
277
+ const newY = touch.clientY - box.dragOffsetY;
278
+
279
+ box.velX = (newX - box.x) * 0.5;
280
+ box.velY = (newY - box.y) * 0.5;
281
+
282
+ box.x = newX;
283
+ box.y = newY;
284
+ }
285
+ });
286
+ }
287
+
288
+ document.addEventListener('mouseup', stopDrag);
289
+ document.addEventListener('touchend', stopDrag);
290
+
291
+ function stopDrag() {
292
+ boxes.forEach(box => {
293
+ box.isDragging = false;
294
+ });
295
+ }
296
+
297
+ // Cập nhật vật lý cho tất cả boxes
298
+ function updateBoxPhysics() {
299
+ boxes.forEach(box => {
300
+ if (!box.isDragging) {
301
+ // Áp dụng ma sát
302
+ box.velX *= friction;
303
+ box.velY *= friction;
304
+
305
+ // Cập nhật vị trí
306
+ box.x += box.velX;
307
+ box.y += box.velY;
308
+
309
+ // Kiểm tra va chạm với tường
310
+ const rect = box.element.getBoundingClientRect();
311
+ const halfWidth = rect.width / 2;
312
+ const halfHeight = rect.height / 2;
313
+
314
+ // Tường trái
315
+ if (box.x - halfWidth < wallMargin) {
316
+ box.x = wallMargin + halfWidth;
317
+ box.velX = Math.abs(box.velX) * elasticity;
318
+ }
319
+ // Tường phải
320
+ if (box.x + halfWidth > window.innerWidth - wallMargin) {
321
+ box.x = window.innerWidth - wallMargin - halfWidth;
322
+ box.velX = -Math.abs(box.velX) * elasticity;
323
+ }
324
+ // Tường trên
325
+ if (box.y - halfHeight < wallMargin) {
326
+ box.y = wallMargin + halfHeight;
327
+ box.velY = Math.abs(box.velY) * elasticity;
328
+ }
329
+ // Tường dưới
330
+ if (box.y + halfHeight > window.innerHeight - wallMargin) {
331
+ box.y = window.innerHeight - wallMargin - halfHeight;
332
+ box.velY = -Math.abs(box.velY) * elasticity;
333
+ }
334
+ }
335
+
336
+ // Cập nhật vị trí DOM
337
+ if (box.element === container) {
338
+ box.element.style.left = box.x + 'px';
339
+ box.element.style.top = box.y + 'px';
340
+ } else {
341
+ box.element.style.left = (box.x - 60) + 'px';
342
+ box.element.style.top = (box.y - 60) + 'px';
343
+ }
344
+ });
345
+
346
+ requestAnimationFrame(updateBoxPhysics);
347
+ }
348
+
349
+ updateBoxPhysics();
350
+
351
+ // Nhện con (ở các góc màn hình)
352
+ const babySpiders = [
353
+ { x: 0, y: 0, speed: 0.02 },
354
+ { x: window.innerWidth, y: 0, speed: 0.03 },
355
+ { x: 0, y: window.innerHeight, speed: 0.04 },
356
+ { x: window.innerWidth, y: window.innerHeight, speed: 0.05 }
357
+ ];
358
+
359
+ // Tạo nhện con ở các góc
360
+ babySpiders.forEach(spiderData => {
361
+ const babySpider = document.createElement('div');
362
+ babySpider.className = 'baby-spider';
363
+ babySpider.innerText = '💗';
364
+ document.body.appendChild(babySpider);
365
+ moveSpiderToCursor(babySpider, spiderData.x, spiderData.y, spiderData.speed);
366
+ });
367
+
368
+ // Di chuyển nhện con về vị trí của chuột
369
+ function moveSpiderToCursor(spiderElement, x, y, speed) {
370
+ let targetX = x;
371
+ let targetY = y;
372
+ function move() {
373
+ const dx = mouseX - targetX;
374
+ const dy = mouseY - targetY;
375
+ targetX += dx * speed;
376
+ targetY += dy * speed;
377
+ spiderElement.style.transform = `translate(${targetX}px, ${targetY}px)`;
378
+ requestAnimationFrame(move);
379
+ }
380
+ move();
381
+ }
382
+
383
+ // Hàm random chọn emoji
384
+ function getRandomEmoji() {
385
+ const emojis = ['💗', '💗', '♥'];
386
+ return emojis[Math.floor(Math.random() * emojis.length)];
387
+ }
388
+
389
+ // Hàm tạo emoji ngẫu nhiên
390
+ function createEmoji(x, y) {
391
+ const emoji = document.createElement('div');
392
+ emoji.className = 'emoji';
393
+ emoji.innerText = getRandomEmoji();
394
+ emoji.style.left = `${x}px`;
395
+ emoji.style.top = `${y}px`;
396
+ document.body.appendChild(emoji);
397
+ setTimeout(() => emoji.remove(), 1000);
398
+ }
399
+
400
+ document.addEventListener('mousemove', (e) => {
401
+ mouseX = e.clientX;
402
+ mouseY = e.clientY;
403
+
404
+ // Chỉ tạo emoji khi không kéo box nào
405
+ const anyDragging = boxes.some(box => box.isDragging);
406
+ if (!anyDragging) {
407
+ createEmoji(e.clientX, e.clientY);
408
+ }
409
+ });
410
+
411
+ document.addEventListener('click', (e) => {
412
+ createEmoji(e.clientX, e.clientY);
413
+ spiderX = e.clientX;
414
+ spiderY = e.clientY;
415
+ });
416
+
417
+ document.addEventListener('touchmove', (e) => {
418
+ const touch = e.touches[0];
419
+ mouseX = touch.clientX;
420
+ mouseY = touch.clientY;
421
+ createEmoji(mouseX, mouseY);
422
+ });
423
+
424
+ document.addEventListener('touchstart', (e) => {
425
+ const touch = e.touches[0];
426
+ createEmoji(touch.clientX, touch.clientY);
427
+ spiderX = touch.clientX;
428
+ spiderY = touch.clientY;
429
+ });
430
+
431
+ // Bỏ qua block autoplay của trình duyệt - tối ưu âm thanh
432
+ let musicStarted = false;
433
+ function startMusic() {
434
+ if (!musicStarted) {
435
+ music.loop = true;
436
+ music.play().catch(e => console.log('Music autoplay blocked:', e));
437
+ musicStarted = true;
438
+ }
439
+ }
440
+
441
+ document.addEventListener('click', startMusic, { once: true });
442
+ document.addEventListener('touchstart', startMusic, { once: true });
443
+ document.addEventListener('keydown', startMusic, { once: true });
444
+
445
+ // Di chuyển nhện lớn
446
+ function moveSpider() {
447
+ const dx = mouseX - spiderX;
448
+ const dy = mouseY - spiderY;
449
+ spiderX += dx * 0.2;
450
+ spiderY += dy * 0.2;
451
+ spider.style.transform = `translate(${spiderX}px, ${spiderY}px)`;
452
+
453
+ if (Math.abs(dx) < 1 && Math.abs(dy) < 1) {
454
+ spiderX = window.innerWidth / 2;
455
+ spiderY = window.innerHeight / 2;
456
+ }
457
+
458
+ requestAnimationFrame(moveSpider);
459
+ }
460
+
461
+ moveSpider();
462
+ </script>
463
+ </body>
464
+ </html>