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

feat: make hero fancy #187

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 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
6 changes: 3 additions & 3 deletions lumium-renderer/js/download.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function download(filename, text) {
var element = document.createElement('a');
export const download = (filename, text) => {
const element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);

Expand All @@ -9,4 +9,4 @@ export function download(filename, text) {
element.click();

document.body.removeChild(element);
}
}
2 changes: 2 additions & 0 deletions lumium-space/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@
"react-mt-svg-lines": "^0.9.1",
"react-query": "^3.39.1",
"react-redux": "^7.2.8",
"react-tsparticles": "^2.6.0",
"supertokens-auth-react": "^0.22.3",
"supertokens-node": "^9.2.3",
"swr": "^0.4.2",
"ts-jest": "^29.0.2",
"tsparticles": "^2.6.0",
"uuid": "^9.0.0"
},
"devDependencies": {
Expand Down
100 changes: 99 additions & 1 deletion lumium-space/src/sections/landing/CallToAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,107 @@ import {
Icon,
IconProps,
} from '@chakra-ui/react';
import { useCallback } from 'react';
import Particles from "react-tsparticles";
import { loadFull } from "tsparticles";

export function CallToAction() {
const particlesInit = useCallback(async engine => {
console.log(engine);
// you can initiate the tsParticles instance (engine) here, adding custom shapes or presets
// this loads the tsparticles package bundle, it's the easiest method for getting everything ready
// starting from v2 you can add only the features you need reducing the bundle size
await loadFull(engine);
}, []);

const particlesLoaded = useCallback(async container => {
await console.log(container);
}, []);

return (
<Container maxW={'5xl'}>
<>
<Particles
id="tsparticles"
init={particlesInit}
loaded={particlesLoaded}
options={{
background: {
opacity: 0,
color: {
value: "#1f1f1f",
},
},
fullScreen: {
enable: false
},
fpsLimit: 120,
interactivity: {
events: {
onClick: {
enable: false,
mode: "push",
},
onHover: {
enable: false,
mode: "repulse",
},
resize: false,
},
modes: {
push: {
quantity: 4,
},
repulse: {
distance: 200,
duration: 0.4,
},
},
},
particles: {
color: {
value: "#ffffff",
},
links: {
color: "#ffffff",
distance: 150,
enable: false,
opacity: 0.5,
width: 1,
},
collisions: {
enable: true,
},
move: {
direction: "none",
enable: true,
outModes: {
default: "bounce",
},
random: false,
speed: 1,
straight: false,
},
number: {
density: {
enable: true,
area: 800,
},
value: 80,
},
opacity: {
value: 0.5,
},
shape: {
type: "circle",
},
size: {
value: { min: 1, max: 5 },
},
},
detectRetina: true,
}}
/>
<Container maxW={'5xl'} h={'100vh'}>
<Stack
textAlign={'center'}
align={'center'}
Expand Down Expand Up @@ -52,6 +149,7 @@ export function CallToAction() {
</Flex>
</Stack>
</Container>
</>
);
}

Expand Down
13 changes: 13 additions & 0 deletions lumium-space/src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,17 @@ body {

body::-webkit-scrollbar {
display: none;
}


/* TODO: Use Tailwind */
#tsparticles {
z-index: -1;
position: absolute;
width: 100%;
height: 100vh;
margin: 0;
padding: 0;
top: 0;
left: 0;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
"resolutions": {
"@types/react": "17.0.15"
}
}
}
Loading