Translsis commited on
Commit
cd29294
·
verified ·
1 Parent(s): 708d048

Upload index (7).html

Browse files
Files changed (1) hide show
  1. index (7).html +513 -0
index (7).html ADDED
@@ -0,0 +1,513 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ const miniBoxSize = 120;
213
+ const spawnMargin = 100; // Khoảng cách tối thiểu giữa các ô
214
+
215
+ // Hàm kiểm tra va chạm giữa 2 ô
216
+ function isOverlapping(x1, y1, x2, y2, size1, size2) {
217
+ const distance = Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2);
218
+ const minDistance = (size1 + size2) / 2 + spawnMargin;
219
+ return distance < minDistance;
220
+ }
221
+
222
+ // Hàm tìm vị trí không bị chồng lên
223
+ function findNonOverlappingPosition(existingBoxes, maxAttempts = 100) {
224
+ for (let attempt = 0; attempt < maxAttempts; attempt++) {
225
+ const x = Math.random() * (window.innerWidth - 200) + 100;
226
+ const y = Math.random() * (window.innerHeight - 200) + 100;
227
+
228
+ let hasOverlap = false;
229
+
230
+ // Kiểm tra với box chính
231
+ const mainRect = mainBox.element.getBoundingClientRect();
232
+ if (isOverlapping(x, y, mainBox.x, mainBox.y, miniBoxSize, Math.max(mainRect.width, mainRect.height))) {
233
+ hasOverlap = true;
234
+ }
235
+
236
+ // Kiểm tra với các mini box đã tạo
237
+ for (let box of existingBoxes) {
238
+ if (isOverlapping(x, y, box.x, box.y, miniBoxSize, miniBoxSize)) {
239
+ hasOverlap = true;
240
+ break;
241
+ }
242
+ }
243
+
244
+ if (!hasOverlap) {
245
+ return { x, y };
246
+ }
247
+ }
248
+
249
+ // Nếu không tìm được vị trí sau nhiều lần thử, trả về vị trí ngẫu nhiên
250
+ return {
251
+ x: Math.random() * (window.innerWidth - 200) + 100,
252
+ y: Math.random() * (window.innerHeight - 200) + 100
253
+ };
254
+ }
255
+
256
+ const miniBoxes = [];
257
+
258
+ for (let i = 0; i < miniBoxCount; i++) {
259
+ const miniBox = document.createElement('div');
260
+ miniBox.className = 'mini-box';
261
+
262
+ // Random chọn video
263
+ const videoSrc = Math.random() > 0.5 ? 'video.mp4' : 'Background.mp4';
264
+
265
+ miniBox.innerHTML = `
266
+ <video class="video-background" autoplay loop muted playsinline preload="auto" loading="eager">
267
+ <source src="${videoSrc}" type="video/mp4">
268
+ </video>
269
+ `;
270
+
271
+ document.body.appendChild(miniBox);
272
+
273
+ // Tìm vị trí không bị chồng lên
274
+ const position = findNonOverlappingPosition(miniBoxes);
275
+
276
+ const boxData = {
277
+ element: miniBox,
278
+ x: position.x,
279
+ y: position.y,
280
+ velX: (Math.random() - 0.5) * 5,
281
+ velY: (Math.random() - 0.5) * 5,
282
+ isDragging: false,
283
+ dragOffsetX: 0,
284
+ dragOffsetY: 0
285
+ };
286
+
287
+ miniBoxes.push(boxData);
288
+ boxes.push(boxData);
289
+
290
+ // Thêm event listener cho mini box
291
+ miniBox.addEventListener('mousedown', (e) => startDrag(e, boxData));
292
+ miniBox.addEventListener('touchstart', (e) => startDrag(e, boxData));
293
+ }
294
+
295
+ const friction = 0.95;
296
+ const elasticity = 0.7;
297
+ const wallMargin = 50;
298
+
299
+ // Khởi tạo vị trí ban đầu cho box chính
300
+ mainBox.element.style.left = mainBox.x + 'px';
301
+ mainBox.element.style.top = mainBox.y + 'px';
302
+ mainBox.element.style.transform = 'translate(-50%, -50%)';
303
+
304
+ // Xử lý kéo thả
305
+ container.addEventListener('mousedown', (e) => startDrag(e, mainBox));
306
+ container.addEventListener('touchstart', (e) => startDrag(e, mainBox));
307
+
308
+ function startDrag(e, box) {
309
+ box.isDragging = true;
310
+ const touch = e.type === 'touchstart' ? e.touches[0] : e;
311
+ box.dragOffsetX = touch.clientX - box.x;
312
+ box.dragOffsetY = touch.clientY - box.y;
313
+ box.velX = 0;
314
+ box.velY = 0;
315
+ e.preventDefault();
316
+ }
317
+
318
+ document.addEventListener('mousemove', drag);
319
+ document.addEventListener('touchmove', drag);
320
+
321
+ function drag(e) {
322
+ boxes.forEach(box => {
323
+ if (box.isDragging) {
324
+ const touch = e.type === 'touchmove' ? e.touches[0] : e;
325
+ const newX = touch.clientX - box.dragOffsetX;
326
+ const newY = touch.clientY - box.dragOffsetY;
327
+
328
+ box.velX = (newX - box.x) * 0.5;
329
+ box.velY = (newY - box.y) * 0.5;
330
+
331
+ box.x = newX;
332
+ box.y = newY;
333
+ }
334
+ });
335
+ }
336
+
337
+ document.addEventListener('mouseup', stopDrag);
338
+ document.addEventListener('touchend', stopDrag);
339
+
340
+ function stopDrag() {
341
+ boxes.forEach(box => {
342
+ box.isDragging = false;
343
+ });
344
+ }
345
+
346
+ // Cập nhật vật lý cho tất cả boxes
347
+ function updateBoxPhysics() {
348
+ boxes.forEach(box => {
349
+ if (!box.isDragging) {
350
+ // Áp dụng ma sát
351
+ box.velX *= friction;
352
+ box.velY *= friction;
353
+
354
+ // Cập nhật vị trí
355
+ box.x += box.velX;
356
+ box.y += box.velY;
357
+
358
+ // Kiểm tra va chạm với tường
359
+ const rect = box.element.getBoundingClientRect();
360
+ const halfWidth = rect.width / 2;
361
+ const halfHeight = rect.height / 2;
362
+
363
+ // Tường trái
364
+ if (box.x - halfWidth < wallMargin) {
365
+ box.x = wallMargin + halfWidth;
366
+ box.velX = Math.abs(box.velX) * elasticity;
367
+ }
368
+ // Tường phải
369
+ if (box.x + halfWidth > window.innerWidth - wallMargin) {
370
+ box.x = window.innerWidth - wallMargin - halfWidth;
371
+ box.velX = -Math.abs(box.velX) * elasticity;
372
+ }
373
+ // Tường trên
374
+ if (box.y - halfHeight < wallMargin) {
375
+ box.y = wallMargin + halfHeight;
376
+ box.velY = Math.abs(box.velY) * elasticity;
377
+ }
378
+ // Tường dưới
379
+ if (box.y + halfHeight > window.innerHeight - wallMargin) {
380
+ box.y = window.innerHeight - wallMargin - halfHeight;
381
+ box.velY = -Math.abs(box.velY) * elasticity;
382
+ }
383
+ }
384
+
385
+ // Cập nhật vị trí DOM
386
+ if (box.element === container) {
387
+ box.element.style.left = box.x + 'px';
388
+ box.element.style.top = box.y + 'px';
389
+ } else {
390
+ box.element.style.left = (box.x - 60) + 'px';
391
+ box.element.style.top = (box.y - 60) + 'px';
392
+ }
393
+ });
394
+
395
+ requestAnimationFrame(updateBoxPhysics);
396
+ }
397
+
398
+ updateBoxPhysics();
399
+
400
+ // Nhện con (ở các góc màn hình)
401
+ const babySpiders = [
402
+ { x: 0, y: 0, speed: 0.02 },
403
+ { x: window.innerWidth, y: 0, speed: 0.03 },
404
+ { x: 0, y: window.innerHeight, speed: 0.04 },
405
+ { x: window.innerWidth, y: window.innerHeight, speed: 0.05 }
406
+ ];
407
+
408
+ // Tạo nhện con ở các góc
409
+ babySpiders.forEach(spiderData => {
410
+ const babySpider = document.createElement('div');
411
+ babySpider.className = 'baby-spider';
412
+ babySpider.innerText = '💗';
413
+ document.body.appendChild(babySpider);
414
+ moveSpiderToCursor(babySpider, spiderData.x, spiderData.y, spiderData.speed);
415
+ });
416
+
417
+ // Di chuyển nhện con về vị trí của chuột
418
+ function moveSpiderToCursor(spiderElement, x, y, speed) {
419
+ let targetX = x;
420
+ let targetY = y;
421
+ function move() {
422
+ const dx = mouseX - targetX;
423
+ const dy = mouseY - targetY;
424
+ targetX += dx * speed;
425
+ targetY += dy * speed;
426
+ spiderElement.style.transform = `translate(${targetX}px, ${targetY}px)`;
427
+ requestAnimationFrame(move);
428
+ }
429
+ move();
430
+ }
431
+
432
+ // Hàm random chọn emoji
433
+ function getRandomEmoji() {
434
+ const emojis = ['💗', '💗', '♥'];
435
+ return emojis[Math.floor(Math.random() * emojis.length)];
436
+ }
437
+
438
+ // Hàm tạo emoji ngẫu nhiên
439
+ function createEmoji(x, y) {
440
+ const emoji = document.createElement('div');
441
+ emoji.className = 'emoji';
442
+ emoji.innerText = getRandomEmoji();
443
+ emoji.style.left = `${x}px`;
444
+ emoji.style.top = `${y}px`;
445
+ document.body.appendChild(emoji);
446
+ setTimeout(() => emoji.remove(), 1000);
447
+ }
448
+
449
+ document.addEventListener('mousemove', (e) => {
450
+ mouseX = e.clientX;
451
+ mouseY = e.clientY;
452
+
453
+ // Chỉ tạo emoji khi không kéo box nào
454
+ const anyDragging = boxes.some(box => box.isDragging);
455
+ if (!anyDragging) {
456
+ createEmoji(e.clientX, e.clientY);
457
+ }
458
+ });
459
+
460
+ document.addEventListener('click', (e) => {
461
+ createEmoji(e.clientX, e.clientY);
462
+ spiderX = e.clientX;
463
+ spiderY = e.clientY;
464
+ });
465
+
466
+ document.addEventListener('touchmove', (e) => {
467
+ const touch = e.touches[0];
468
+ mouseX = touch.clientX;
469
+ mouseY = touch.clientY;
470
+ createEmoji(mouseX, mouseY);
471
+ });
472
+
473
+ document.addEventListener('touchstart', (e) => {
474
+ const touch = e.touches[0];
475
+ createEmoji(touch.clientX, touch.clientY);
476
+ spiderX = touch.clientX;
477
+ spiderY = touch.clientY;
478
+ });
479
+
480
+ // Bỏ qua block autoplay của trình duyệt - tối ưu âm thanh
481
+ let musicStarted = false;
482
+ function startMusic() {
483
+ if (!musicStarted) {
484
+ music.loop = true;
485
+ music.play().catch(e => console.log('Music autoplay blocked:', e));
486
+ musicStarted = true;
487
+ }
488
+ }
489
+
490
+ document.addEventListener('click', startMusic, { once: true });
491
+ document.addEventListener('touchstart', startMusic, { once: true });
492
+ document.addEventListener('keydown', startMusic, { once: true });
493
+
494
+ // Di chuyển nhện lớn
495
+ function moveSpider() {
496
+ const dx = mouseX - spiderX;
497
+ const dy = mouseY - spiderY;
498
+ spiderX += dx * 0.2;
499
+ spiderY += dy * 0.2;
500
+ spider.style.transform = `translate(${spiderX}px, ${spiderY}px)`;
501
+
502
+ if (Math.abs(dx) < 1 && Math.abs(dy) < 1) {
503
+ spiderX = window.innerWidth / 2;
504
+ spiderY = window.innerHeight / 2;
505
+ }
506
+
507
+ requestAnimationFrame(moveSpider);
508
+ }
509
+
510
+ moveSpider();
511
+ </script>
512
+ </body>
513
+ </html>