This commit is contained in:
IM23a-spirgif
2025-06-02 22:46:12 +02:00
parent fb4f318e1f
commit 350438a609
3 changed files with 54 additions and 8 deletions
+13 -6
View File
@@ -82,9 +82,11 @@ export default function About() {
setCurrentSection(0); setCurrentSection(0);
setTimelineFinished(false); setTimelineFinished(false);
setTimeout(() => { setTimeout(() => {
sectionRefs.current[0]?.scrollIntoView({behavior: "auto", inline: "start"});
window.scrollTo({top: 0, behavior: "smooth"}); window.scrollTo({top: 0, behavior: "smooth"});
}, 100); }, 100);
}, []); }, []);
useEffect(() => { useEffect(() => {
let scrollListener; let scrollListener;
@@ -105,13 +107,18 @@ export default function About() {
} }
}; };
}, [timelineFinished]); }, [timelineFinished]);
const [isNavigating, setIsNavigating] = useState(false);
const handleButtonClick = (direction) => { const handleButtonClick = (direction) => {
if (isNavigating) return;
setIsNavigating(true);
setCurrentSection((prev) => { setCurrentSection((prev) => {
const newSection = Math.max(0, Math.min(prev + direction, timelineData.length - 1)); const newSection = Math.max(0, Math.min(prev + direction, timelineData.length - 1));
setTimelineFinished(newSection === timelineData.length - 1);
sectionRefs.current[newSection]?.scrollIntoView({behavior: "smooth", inline: "start"}); sectionRefs.current[newSection]?.scrollIntoView({behavior: "smooth", inline: "start"});
return newSection; return newSection;
}); });
setTimeout(() => {
setIsNavigating(false);
}, 600);
}; };
useEffect(() => { useEffect(() => {
const observer = new IntersectionObserver( const observer = new IntersectionObserver(
@@ -121,13 +128,10 @@ export default function About() {
if (entry.isIntersecting && index !== -1) { if (entry.isIntersecting && index !== -1) {
setCurrentSection(index); setCurrentSection(index);
} }
if ( if (entry.isIntersecting && index === timelineData.length - 1) {
entry.isIntersecting &&
index === timelineData.length - 1 &&
entry.intersectionRatio >= 0.8
) {
setTimelineFinished(true); setTimelineFinished(true);
} }
}); });
}, },
{threshold: 0.6} {threshold: 0.6}
@@ -137,6 +141,9 @@ export default function About() {
}); });
return () => observer.disconnect(); return () => observer.disconnect();
}, [timelineData.length]); }, [timelineData.length]);
useEffect(() => {
setTimelineFinished(currentSection === timelineData.length - 1);
}, [currentSection, timelineData.length]);
return ( return (
// Ändern Sie den äußeren Container-Style // Ändern Sie den äußeren Container-Style
<div style={{ <div style={{
+41
View File
@@ -235,11 +235,13 @@ body {
.projectCard { .projectCard {
max-width: 800px; max-width: 800px;
width: 100%;
padding: 2rem; padding: 2rem;
border-radius: 10px; border-radius: 10px;
border: 2px solid #3d003d; border: 2px solid #3d003d;
background-color: rgba(20, 0, 20, 0.4); background-color: rgba(20, 0, 20, 0.4);
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
box-sizing: border-box;
} }
.projectImage { .projectImage {
@@ -247,6 +249,9 @@ body {
margin: 1.5rem 0; margin: 1.5rem 0;
border: 4px solid #3d003d; border: 4px solid #3d003d;
animation: pulseBorder 1.5s infinite alternate ease-in-out; animation: pulseBorder 1.5s infinite alternate ease-in-out;
max-width: 100%;
height: auto;
object-fit: contain;
} }
.projectNavigation { .projectNavigation {
@@ -480,3 +485,39 @@ main {
} }
} }
@media (max-width: 768px) {
.projectCard {
padding: 1.5rem 1rem;
}
.projectImage {
width: 100%;
height: auto;
}
.projectTitle {
font-size: 1.5rem;
}
.projectDescription {
font-size: 1rem;
}
.learnMoreButton {
font-size: 1rem;
padding: 0.75rem 1.5rem;
}
.arrowButton {
padding: 0.5rem 1rem;
font-size: 1.25rem;
}
.projectNavigation {
flex-direction: row;
gap: 1rem;
justify-content: center;
margin-top: 1.5rem;
}
}
-2
View File
@@ -16,11 +16,9 @@ export default function Home() {
fadeTimeout = setTimeout(() => { fadeTimeout = setTimeout(() => {
setTitle(prev => prev === "Fretux" ? "Frederik Spirgi" : "Fretux"); setTitle(prev => prev === "Fretux" ? "Frederik Spirgi" : "Fretux");
setPhase("fadeIn"); setPhase("fadeIn");
fadeTimeout = setTimeout(() => setPhase("normal"), 500); fadeTimeout = setTimeout(() => setPhase("normal"), 500);
}, 500); }, 500);
}, 3000); }, 3000);
return () => { return () => {
clearInterval(interval); clearInterval(interval);
clearTimeout(fadeTimeout); clearTimeout(fadeTimeout);