diff --git a/app/src/app/globals.css b/app/src/app/globals.css index e8bbd29..6954860 100644 --- a/app/src/app/globals.css +++ b/app/src/app/globals.css @@ -185,4 +185,54 @@ .border-brand-orange { border-color: var(--brand-orange); } + + /* Masonry scroll animations - namespaced to avoid conflicts */ + @keyframes atw-scroll-up { + 0% { + transform: translateY(0); + } + 100% { + transform: translateY(-50%); + } + } + + .animate-scroll-slow { + animation: atw-scroll-up 80s linear infinite; + will-change: transform; + backface-visibility: hidden; + } + + .animate-scroll-medium { + animation: atw-scroll-up 70s linear infinite; + will-change: transform; + backface-visibility: hidden; + } + + .animate-scroll-fast { + animation: atw-scroll-up 60s linear infinite; + will-change: transform; + backface-visibility: hidden; + } + + .animate-scroll-slower { + animation: atw-scroll-up 90s linear infinite; + will-change: transform; + backface-visibility: hidden; + } + + .animate-scroll-faster { + animation: atw-scroll-up 50s linear infinite; + will-change: transform; + backface-visibility: hidden; + } + + @media (prefers-reduced-motion: reduce) { + .animate-scroll-slow, + .animate-scroll-medium, + .animate-scroll-fast, + .animate-scroll-slower, + .animate-scroll-faster { + animation: none; + } + } } diff --git a/app/src/app/page.tsx b/app/src/app/page.tsx index dc7b150..8296b91 100644 --- a/app/src/app/page.tsx +++ b/app/src/app/page.tsx @@ -250,41 +250,215 @@ export default async function HomePage() { ); } +// Track if we've already warned about missing dimensions +let missingDimensionsWarned = false; + +// Helper function to safely calculate aspect ratio +function safeAspectRatio( + width: number | null | undefined, + height: number | null | undefined, + fallback = "1/1" +): string { + if (width && height && width > 0 && height > 0) { + return `${width}/${height}`; + } + + if (!missingDimensionsWarned) { + console.warn("Missing or invalid image dimensions detected, using fallback aspect ratio"); + missingDimensionsWarned = true; + } + + return fallback; +} + function LandingHero({ images }: { images: Image[] }) { + // Distribute images across columns for masonry effect + const distributeImagesAcrossColumns = (images: Image[], columnCount: number) => { + const columns: Image[][] = Array.from({ length: columnCount }, () => []); + + images.forEach((image, index) => { + const columnIndex = index % columnCount; + columns[columnIndex].push(image); + }); + + return columns; + }; + + // Create different column counts for different screen sizes + // We'll use CSS to show/hide columns based on screen size + const desktopColumns = distributeImagesAcrossColumns(images, 4); + const tabletColumns = distributeImagesAcrossColumns(images, 3); + const mobileColumns = distributeImagesAcrossColumns(images, 2); + + // Animation speed classes for each column + const animationSpeeds = [ + 'animate-scroll-slow', + 'animate-scroll-medium', + 'animate-scroll-fast', + 'animate-scroll-slower' + ]; + return ( -
-
- {images.map((image, index) => ( -
- -
- ))} -
+
+ {/* Desktop Layout - 4 columns */} + - {/* Content */} -
-

- All Things Web 🚀 -

-

- Discover exciting web development events in the Bay Area and San - Francisco. Join us for hackathons, hangouts, and meetups to connect - with fellow developers and web enthusiasts. -

-
-
+ {/* Tablet Layout - 3 columns */} + + + {/* Mobile Layout - 2 columns */} + + + {/* Content Overlay */} +
+

+ All Things Web 🚀 +

+

+ Discover exciting web development events in the Bay Area and San + Francisco. Join us for hackathons, hangouts, and meetups to connect + with fellow developers and web enthusiasts. +

+
+
); }