Skip to content

Commit fc7af3a

Browse files
committed
Add sponsors rain
1 parent a192064 commit fc7af3a

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

Diff for: frontend/package-lock.json

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: frontend/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"eslint-config-next": "13.4.19",
2323
"framer-motion": "^11.2.13",
2424
"next": "13.4.12",
25+
"next-emoji-rain": "^1.0.2",
2526
"postcss": "8.4.29",
2627
"react": "18.2.0",
2728
"react-dom": "18.2.0",

Diff for: frontend/src/pages/_app.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import '@/styles/globals.css';
22
import type { AppProps } from 'next/app';
3+
import 'next-emoji-rain/dist/index.css';
34

45
export default function App({ Component, pageProps }: AppProps) {
56
return <Component {...pageProps} />;

Diff for: frontend/src/pages/sponsors.tsx

+20-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Layout from '@/components/Layout';
22
import { useState } from 'react';
33
import { diamondLinks, goldLinks, silverLinks, sponsorInfo } from '@/../public/data/sponsorInfos';
44
import SponsorModal from '@/components/Sponsors/SponsorModal';
5+
import { EmojiRain } from 'next-emoji-rain';
56

67
export default function SponsorsPage() {
78
const logostyle =
@@ -15,10 +16,27 @@ export default function SponsorsPage() {
1516
setShowModal(true);
1617
};
1718

19+
const handleRainClick = (type: string) => {
20+
const rainElement = document.getElementById(`${type}Rain`);
21+
22+
if (!rainElement) return;
23+
24+
rainElement.classList.toggle('opacity-0', false);
25+
setTimeout(() => {
26+
rainElement.classList.toggle('opacity-0', true);
27+
}, 4000);
28+
};
29+
1830
return (
1931
<Layout>
32+
<div id="diamondRain" className="opacity-0">
33+
<EmojiRain emoji="💎" />
34+
</div>
35+
<div id="goldRain" className="opacity-0">
36+
<EmojiRain emoji="🪙" />
37+
</div>
2038
<section className="py-8">
21-
<h2 className="text-4xl font-black text-center font-bold">DIAMOND SPONSORS</h2>
39+
<h2 className="text-4xl font-black text-center font-bold" onClick={() => handleRainClick('diamond')}>DIAMOND SPONSORS</h2>
2240
<div>
2341
<div className="w-100 flex flex-col gap-16">
2442
{showModal && (
@@ -38,7 +56,7 @@ export default function SponsorsPage() {
3856
</div>
3957
</div>
4058
</div>
41-
<h2 className="text-4xl font-black text-center font-bold">GOLD SPONSORS</h2>
59+
<h2 className="text-4xl font-black text-center font-bold" onClick={() => handleRainClick('gold')}>GOLD SPONSORS</h2>
4260
<div>
4361
<div className="flex flex-wrap rounded-[1rem] px-14 py-10 mb-14 gap-16 justify-evenly rounded border-2 border-[#595F6D] my-10">
4462
{goldLinks.map((item, index) => {

0 commit comments

Comments
 (0)