Fix image blink: remove duplicate hero-image CSS, remove stray </main>, add fade-in-section to sections

This commit is contained in:
Kato
2026-09-05 12:56:50 +00:00
parent ef0d9aac55
commit 489624699e
3 changed files with 53 additions and 20 deletions
+21 -13
View File
@@ -72,7 +72,8 @@
} }
/* Scroll reveal visible state */ /* Scroll reveal visible state */
.fade-in-section.visible { .fade-in-section.visible,
.section.visible {
opacity: 1 !important; opacity: 1 !important;
transform: translateY(0) !important; transform: translateY(0) !important;
} }
@@ -124,17 +125,6 @@ body {
IMAGE STYLES IMAGE STYLES
======================================== */ ======================================== */
/* Hero background image */
.hero-image {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
object-fit: cover;
width: 100%;
height: 100%;
z-index: 0;
filter: brightness(0.45) saturate(1.1);
}
.hero-content { position: relative; z-index: 1; } .hero-content { position: relative; z-index: 1; }
/* About card images */ /* About card images */
@@ -144,8 +134,9 @@ body {
object-fit: cover; object-fit: cover;
border-radius: 8px 8px 0 0; border-radius: 8px 8px 0 0;
margin: -20px -20px 16px -20px; margin: -20px -20px 16px -20px;
transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease; transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease, opacity 0.6s ease;
filter: saturate(0.85); filter: saturate(0.85);
opacity: 1;
} }
.about-card:hover .about-image { .about-card:hover .about-image {
transform: scale(1.03); transform: scale(1.03);
@@ -349,6 +340,7 @@ body {
HERO — Focal Motion HERO — Focal Motion
======================================== */ ======================================== */
.hero { .hero {
min-height: 500px;
background: linear-gradient(135deg, #1877f2 0%, #42b0ff 40%, #1877f2 70%, #0d5fc9 100%); background: linear-gradient(135deg, #1877f2 0%, #42b0ff 40%, #1877f2 70%, #0d5fc9 100%);
background-size: 300% 300%; background-size: 300% 300%;
animation: heroGradientShift 12s ease infinite; animation: heroGradientShift 12s ease infinite;
@@ -359,6 +351,22 @@ body {
overflow: hidden; overflow: hidden;
} }
/* Hero image loading state — prevents blink */
.hero-image {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
object-fit: cover;
width: 100%;
height: 100%;
z-index: 0;
filter: brightness(0.45) saturate(1.1);
opacity: 0;
transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-image.loaded {
opacity: 1;
}
/* Subtle mesh pattern overlay — sits above image, below content */ /* Subtle mesh pattern overlay — sits above image, below content */
.hero::before { .hero::before {
content: ''; content: '';
+7 -7
View File
@@ -288,11 +288,8 @@
</div> </div>
</div> </div>
<!-- Main Content (logged-in) --> <!-- About Section (always visible) -->
<main class="main-content" id="main-content"> <section class="section fade-in-section" id="about">
<!-- About Section -->
<section class="section" id="about">
<div class="container"> <div class="container">
<h2 class="section-title"> <h2 class="section-title">
<span class="hide-de">Über die Community</span> <span class="hide-de">Über die Community</span>
@@ -347,8 +344,11 @@
</div> </div>
</section> </section>
<!-- Main Content (logged-in) -- Members, Wiki, Newsletter -->
<main class="main-content" id="main-content">
<!-- Members Section --> <!-- Members Section -->
<section class="section section-alt" id="members"> <section class="section section-alt fade-in-section" id="members">
<div class="container"> <div class="container">
<h2 class="section-title"> <h2 class="section-title">
<span class="hide-de">Mitglieder</span> <span class="hide-de">Mitglieder</span>
@@ -368,7 +368,7 @@
</section> </section>
<!-- Wiki Section --> <!-- Wiki Section -->
<section class="section" id="wiki"> <section class="section fade-in-section" id="wiki">
<div class="container"> <div class="container">
<h2 class="section-title"> <h2 class="section-title">
<span class="hide-de">Wiki</span> <span class="hide-de">Wiki</span>
+25
View File
@@ -107,8 +107,33 @@ document.addEventListener('DOMContentLoaded', () => {
// Ripple effect on buttons // Ripple effect on buttons
initRippleEffects(); initRippleEffects();
// Fade in hero image (prevents blink)
initHeroImageFade();
}); });
// ========================================
// HERO IMAGE FADE IN — prevents blink
// ========================================
function initHeroImageFade() {
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
const heroImage = document.querySelector('.hero-image');
if (!heroImage) return;
if (prefersReducedMotion) {
heroImage.classList.add('loaded');
return;
}
if (heroImage.complete && heroImage.naturalHeight > 0) {
requestAnimationFrame(() => heroImage.classList.add('loaded'));
return;
}
heroImage.addEventListener('load', () => requestAnimationFrame(() => heroImage.classList.add('loaded')), { once: true });
heroImage.addEventListener('error', () => requestAnimationFrame(() => heroImage.classList.add('loaded')), { once: true });
}
// ======================================== // ========================================
// SCROLL REVEAL (Intersection Observer) // SCROLL REVEAL (Intersection Observer)
// ======================================== // ========================================