Skip to content

Commit 0dfa895

Browse files
committed
Nothing
1 parent fb1dda1 commit 0dfa895

10 files changed

Lines changed: 50 additions & 36 deletions

File tree

src/pages/home/.ipynb_checkpoints/Home-checkpoint.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function Home() {
3535
<header style={{
3636
transition: "opacity 0.4s ease",
3737
opacity: hideUI ? 0 : 1,
38-
pointerEvents: hideUI ? "none" : "auto",
38+
pointerEvents: hideUI ? "none" : "auto",
3939
}}
4040
>
4141
<div className={styles["header-brand"]}>
@@ -54,11 +54,14 @@ export default function Home() {
5454
<LevelComponent
5555
key={mountKey}
5656
onClose={() => handleClose()}
57-
lvl={getLevelRef.current ? getLevelRef.current() : 0}
57+
selectedLevel={getLevelRef.current ? getLevelRef.current() : 0}
5858
/>
5959
</div>
6060
<canvas ref={canvasRef} className={styles.solarsystem}></canvas>
6161
</section>
6262
</div>
6363
);
6464
}
65+
const onPlanetClick = () => {
66+
setPlanetClicked(true);
67+
}
Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
* {
2-
margin: 0;
3-
padding: 0;
4-
border: 0;
5-
font-size: 100%;
6-
vertical-align: baseline;
7-
overflow: hidden;
8-
/* outline: 1px solid red !important; */
9-
}
10-
111
html, body {
122
width: 100%;
133
height: 100%;
@@ -23,24 +13,42 @@ header {
2313

2414
.header-brand {
2515
width: 80%;
26-
margin-top: 40px;
16+
margin-top: 0px;
2717
display: flex;
2818
justify-content: center;
2919

30-
h1 {
31-
font-weight: 250;
32-
font-size: 4rem;
33-
line-height: 100%;
34-
color: green;
20+
img {
21+
width: 35%;
3522
}
23+
3624
}
3725

3826
}
3927

28+
.cleardiv {
29+
clear: both;
30+
}
4031

4132
.solarsystem {
4233
width: 100%;
4334
height: 100%;
4435
display: block;
4536
position: absolute;
46-
}
37+
}
38+
39+
button {
40+
z-index: 100;
41+
color: white;
42+
}
43+
44+
/*
45+
{
46+
margin: 0;
47+
padding: 0;
48+
border: 0;
49+
font-size: 100%;
50+
vertical-align: baseline;
51+
overflow: hidden;
52+
// outline: 1px solid red !important;
53+
}
54+
*/

src/pages/home/Home.module.css

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@ header {
1313

1414
.header-brand {
1515
width: 80%;
16-
margin-top: 40px;
16+
margin-top: 0px;
1717
display: flex;
1818
justify-content: center;
1919

20-
h1 {
21-
font-weight: 250;
22-
font-size: 4rem;
23-
line-height: 100%;
24-
color: green;
20+
img {
21+
width: 35%;
2522
}
23+
2624
}
2725

2826
}

src/pages/home/Home.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function Home() {
3535
<header style={{
3636
transition: "opacity 0.4s ease",
3737
opacity: hideUI ? 0 : 1,
38-
pointerEvents: hideUI ? "none" : "auto",
38+
pointerEvents: hideUI ? "none" : "auto",
3939
}}
4040
>
4141
<div className={styles["header-brand"]}>
@@ -62,3 +62,6 @@ export default function Home() {
6262
</div>
6363
);
6464
}
65+
const onPlanetClick = () => {
66+
setPlanetClicked(true);
67+
}

src/pages/home/js/.ipynb_checkpoints/camera-checkpoint.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function setupParallax( canvas ) {
3939

4040
}
4141

42-
export function setupFocus( canvas, camera, planets, basePosition ) {
42+
export function setupFocus( canvas, camera, planets, basePosition, onPlanetClick ) {
4343

4444
const focus = {
4545
raycaster: new THREE.Raycaster(),
@@ -66,6 +66,7 @@ export function setupFocus( canvas, camera, planets, basePosition ) {
6666
focus.paused = true;
6767
focus.tweening = true;
6868
focus.popupFired = false;
69+
onPlanetClick()
6970
}
7071
else {
7172
zoomOut();

src/pages/home/js/.ipynb_checkpoints/main-checkpoint.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { createScene } from "./scene.js";
66
const ZOOM_DIST = 5;
77
const TWEEN_SPEED = 0.07;
88

9-
export function main( canvas, onPlanetFocus ) {
9+
export function main( canvas, onPlanetClick, onPlanetFocus ) {
1010

1111
// --- Initialisation ---
1212

@@ -18,7 +18,7 @@ export function main( canvas, onPlanetFocus ) {
1818

1919
const { targetOffset, currentOffset } = setupParallax( canvas );
2020

21-
const { focus, zoomOut } = setupFocus( canvas, camera, planets, basePosition );
21+
const { focus, zoomOut } = setupFocus( canvas, camera, planets, basePosition, onPlanetClick );
2222

2323
const currentLookAt = new THREE.Vector3(0, 0, 0);
2424
const origin = new THREE.Vector3(0, 0, 0);
@@ -111,8 +111,8 @@ export function main( canvas, onPlanetFocus ) {
111111
focus.popupFired = true;
112112
if (typeof onPlanetFocus === 'function') {
113113
onPlanetFocus();
114+
}
114115
}
115-
}
116116
};
117117

118118
}

src/pages/home/js/.ipynb_checkpoints/scene-checkpoint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function createScene() {
5656
// Planets
5757
const planetData = [
5858
{ level: 1, id: 1, radius: 1.1, orbitR: 14, speed: 0.8, angle: 0 * (Math.PI / 180), tilt: 0.2, color: 0xff6644, emissive: 0x441100, texture: '/textures/texture1.webp'},
59-
{ level: 1, id: 2, radius: 1.1, orbitR: 14, speed: 0.8, angle: 120 * (Math.PI / 180), tilt: 0.2, color: 0xff6644, emissive: 0x441100, texture: '/textures/texture1.webp'},
59+
{ level: 1, id: 2, radius: 1.1, orbitR: 14, speed: 0.8, angle: 120 * (Math.PI / 180), tilt: 0.2, color: 0xff6644, emissive: 0x441100, texture: '/textures/texture1.webp'},
6060
{ level: 1, id: 3, radius: 1.1, orbitR: 14, speed: 0.8, angle: 240 * (Math.PI / 180), tilt: 0.2, color: 0xff6644, emissive: 0x441100, texture: '/textures/texture1.webp'},
6161
{ level: 2, id: 4, radius: 1.5, orbitR: 24, speed: 0.45, angle: 0 * (Math.PI / 180), tilt: 0.35, color: 0x44aaff, emissive: 0x001133, texture: '/textures/texture2.webp' },
6262
{ level: 2, id: 5, radius: 1.5, orbitR: 24, speed: 0.45, angle: 120 * (Math.PI / 180), tilt: 0.35, color: 0x44aaff, emissive: 0x001133, texture: '/textures/texture2.webp' },

src/pages/home/js/camera.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function setupParallax( canvas ) {
3939

4040
}
4141

42-
export function setupFocus( canvas, camera, planets, basePosition ) {
42+
export function setupFocus( canvas, camera, planets, basePosition, onPlanetClick ) {
4343

4444
const focus = {
4545
raycaster: new THREE.Raycaster(),
@@ -66,6 +66,7 @@ export function setupFocus( canvas, camera, planets, basePosition ) {
6666
focus.paused = true;
6767
focus.tweening = true;
6868
focus.popupFired = false;
69+
onPlanetClick()
6970
}
7071
else {
7172
zoomOut();

src/pages/home/js/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { createScene } from "./scene.js";
66
const ZOOM_DIST = 5;
77
const TWEEN_SPEED = 0.07;
88

9-
export function main( canvas, onPlanetFocus ) {
9+
export function main( canvas, onPlanetClick, onPlanetFocus ) {
1010

1111
// --- Initialisation ---
1212

@@ -18,7 +18,7 @@ export function main( canvas, onPlanetFocus ) {
1818

1919
const { targetOffset, currentOffset } = setupParallax( canvas );
2020

21-
const { focus, zoomOut } = setupFocus( canvas, camera, planets, basePosition );
21+
const { focus, zoomOut } = setupFocus( canvas, camera, planets, basePosition, onPlanetClick );
2222

2323
const currentLookAt = new THREE.Vector3(0, 0, 0);
2424
const origin = new THREE.Vector3(0, 0, 0);
@@ -111,8 +111,8 @@ export function main( canvas, onPlanetFocus ) {
111111
focus.popupFired = true;
112112
if (typeof onPlanetFocus === 'function') {
113113
onPlanetFocus();
114+
}
114115
}
115-
}
116116
};
117117

118118
}

src/pages/home/js/scene.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function createScene() {
5656
// Planets
5757
const planetData = [
5858
{ level: 1, id: 1, radius: 1.1, orbitR: 14, speed: 0.8, angle: 0 * (Math.PI / 180), tilt: 0.2, color: 0xff6644, emissive: 0x441100, texture: '/textures/texture1.webp'},
59-
{ level: 1, id: 2, radius: 1.1, orbitR: 14, speed: 0.8, angle: 120 * (Math.PI / 180), tilt: 0.2, color: 0xff6644, emissive: 0x441100, texture: '/textures/texture1.webp'},
59+
{ level: 1, id: 2, radius: 1.1, orbitR: 14, speed: 0.8, angle: 120 * (Math.PI / 180), tilt: 0.2, color: 0xff6644, emissive: 0x441100, texture: '/textures/texture1.webp'},
6060
{ level: 1, id: 3, radius: 1.1, orbitR: 14, speed: 0.8, angle: 240 * (Math.PI / 180), tilt: 0.2, color: 0xff6644, emissive: 0x441100, texture: '/textures/texture1.webp'},
6161
{ level: 2, id: 4, radius: 1.5, orbitR: 24, speed: 0.45, angle: 0 * (Math.PI / 180), tilt: 0.35, color: 0x44aaff, emissive: 0x001133, texture: '/textures/texture2.webp' },
6262
{ level: 2, id: 5, radius: 1.5, orbitR: 24, speed: 0.45, angle: 120 * (Math.PI / 180), tilt: 0.35, color: 0x44aaff, emissive: 0x001133, texture: '/textures/texture2.webp' },

0 commit comments

Comments
 (0)