Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CW2-12] Sponsor Rain #39

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"eslint-config-next": "13.4.19",
"framer-motion": "^11.2.13",
"next": "13.4.12",
"next-emoji-rain": "^1.0.2",
"postcss": "8.4.29",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@/styles/globals.css';
import type { AppProps } from 'next/app';
import 'next-emoji-rain/dist/index.css';

export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />;
Expand Down
27 changes: 24 additions & 3 deletions frontend/src/pages/sponsors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Layout from '@/components/Layout';
import { useState } from 'react';
import { diamondLinks, goldLinks, silverLinks, sponsorInfo } from '@/../public/data/sponsorInfos';
import SponsorModal from '@/components/Sponsors/SponsorModal';
import { EmojiRain } from 'next-emoji-rain';

export default function SponsorsPage() {
const logostyle =
Expand All @@ -15,10 +16,30 @@ export default function SponsorsPage() {
setShowModal(true);
};

const handleRainClick = (type: string) => {
const rainElement = document.getElementById(`${type}Rain`);

if (!rainElement) return;

rainElement.classList.toggle('opacity-0', false);
setTimeout(() => {
rainElement.classList.toggle('opacity-0', true);
}, 4000);
};

return (
<Layout>
<div id="diamondRain" className="opacity-0">
<EmojiRain emoji="💎" />
</div>
<div id="goldRain" className="opacity-0">
<EmojiRain emoji="🪙" />
</div>
<div id="silverRain" className="opacity-0">
<EmojiRain emoji="🪩" />
</div>
<section className="py-8">
<h2 className="text-4xl font-black text-center font-bold">DIAMOND SPONSORS</h2>
<h2 className="text-4xl font-black text-center font-bold" onClick={() => handleRainClick('diamond')}>DIAMOND SPONSORS</h2>
<div>
<div className="w-100 flex flex-col gap-16">
{showModal && (
Expand All @@ -38,7 +59,7 @@ export default function SponsorsPage() {
</div>
</div>
</div>
<h2 className="text-4xl font-black text-center font-bold">GOLD SPONSORS</h2>
<h2 className="text-4xl font-black text-center font-bold" onClick={() => handleRainClick('gold')}>GOLD SPONSORS</h2>
<div>
<div className="flex flex-wrap rounded-[1rem] px-14 py-10 mb-14 gap-16 justify-evenly rounded border-2 border-[#595F6D] my-10">
{goldLinks.map((item, index) => {
Expand All @@ -50,7 +71,7 @@ export default function SponsorsPage() {
})}
</div>
</div>
<h2 className="text-4xl font-black text-center font-bold">SILVER SPONSORS</h2>
<h2 className="text-4xl font-black text-center font-bold" onClick={() => handleRainClick('silver')}>SILVER SPONSORS</h2>
<div>
<div className="flex flex-wrap rounded-[1rem] px-14 py-10 mb-14 gap-16 justify-evenly rounded border-2 border-[#595F6D] mt-10">
{silverLinks.map((item, index) => {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/typing/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'next-emoji-rain';
Loading