-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed ovelapping issues with modals and the navbar. Fixed trailing pi…
…xel in graph. Landing page advances
- Loading branch information
1 parent
eed90a7
commit 5601a02
Showing
28 changed files
with
301 additions
and
48 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import React, { useRef, useMemo } from 'react'; | ||
import { useFrame } from '@react-three/fiber'; | ||
import distinctColors from "distinct-colors"; | ||
import * as THREE from 'three'; | ||
|
||
const palette = distinctColors({ | ||
count: 50, // Adjust as needed | ||
chromaMin: 15, | ||
chromaMax: 95, | ||
lightMin: 65, | ||
lightMax: 90, | ||
}); | ||
|
||
const Particle = ({ zPosition = -5, mouse }) => { | ||
const mesh = useRef(); | ||
const opacityRef = useRef(1.0); | ||
const randomColor = new THREE.Color().setRGB( | ||
palette[Math.floor(Math.random() * palette.length)][0] / 255, | ||
palette[Math.floor(Math.random() * palette.length)][1] / 255, | ||
palette[Math.floor(Math.random() * palette.length)][2] / 255 | ||
); | ||
|
||
const [position, velocity] = useMemo(() => { | ||
// Random position and velocity | ||
const pos = new THREE.Vector3( | ||
(Math.random() - 0.5) * 10, | ||
(Math.random() - 0.5) * 10, | ||
zPosition | ||
); | ||
const vel = new THREE.Vector3((Math.random() - 0.5) * 0.02, (Math.random() - 0.5) * 0.02, (Math.random() - 0.5) * 0.02); | ||
return [pos, vel]; | ||
}, []); | ||
|
||
useFrame(() => { | ||
// Random movement | ||
mesh.current.position.add(velocity); | ||
|
||
// Calculate direction to mouse | ||
const dirToMouse = new THREE.Vector3().subVectors(position, new THREE.Vector3(mouse.current[0], mouse.current[1], zPosition)); | ||
|
||
// Apply avoidance behavior based on mouse proximity | ||
if (dirToMouse.length() < 1.5) { | ||
dirToMouse.normalize(); | ||
velocity.sub(dirToMouse.multiplyScalar(0.03)); | ||
} | ||
|
||
// Fade away when out of view | ||
if (mesh.current.position.length() > 5) { | ||
opacityRef.current -= 0.005; | ||
if (opacityRef.current > 0) { | ||
mesh.current.material.opacity = opacityRef.current; | ||
} else { | ||
mesh.current.visible = false; // Hide the particle when opacity reaches 0 | ||
} | ||
} | ||
}); | ||
|
||
// Inside the Particle component | ||
return ( | ||
<mesh ref={mesh} position={position} renderOrder={1}> | ||
<sphereGeometry attach="geometry" args={[0.1, 16, 16]} /> | ||
<meshStandardMaterial attach="material" color={randomColor} emissive="black" emissiveIntensity={0.2} transparent opacity={opacityRef.current} /> | ||
</mesh> | ||
); | ||
} | ||
|
||
export default Particle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React, { useRef, useState, useEffect } from 'react'; | ||
import { useThree } from '@react-three/fiber'; | ||
import RotatingBox from './rotatingBox'; | ||
import Particle from './particle'; | ||
|
||
const Scene = () => { | ||
const { viewport } = useThree(); | ||
const mouse = useRef([0, 0]); | ||
const numParticles = 50; // Adjust the number of particles here | ||
|
||
const handleMouseMove = (event) => { | ||
mouse.current = [event.clientX / viewport.width * 2 - 1, -event.clientY / viewport.height * 2 + 1]; | ||
}; | ||
|
||
useEffect(() => { | ||
window.addEventListener('mousemove', handleMouseMove); | ||
return () => { | ||
window.removeEventListener('mousemove', handleMouseMove); | ||
}; | ||
}, [viewport]); | ||
|
||
return ( | ||
<> | ||
{ | ||
/* | ||
Array.from({ length: numParticles }, (_, i) => ( | ||
<Particle key={i} mouse={mouse} /> | ||
)) | ||
*/ | ||
} | ||
<group> | ||
<RotatingBox position={[-3, 0, 0]} rotationSpeed={0.01} size={[1.5, 1.5, 1.5]} /> | ||
<RotatingBox position={[-1.5, 0, 0]} rotationSpeed={0.015} size={[1.75, 1.75, 1.75]} /> | ||
<RotatingBox position={[0, 0, 0]} rotationSpeed={0.02} /> | ||
<RotatingBox position={[1.5, 0, 0]} rotationSpeed={0.015} size={[1.75, 1.75, 1.75]} /> | ||
<RotatingBox position={[3, 0, 0]} rotationSpeed={0.01} size={[1.5, 1.5, 1.5]} /> | ||
</group> | ||
</> | ||
); | ||
} | ||
|
||
export default Scene; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
|
||
const LandingDownloadLink = ({ fileName, label }) => { | ||
const fileUrl = `${process.env.PUBLIC_URL}/useCases/${fileName}`; | ||
|
||
return ( | ||
<a href={fileUrl} download> | ||
{label} | ||
</a> | ||
); | ||
} | ||
|
||
export default LandingDownloadLink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ | |
width: 7px; | ||
right: 0; | ||
top: 0; | ||
z-index: 10; | ||
z-index: 2; | ||
border-right: 2px solid transparent; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.