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

Add fireworks particles on click to the pricing page #512

Closed
wants to merge 4 commits into from
Closed
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"react-window-ui": "^2.2.0",
"tsparticles": "^1.37.3",
"tsparticles-preset-confetti": "^1.0.0",
"tsparticles-preset-fireworks": "^1.0.0",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
},
Expand Down
16 changes: 16 additions & 0 deletions src/components/FireworksParticles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React, { useEffect } from 'react';

Check warning on line 1 in src/components/FireworksParticles.tsx

View workflow job for this annotation

GitHub Actions / build

'React' is defined but never used

Check warning on line 1 in src/components/FireworksParticles.tsx

View workflow job for this annotation

GitHub Actions / build

'React' is defined but never used
import { tsParticles } from 'tsparticles';
import { loadFireworksPreset } from 'tsparticles-preset-fireworks';

const FireworksParticles = () => {
useEffect(() => {
loadFireworksPreset(tsParticles);
tsParticles.load('pricing-page', {
preset: 'fireworks',
});
}, []);

return null;
};

export default FireworksParticles;
5 changes: 4 additions & 1 deletion src/components/PricingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { Text, SimpleGrid, Box, Button } from '@chakra-ui/react';
import { tsParticles } from 'tsparticles';
import FireworksParticles from './FireworksParticles';

const PricingPage = () => {
return (
<Box p={8} backgroundColor="#0d1117" pb={4}>
<Box p={8} backgroundColor="#0d1117" pb={4} id="pricing-page" onClick={() => tsParticles.load('pricing-page', { preset: 'fireworks' })}>
<FireworksParticles />
<SimpleGrid columns={{ base: 1, md: 4 }} spacing={10}>
<Box
display="flex"
Expand Down
Loading