히어로 수정

썸네일 적용
This commit is contained in:
CSKIM
2026-05-07 01:55:51 +09:00
parent 694e6b9f5c
commit f509ed4d48
29 changed files with 49 additions and 8 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

+49 -8
View File
@@ -95,7 +95,7 @@
align-items: stretch; align-items: stretch;
justify-content: center; justify-content: center;
padding: 0; padding: 0;
background: #d8cbc4; background: #f7f7f7;
overflow: hidden; overflow: hidden;
margin-left: -215px; margin-left: -215px;
transition: transition:
@@ -115,7 +115,7 @@
.hero-spacer { .hero-spacer {
height: 100vh; height: 100vh;
height: 100svh; height: 100svh;
background: #d8cbc4; background: #f7f7f7;
transition: height 420ms cubic-bezier(.2, .8, .2, 1); transition: height 420ms cubic-bezier(.2, .8, .2, 1);
} }
@@ -128,7 +128,7 @@
height: 100%; height: 100%;
display: block; display: block;
object-fit: contain; object-fit: contain;
background: #d8cbc4; background: #f7f7f7;
image-rendering: auto; image-rendering: auto;
} }
@@ -743,7 +743,7 @@
<body> <body>
<main class="shell"> <main class="shell">
<header class="hero" data-aos="hero-cover" data-aos-duration="680" data-aos-once="true"> <header class="hero" data-aos="hero-cover" data-aos-duration="680" data-aos-once="true">
<img class="main-invitation" src="./images/hero.jpg" alt="김도아 돌잔치 초대장"> <img class="main-invitation" src="./images/thumbs/hero.jpg" alt="김도아 돌잔치 초대장" fetchpriority="high">
<!-- <a class="scroll-cue" href="#intro">스크롤<span></span></a> --> <!-- <a class="scroll-cue" href="#intro">스크롤<span></span></a> -->
</header> </header>
<div class="hero-spacer" aria-hidden="true"></div> <div class="hero-spacer" aria-hidden="true"></div>
@@ -937,6 +937,18 @@
img.src = DATA.images[img.dataset.img]; img.src = DATA.images[img.dataset.img];
}); });
const toThumbnailPath = (image) => {
if (image.startsWith("./images/")) {
return image.replace("./images/", "./images/thumbs/");
}
if (image.startsWith("/images/")) {
return image.replace("/images/", "/images/thumbs/");
}
return image;
};
const openRouteLink = (event) => { const openRouteLink = (event) => {
const route = DATA.links[event.currentTarget.dataset.link]; const route = DATA.links[event.currentTarget.dataset.link];
const isMobile = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent); const isMobile = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
@@ -1082,7 +1094,7 @@
document.querySelector("#timeline").innerHTML = DATA.timeline.map(([date, text, image]) => ` document.querySelector("#timeline").innerHTML = DATA.timeline.map(([date, text, image]) => `
<article class="milestone"> <article class="milestone">
<div class="milestone-visual"> <div class="milestone-visual">
<img src="${image}" alt=""> <img src="${toThumbnailPath(image)}" data-full="${image}" alt="" loading="lazy" decoding="async">
</div> </div>
<div class="milestone-copy"> <div class="milestone-copy">
<time>${date}</time> <time>${date}</time>
@@ -1104,7 +1116,7 @@
galleryGridSlides.innerHTML = galleryGroups.map((group) => ` galleryGridSlides.innerHTML = galleryGroups.map((group) => `
<div class="swiper-slide"> <div class="swiper-slide">
<div class="gallery-grid"> <div class="gallery-grid">
${group.map((image) => `<img src="${image}" alt="">`).join("")} ${group.map((image) => `<img src="${toThumbnailPath(image)}" data-full="${image}" alt="" loading="lazy" decoding="async">`).join("")}
</div> </div>
</div> </div>
`).join(""); `).join("");
@@ -1155,7 +1167,7 @@
}; };
document.querySelectorAll(".milestone img, .gallery-grid img, .slider .swiper-slide img").forEach((image) => { document.querySelectorAll(".milestone img, .gallery-grid img, .slider .swiper-slide img").forEach((image) => {
image.addEventListener("click", () => openLightbox(image.currentSrc || image.src, image.alt)); image.addEventListener("click", () => openLightbox(image.dataset.full || image.currentSrc || image.src, image.alt));
}); });
closeButton.addEventListener("click", closeLightbox); closeButton.addEventListener("click", closeLightbox);
@@ -1232,6 +1244,7 @@
const heroSpacer = document.querySelector(".hero-spacer"); const heroSpacer = document.querySelector(".hero-spacer");
let touchStartY = 0; let touchStartY = 0;
let isDismissed = false; let isDismissed = false;
let isRestoringHero = false;
if (!hero) { if (!hero) {
return; return;
@@ -1242,8 +1255,28 @@
hero.classList.remove("is-dismissed"); hero.classList.remove("is-dismissed");
heroSpacer?.classList.remove("is-collapsed"); heroSpacer?.classList.remove("is-collapsed");
const showHero = () => {
if (!isDismissed || isRestoringHero) {
return;
}
isRestoringHero = true;
isDismissed = false;
window.scrollTo({ top: 0, behavior: "auto" });
heroSpacer?.classList.remove("is-collapsed");
hero.classList.add("aos-init", "aos-animate");
hero.classList.remove("is-dismissed");
window.setTimeout(() => {
isRestoringHero = false;
if (window.AOS) {
AOS.refreshHard();
}
}, 460);
};
const dismissHero = () => { const dismissHero = () => {
if (isDismissed) { if (isDismissed || isRestoringHero) {
return; return;
} }
@@ -1291,6 +1324,14 @@
event.preventDefault(); event.preventDefault();
dismissHero(); dismissHero();
}); });
window.addEventListener("scroll", () => {
if (!isDismissed || window.scrollY > 1) {
return;
}
showHero();
}, { passive: true });
}; };
if (document.readyState === "complete") { if (document.readyState === "complete") {