Skip to content

Commit

Permalink
Add sponsors rain
Browse files Browse the repository at this point in the history
  • Loading branch information
Domin0de committed Oct 18, 2024
1 parent a192064 commit fc7af3a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
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
22 changes: 20 additions & 2 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,27 @@ 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>
<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 +56,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 Down

0 comments on commit fc7af3a

Please sign in to comment.