Spaces:
Running
Running
Update index.html
Browse files- index.html +101 -155
index.html
CHANGED
|
@@ -140,45 +140,39 @@
|
|
| 140 |
height: 100%;
|
| 141 |
object-fit: contain;
|
| 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 |
-
padding: 20px;
|
| 171 |
-
background: linear-gradient(45deg, #1a1a1a, #2c2c2c);
|
| 172 |
-
border-radius: 15px;
|
| 173 |
-
}
|
| 174 |
-
|
| 175 |
.thumbnail:hover {
|
| 176 |
transform: translateY(-5px) scale(1.02);
|
| 177 |
box-shadow:
|
| 178 |
0 8px 20px rgba(0, 0, 0, 0.8),
|
| 179 |
0 0 0 1px rgba(255, 255, 255, 0.2);
|
| 180 |
}
|
| 181 |
-
|
| 182 |
.thumbnail:hover video {
|
| 183 |
transform: scale(1.1);
|
| 184 |
}
|
|
@@ -218,7 +212,7 @@
|
|
| 218 |
</div>
|
| 219 |
|
| 220 |
<script>
|
| 221 |
-
|
| 222 |
// ๋น๋์ค ํ์ผ ๋ฐฐ์ด์ ์์ ํ์ฌ ์์ฐจ์ ์ผ๋ก ํญ ๋ฒํธ ํ ๋น
|
| 223 |
const videoFiles = [
|
| 224 |
// ์ฒซ ๋ฒ์งธ ๊ทธ๋ฃน (ํญ 1)
|
|
@@ -370,141 +364,93 @@ const videoFiles = [
|
|
| 370 |
|
| 371 |
{ file: 'tmps_zu8c60.output.mp4', tab: 8 }
|
| 372 |
];
|
| 373 |
-
|
| 374 |
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
const
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
if (index < initialLoadCount) {
|
| 387 |
-
createVideoElement(thumbnail, videoData, true);
|
| 388 |
-
loadedVideos++;
|
| 389 |
-
} else {
|
| 390 |
-
thumbnail.dataset.videoSrc = videoData.file;
|
| 391 |
-
thumbnail.style.backgroundColor = '#1a1a1a';
|
| 392 |
-
}
|
| 393 |
-
gallery.appendChild(thumbnail);
|
| 394 |
-
});
|
| 395 |
-
const observer = new IntersectionObserver((entries) => {
|
| 396 |
-
entries.forEach(entry => {
|
| 397 |
-
if (entry.isIntersecting) {
|
| 398 |
-
const thumbnail = entry.target;
|
| 399 |
-
if (thumbnail.dataset.videoSrc) {
|
| 400 |
-
createVideoElement(thumbnail, { file: thumbnail.dataset.videoSrc }, false);
|
| 401 |
-
delete thumbnail.dataset.videoSrc;
|
| 402 |
-
}
|
| 403 |
-
}
|
| 404 |
-
});
|
| 405 |
-
}, {
|
| 406 |
-
root: null,
|
| 407 |
-
rootMargin: '50px',
|
| 408 |
-
threshold: 0.1
|
| 409 |
-
});
|
| 410 |
-
document.querySelectorAll('.thumbnail').forEach(thumb => {
|
| 411 |
-
observer.observe(thumb);
|
| 412 |
});
|
| 413 |
-
if (videoFiles.length > 0) {
|
| 414 |
-
selectedThumb.src = videoFiles[0].file;
|
| 415 |
-
selectedVideo.src = videoFiles[0].file;
|
| 416 |
-
selectedThumb.currentTime = 0;
|
| 417 |
-
}
|
| 418 |
-
}
|
| 419 |
-
function createVideoElement(thumbnail, videoData, autoload) {
|
| 420 |
-
const thumbVideo = document.createElement('video');
|
| 421 |
-
thumbVideo.src = videoData.file; // ์ง์ src ์ค์
|
| 422 |
-
thumbVideo.playsinline = true;
|
| 423 |
-
thumbVideo.muted = true;
|
| 424 |
-
thumbVideo.loop = true; // ๋ฐ๋ณต ์ฌ์ ์ถ๊ฐ
|
| 425 |
-
thumbVideo.preload = 'metadata';
|
| 426 |
-
|
| 427 |
-
// ๋น๋์ค ๋ก๋ ์๋ฃ ํ ์ฒ๋ฆฌ
|
| 428 |
-
thumbVideo.addEventListener('loadeddata', () => {
|
| 429 |
-
thumbVideo.currentTime = 0;
|
| 430 |
-
});
|
| 431 |
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
});
|
| 437 |
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
|
| 456 |
-
|
| 457 |
-
}
|
| 458 |
|
| 459 |
-
function initializeGallery() {
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
}
|
| 469 |
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
gallery.appendChild(thumbnail);
|
| 478 |
-
});
|
| 479 |
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
}
|
| 483 |
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
|
|
|
| 492 |
}
|
| 493 |
-
});
|
| 494 |
-
}
|
| 495 |
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
});
|
| 505 |
|
| 506 |
-
|
| 507 |
-
initializeGallery();
|
|
|
|
| 508 |
</script>
|
| 509 |
</body>
|
| 510 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
height: 100%;
|
| 141 |
object-fit: contain;
|
| 142 |
}
|
| 143 |
+
.thumbnail {
|
| 144 |
+
position: relative;
|
| 145 |
+
padding-top: 56.25%;
|
| 146 |
+
cursor: pointer;
|
| 147 |
+
overflow: hidden;
|
| 148 |
+
background-color: #000;
|
| 149 |
+
border: 3px solid #333;
|
| 150 |
+
border-radius: 8px;
|
| 151 |
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
|
| 152 |
+
transition: transform 0.3s ease;
|
| 153 |
+
}
|
| 154 |
+
.thumbnail video {
|
| 155 |
+
position: absolute;
|
| 156 |
+
top: 0;
|
| 157 |
+
left: 0;
|
| 158 |
+
width: 100%;
|
| 159 |
+
height: 100%;
|
| 160 |
+
object-fit: cover;
|
| 161 |
+
}
|
| 162 |
+
.gallery {
|
| 163 |
+
display: grid;
|
| 164 |
+
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
| 165 |
+
gap: 15px;
|
| 166 |
+
padding: 20px;
|
| 167 |
+
background: linear-gradient(45deg, #1a1a1a, #2c2c2c);
|
| 168 |
+
border-radius: 15px;
|
| 169 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
.thumbnail:hover {
|
| 171 |
transform: translateY(-5px) scale(1.02);
|
| 172 |
box-shadow:
|
| 173 |
0 8px 20px rgba(0, 0, 0, 0.8),
|
| 174 |
0 0 0 1px rgba(255, 255, 255, 0.2);
|
| 175 |
}
|
|
|
|
| 176 |
.thumbnail:hover video {
|
| 177 |
transform: scale(1.1);
|
| 178 |
}
|
|
|
|
| 212 |
</div>
|
| 213 |
|
| 214 |
<script>
|
| 215 |
+
|
| 216 |
// ๋น๋์ค ํ์ผ ๋ฐฐ์ด์ ์์ ํ์ฌ ์์ฐจ์ ์ผ๋ก ํญ ๋ฒํธ ํ ๋น
|
| 217 |
const videoFiles = [
|
| 218 |
// ์ฒซ ๋ฒ์งธ ๊ทธ๋ฃน (ํญ 1)
|
|
|
|
| 364 |
|
| 365 |
{ file: 'tmps_zu8c60.output.mp4', tab: 8 }
|
| 366 |
];
|
|
|
|
| 367 |
|
| 368 |
+
|
| 369 |
+
function createVideoElement(thumbnail, videoData) {
|
| 370 |
+
const thumbVideo = document.createElement('video');
|
| 371 |
+
thumbVideo.src = videoData.file;
|
| 372 |
+
thumbVideo.playsinline = true;
|
| 373 |
+
thumbVideo.muted = true;
|
| 374 |
+
thumbVideo.loop = true;
|
| 375 |
+
thumbVideo.preload = 'metadata';
|
| 376 |
+
|
| 377 |
+
thumbVideo.addEventListener('loadeddata', () => {
|
| 378 |
+
thumbVideo.currentTime = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 379 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 380 |
|
| 381 |
+
thumbVideo.addEventListener('error', (e) => {
|
| 382 |
+
console.error('Video loading error:', e);
|
| 383 |
+
thumbnail.style.backgroundColor = '#333';
|
| 384 |
+
});
|
|
|
|
| 385 |
|
| 386 |
+
thumbnail.addEventListener('mouseenter', () => {
|
| 387 |
+
thumbVideo.play().catch(e => console.log('Playback failed:', e));
|
| 388 |
+
});
|
| 389 |
|
| 390 |
+
thumbnail.addEventListener('mouseleave', () => {
|
| 391 |
+
thumbVideo.pause();
|
| 392 |
+
thumbVideo.currentTime = 0;
|
| 393 |
+
});
|
| 394 |
|
| 395 |
+
thumbnail.addEventListener('click', () => {
|
| 396 |
+
const selectedThumb = document.getElementById('selected-thumb');
|
| 397 |
+
const selectedVideo = document.getElementById('selected-video');
|
| 398 |
+
|
| 399 |
+
selectedThumb.src = videoData.file;
|
| 400 |
+
selectedVideo.src = videoData.file;
|
| 401 |
+
selectedVideo.play().catch(e => console.log('Playback failed:', e));
|
| 402 |
+
});
|
| 403 |
|
| 404 |
+
thumbnail.appendChild(thumbVideo);
|
| 405 |
+
}
|
| 406 |
|
| 407 |
+
function initializeGallery() {
|
| 408 |
+
const gallery = document.getElementById('video-gallery');
|
| 409 |
+
const selectedThumb = document.getElementById('selected-thumb');
|
| 410 |
+
const selectedVideo = document.getElementById('selected-video');
|
| 411 |
|
| 412 |
+
if (videoFiles.length > 0) {
|
| 413 |
+
selectedThumb.src = videoFiles[0].file;
|
| 414 |
+
selectedVideo.src = videoFiles[0].file;
|
| 415 |
+
}
|
|
|
|
| 416 |
|
| 417 |
+
videoFiles.forEach((videoData) => {
|
| 418 |
+
const thumbnail = document.createElement('div');
|
| 419 |
+
thumbnail.className = 'thumbnail';
|
| 420 |
+
thumbnail.dataset.tab = videoData.tab.toString();
|
| 421 |
+
createVideoElement(thumbnail, videoData);
|
| 422 |
+
gallery.appendChild(thumbnail);
|
| 423 |
+
});
|
|
|
|
|
|
|
| 424 |
|
| 425 |
+
showTabContent('1');
|
| 426 |
+
}
|
|
|
|
| 427 |
|
| 428 |
+
function showTabContent(tabNumber) {
|
| 429 |
+
const thumbnails = document.querySelectorAll('.thumbnail');
|
| 430 |
+
thumbnails.forEach(thumb => {
|
| 431 |
+
if (thumb.dataset.tab === tabNumber) {
|
| 432 |
+
thumb.style.display = 'block';
|
| 433 |
+
} else {
|
| 434 |
+
thumb.style.display = 'none';
|
| 435 |
+
}
|
| 436 |
+
});
|
| 437 |
}
|
|
|
|
|
|
|
| 438 |
|
| 439 |
+
document.querySelectorAll('.tab-button').forEach(button => {
|
| 440 |
+
button.addEventListener('click', () => {
|
| 441 |
+
document.querySelectorAll('.tab-button').forEach(btn =>
|
| 442 |
+
btn.classList.remove('active'));
|
| 443 |
+
button.classList.add('active');
|
| 444 |
+
showTabContent(button.dataset.tab);
|
| 445 |
+
});
|
| 446 |
+
});
|
|
|
|
| 447 |
|
| 448 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 449 |
+
initializeGallery();
|
| 450 |
+
});
|
| 451 |
</script>
|
| 452 |
</body>
|
| 453 |
+
</html>
|
| 454 |
+
|
| 455 |
+
|
| 456 |
+
|