Skip to content

Commit

Permalink
Merge pull request #32 from fossnsbm/18-event-details-section
Browse files Browse the repository at this point in the history
feat: Event details section #18
  • Loading branch information
Rizz-33 authored May 9, 2024
2 parents 5e3db41 + d729a08 commit 1a3d367
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 0 deletions.
Binary file added public/assets/coin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/eventDetails.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import EventDetails from "@/components/landing/eventDetails";
import HeroSection from "@/components/landing/hero";

export default function Home() {
return (
<div>
<HeroSection />
<EventDetails />
</div>
);
}
75 changes: 75 additions & 0 deletions src/components/landing/eventDetails.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
'use client';
import Image from 'next/image';
import { useEffect, useState } from 'react';
import CoinsRow from '../ui/coins-line';
import EventDetailsMarquee from '../ui/marquee';

export default function EventDetails() {
const [isSmallScreen, setIsSmallScreen] = useState(false);

useEffect(() => {
const handleResize = () => {
setIsSmallScreen(window.innerWidth < 1200);
};

handleResize();

window.addEventListener('resize', handleResize);

return () => {
window.removeEventListener('resize', handleResize);
};
}, []);

const coinCenterCount = isSmallScreen ? 3 : 5;
const coinSideCount = isSmallScreen ? 3 : 6;

// Set image dimensions based on screen size
const imageWidth = isSmallScreen ? 200 : 350;
const imageHeight = isSmallScreen ? 250 : 400;

return (
<div className="w-full min-h-full bg-slate-900 relative flex flex-col items-center pt-16 pb-16">
<EventDetailsMarquee />
<div className="w-full flex flex-col md:flex-row justify-center items-center pt-36 px-2">
<div className="flex flex-col items-center md:items-start gap-8 pr-12 pl-12">
<Image
alt="eventDetails"
src="/assets/eventDetails.png"
width={imageWidth}
height={imageHeight}
/>
</div>
<div className="flex flex-col gap-6 items-center md:items-start pr-12 pl-12">
<h1 className="text-8xl leading-none text-center md:text-left">
<span className="text-white">WHAT IS</span>
<span className="block -mt-6 text-amber-400">Techie Sleuths?</span>
</h1>
<p
className="text-lg text-white font-mono leading-loose text-center md:text-left"
style={{
textShadow: '0 0 12px rgba(255, 255, 255, 0.49)',
letterSpacing: '3px',
}}
>
Lorem ipsum dolor sit amet, consectetur{' '}
<span className="text-amber-400">adipiscing</span>
<br />
elit. Nunc vulputate libero et velit interdum, ac
<br />
aliquet odio mattis. <span className="text-amber-400">Class</span> aptent taciti sociosqu
<br />
ad litora torquent per conubia nostr!
</p>
<p className="text-3xl text-white cursor-pointer flex items-center text-center md:text-left">
View past events{' '}
<span className="ml-2">{'>'}</span>
</p>
</div>
</div>
<div className="pt-36 justify-center">
<CoinsRow centerCount={coinCenterCount} sideCount={coinSideCount} />
</div>
</div>
);
}
45 changes: 45 additions & 0 deletions src/components/ui/coins-line.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
'use client'
import React from 'react';

interface CoinsRowProps {
centerCount: number;
sideCount: number;
}

const CoinsRow: React.FC<CoinsRowProps> = ({ centerCount, sideCount }) => {
const totalImages = centerCount + 2 * sideCount;

const images = Array(totalImages).fill({ src: "/assets/coin.png", alt: "Coin" });

const centerStartIndex = sideCount;
const centerEndIndex = centerStartIndex + centerCount;

return (
<div style={{ display: 'flex', justifyContent: 'center' }}>
{images.map((image, index) => {
let opacity = 0;

if (index >= centerStartIndex && index < centerEndIndex) {
opacity = 1;
} else if (index < centerStartIndex) {
const distanceFromCenter = centerStartIndex - index;
opacity = 1 - distanceFromCenter * (1 / sideCount);
} else {
const distanceFromCenter = index - centerEndIndex;
opacity = 1 - distanceFromCenter * (1 / sideCount);
}

return (
<img
key={index}
src={image.src}
alt={image.alt}
style={{ opacity, transition: 'opacity 0.5s' }}
/>
);
})}
</div>
);
};

export default CoinsRow;
27 changes: 27 additions & 0 deletions src/components/ui/marquee.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use client'
import Image from "next/image";
import Marquee from "react-fast-marquee";

export default function EventDetailsMarquee() {
const count = 2;
return (
<Marquee className="h-[8vh] overflow-hidden">
{Array.from({ length: count }).map((_, index) => (
<div key={index} className="flex flex-row items-center gap-4 opacity-25">
<h1
className="text-sky-50 text-9xl"
style={{
textShadow:
"4px 4px 0 #000, -4px -4px 0 #000, 4px -4px 0 #000, -4px 4px 0 #000",
}}
>
COMING SOON
</h1>
<div className="flex justify-center items-center">
<Image alt="mush" src="/assets/mush.png" width={100} height={50} />
</div>
</div>
))}
</Marquee>
);
}

0 comments on commit 1a3d367

Please sign in to comment.