-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into sujal
- Loading branch information
Showing
13 changed files
with
119 additions
and
240 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,33 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<!-- <link rel="icon" type="image/svg+xml" href="paste your icon here" /> --> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>cosmoXplore</title> | ||
<link | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" | ||
integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" | ||
crossorigin="anonymous" | ||
referrerpolicy="no-referrer" | ||
/> | ||
<link | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
rel="stylesheet" | ||
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" | ||
crossorigin="anonymous" | ||
/> | ||
<script type="module" crossorigin src="/assets/index-D67J1T9l.js"></script> | ||
<link rel="stylesheet" crossorigin href="/assets/index-D8jJgqdT.css"> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<!-- | ||
<script src="./particles.min.js"></script> | ||
<script src="./app.js"></script> --> | ||
|
||
|
||
<!-- scripts --> | ||
</body> | ||
</html> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/assets/A%20letter%20tech%20logo-B_QDrxWF.png" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>cosmoXplore</title> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" | ||
integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" | ||
crossorigin="anonymous" referrerpolicy="no-referrer" /> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" | ||
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous" /> | ||
<script type="module" crossorigin src="/assets/index-DX2hSkQl.js"></script> | ||
<link rel="stylesheet" crossorigin href="/assets/index-CxiSztHf.css"> | ||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
</body> | ||
|
||
</html> | ||
|
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 was deleted.
Oops, something went wrong.
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,63 @@ | ||
import { Canvas, useFrame } from "@react-three/fiber"; | ||
import Styles from "./BackGround.module.css" | ||
import { useRef, useState, useEffect, useCallback } from "react"; | ||
|
||
|
||
function Star({ position }) { | ||
const radius = 0.005; | ||
return ( | ||
<mesh position={position}> | ||
<sphereGeometry args={[radius, 16, 16]} /> | ||
<meshBasicMaterial color="white" /> | ||
</mesh> | ||
); | ||
}; | ||
|
||
function StarField({ numberOfStars = 100 }) { | ||
|
||
const starFieldRef = useRef(); | ||
|
||
useFrame((state, delta) => { | ||
starFieldRef.current.rotation.x += -0.001 | ||
starFieldRef.current.rotation.y += 0.002 | ||
}) | ||
|
||
const [positions, setPositions] = useState([]) | ||
|
||
const addStars = useCallback(() => { | ||
const starsPosition = []; | ||
for (let i = 0; i < numberOfStars; i++) { | ||
let x = (Math.random() * 2 - 1) * 10; // Ensure x is within -5 to 5 range | ||
let y = (Math.random() * 2 - 1) * 10; // Ensure y is within -5 to 5 range | ||
let z = (Math.random() * 2 - 1) * 4; // Ensure z is within -5 to 5 range | ||
starsPosition.push([x, y, z]); | ||
} | ||
setPositions((prev) => [...starsPosition]); | ||
}, [numberOfStars]) | ||
|
||
useEffect(addStars, []); | ||
return ( | ||
<group ref={starFieldRef} rotation={[0, 0, 1]}> | ||
{ | ||
positions.map((position, index) => ( | ||
<Star key={index} position={position} /> | ||
)) | ||
} | ||
</group> | ||
) | ||
} | ||
|
||
|
||
function Background() { | ||
|
||
return ( | ||
<div id={Styles['container']}> | ||
<Canvas id={Styles['background']} camera={{ fov: 80, position: [0, 0, 7] }} > | ||
<ambientLight intensity={1} /> | ||
<StarField numberOfStars={5000} /> | ||
</Canvas> | ||
</div> | ||
); | ||
} | ||
|
||
export default Background; |
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,6 @@ | ||
#container { | ||
position: fixed; | ||
z-index: -100; | ||
height: 100vh; | ||
width: 100vw; | ||
} |
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,6 @@ | ||
#container { | ||
position: fixed; | ||
z-index: -100; | ||
height: 100vh; | ||
width: 100vw; | ||
} |
This file was deleted.
Oops, something went wrong.
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