@@ -28,8 +27,9 @@ export const DonationImagePopover = () => {
nano_1osom16ctb773i6zi5fnepfro7bcmr5yqxb4qnmtzxkmdg88o4x6obmchzna
-
- Thank you! π π
+
+ Summon meteors βοΈ, confuse dinos π¦!
Rockets? What rockets?
+ π
If you sending by mistake, please let me know at
diff --git a/components/falcon9-animation.tsx b/components/falcon9-animation.tsx
index d133426..1e7f8f2 100644
--- a/components/falcon9-animation.tsx
+++ b/components/falcon9-animation.tsx
@@ -151,15 +151,18 @@ export const Falcon9Animation: React.FC = ({
if (distanceFromCenter < maxDistance) {
let currentSpeed;
if (distanceFromCenter <= 35) {
+ // Stage 1
currentSpeed =
initialSpeed +
- getRandomizedAcceleration() * (elapsedTime - launchDelay); // No power of two
- } else if (distanceFromCenter > 35 && distanceFromCenter <= 200) {
+ getRandomizedAcceleration() * (elapsedTime - launchDelay) * 1.5;
+ } else if (distanceFromCenter > 35 && distanceFromCenter <= 75) {
+ // Stage 2
currentSpeed =
initialSpeed +
getRandomizedAcceleration() *
Math.pow(elapsedTime - launchDelay, 1.5); // Use power of two for distance > 200
} else {
+ // Stage 3
currentSpeed =
initialSpeed +
getRandomizedAcceleration() *
diff --git a/components/rocket-animation-manager.tsx b/components/rocket-animation-manager.tsx
index 252e766..3b85e7e 100644
--- a/components/rocket-animation-manager.tsx
+++ b/components/rocket-animation-manager.tsx
@@ -21,7 +21,8 @@ interface RocketAnimationManagerProps {
onRocketCountChange: (count: number) => void;
isRocketView: boolean;
activeRocketIndex: number | null;
- setDistanceFromEarth: (distance: number) => void; // Add this prop
+ setActiveRocketIndex: (index: number | null) => void;
+ setDistanceFromEarth: (distance: number) => void;
}
export interface RocketAnimationManagerRef {
@@ -39,7 +40,8 @@ const RocketAnimationManager = forwardRef<
onRocketCountChange,
isRocketView,
activeRocketIndex,
- setDistanceFromEarth // Destructure the prop
+ setActiveRocketIndex,
+ setDistanceFromEarth
},
ref
) => {
@@ -57,12 +59,32 @@ const RocketAnimationManager = forwardRef<
const removeRocket = useCallback(
(id: string) => {
- setRockets((prevRockets) =>
- prevRockets.filter((rocket) => rocket.id !== id)
- );
+ setRockets((prevRockets) => {
+ const index = prevRockets.findIndex((rocket) => rocket.id === id);
+ if (index === -1) return prevRockets;
+
+ const newRockets = prevRockets.filter((_, i) => i !== index);
+
+ // Update activeRocketIndex if necessary
+ if (activeRocketIndex !== null) {
+ if (index === activeRocketIndex) {
+ // If the removed rocket was the active one, move to the last rocket in the array
+ if (newRockets.length > 0) {
+ setActiveRocketIndex(newRockets.length - 1);
+ } else {
+ setActiveRocketIndex(null);
+ }
+ } else if (index < activeRocketIndex) {
+ // If a rocket before the active one was removed, decrement the index
+ setActiveRocketIndex(activeRocketIndex - 1);
+ }
+ }
+
+ return newRockets;
+ });
onRocketComplete(id);
},
- [onRocketComplete]
+ [activeRocketIndex, setActiveRocketIndex, onRocketComplete]
);
useEffect(() => {
@@ -82,7 +104,7 @@ const RocketAnimationManager = forwardRef<
onComplete={() => removeRocket(rocket.id)}
isRocketView={isRocketView && index === activeRocketIndex}
cameraRef={cameraRef}
- setDistanceFromEarth={setDistanceFromEarth} // Pass the setter function
+ setDistanceFromEarth={setDistanceFromEarth}
/>
))}
>
diff --git a/components/three-scene-client-wrapper.tsx b/components/three-scene-client-wrapper.tsx
index ceea434..3afc9dd 100644
--- a/components/three-scene-client-wrapper.tsx
+++ b/components/three-scene-client-wrapper.tsx
@@ -2,28 +2,28 @@
import React, { useState, useEffect } from 'react';
import ThreeSceneClient from './three-scene-client';
-import { IRepData } from '@/types/index';
+// import { IRepData } from '@/types/index';
import { RepsData } from '@/data/defualtMergedRepsData';
const ThreeSceneClientWrapper: React.FC = () => {
- const [repsInfo, setRepsInfo] = useState(RepsData);
+ // const [repsInfo, setRepsInfo] = useState(RepsData);
const [serverDateTime, setServerDateTime] = useState(null);
- const [error, setError] = useState(null);
+ // const [error, setError] = useState(null);
useEffect(() => {
setServerDateTime(new Date());
}, []);
- if (error) {
- return Error: {error}
;
- }
+ // if (error) {
+ // return Error: {error}
;
+ // }
if (RepsData.length === 0) {
return Loading data... ΣΎ ΣΎ ΣΎ ...
;
}
return (
-
+
);
};
diff --git a/components/three-scene-client.tsx b/components/three-scene-client.tsx
index b035ae4..b5aa03e 100644
--- a/components/three-scene-client.tsx
+++ b/components/three-scene-client.tsx
@@ -2,12 +2,7 @@
import React, { useRef, useState, useEffect, useCallback } from 'react';
import { Canvas } from '@react-three/fiber';
-import {
- OrbitControls,
- Stars,
- PerspectiveCamera,
- Html
-} from '@react-three/drei';
+import { OrbitControls, Stars, PerspectiveCamera } from '@react-three/drei';
import * as THREE from 'three';
import { IRepData } from '@/types/index';
import ThreeMesh from '@/components/three-mesh';
@@ -18,7 +13,6 @@ import { useConfirmations } from '@/providers/confirmation-provider';
import { DonationAnimation } from '@/components/donation-animation';
import { NANO_LIVE_ENV } from '@/constants/nano-live-env';
import { parseNanoAmount } from '@/lib/parse-nano-amount';
-import { Falcon9Animation } from '@/components/falcon9-animation';
import { Vector3 } from 'three';
import { scaleRocketCount } from '@/lib/scale-rocket-count';
import { Button } from '@/components/ui/button';
@@ -104,7 +98,11 @@ const ThreeSceneClient: React.FC = ({
}
if (isSend) {
- const newRocketCount = scaleRocketCount(amount);
+ const newRocketCount = Math.max(
+ scaleRocketCount(amount),
+ rocketCount === 0 ? 1 : 0
+ );
+
for (let i = 0; i < newRocketCount; i++) {
const randomPosition = getRandomPositionOnGlobe();
rocketManagerRef.current?.addRocket(randomPosition);
@@ -131,6 +129,18 @@ const ThreeSceneClient: React.FC = ({
}
}, [launchQueue, activeRocketIndex]); // Add activeRocketIndex to dependencies
+ // New function to reset to Earth view
+ const resetToEarthView = () => {
+ setIsRocketView(false);
+
+ setTimeout(() => {
+ if (cameraRef.current) {
+ cameraRef.current.position.set(0, 0, 5);
+ cameraRef.current.lookAt(new THREE.Vector3(0, 0, 0)); // Look at the center of the Earth
+ }
+ }, 100);
+ };
+
if (!serverDateTime) {
return null;
}
@@ -146,6 +156,17 @@ const ThreeSceneClient: React.FC = ({
+ {/* New button to reset to Earth view */}
+ {distanceFromEarth > 10 && (
+
+ )}
{isRocketView && (
-
+
@@ -263,58 +285,68 @@ const ThreeSceneClient: React.FC = ({
-
+
{distanceFromEarth <= 2 && (
- "Fast, feeless, and ready for liftoff! π"
+ "Fast, feeless, green, and ready for liftoff! π"
)}
{distanceFromEarth > 2 && distanceFromEarth <= 5 && (
- "1 ΣΎNO = 1 ΣΎNO, even in space! ππ"
+ "1 ΣΎNO = 1 ΣΎNO, even in space! π©βπ πΈ"
)}
- {distanceFromEarth > 5 && distanceFromEarth <= 15 && (
+ {distanceFromEarth > 5 && distanceFromEarth <= 10 && (
- "BROCCOLISH π₯¦ All the way to the Mars!"
+ "BROCCOLISH π₯¦ All the way to the Mars!"
)}
- {distanceFromEarth > 15 && distanceFromEarth <= 25 && (
+ {distanceFromEarth > 10 && distanceFromEarth <= 20 && (
- "Nano: Proof-of-work? We left that back on Earth. πβ¨"
+ "Nano: Proof-of-work? We left that back on Earth π"
)}
- {distanceFromEarth > 25 && distanceFromEarth <= 35 && (
+ {distanceFromEarth > 20 && distanceFromEarth <= 30 && (
- "The further we go, the smaller our fees get. Oh wait... π"
+ "The further we go, the smaller our fees get. Oh wait...
+ Nano is feeless π"
)}
- {distanceFromEarth > 35 && distanceFromEarth <= 200 && (
+ {distanceFromEarth > 30 && distanceFromEarth <= 100 && (
- "Warp speed initiated. Nano's block lattice is unstoppable! π"
+ "π¨ Nano speed initiated π¨. Nano's block lattice is
+ unstoppable! π"
)}
{distanceFromEarth > 200 && distanceFromEarth <= 350 && (
- "Not even cosmic inflation can inflate Nano's supply! π₯"
+ "Not even cosmic inflation can inflate Nano's supply!
+ π₯"
)}
{distanceFromEarth > 350 && distanceFromEarth <= 500 && (
- "Zero fees across the universe, Nano is boundless. π«π"
+ "Zero fees across the universe, Nano is boundless. π«
+ π"
+
+ )}
+
+ {distanceFromEarth > 500 && distanceFromEarth <= 600 && (
+
+ "Nano IS Nano πΏ"
)}
- {distanceFromEarth > 500 && (
-
- "Nano IS Nano πΏ"
+ {distanceFromEarth > 600 && (
+
+ "USER-35077: What if ... falls to 2k π"
)}
diff --git a/constants/nano-live-env.ts b/constants/nano-live-env.ts
index 74cdd75..cecdd7d 100644
--- a/constants/nano-live-env.ts
+++ b/constants/nano-live-env.ts
@@ -5,8 +5,8 @@ export const NANO_LIVE_ENV = {
// wsUrl: 'wss://node.somenano.com/websocket',
// wsUrl: 'wss://rainstorm.city/websocket',
// wsUrl: 'wss://bitrequest.app:8010/websocket',
- // wsUrl: 'wss://nanoslo.0x.no/websocket',
- wsUrl: 'ws://localhost:8080/websocket',
+ wsUrl: 'wss://nanoslo.0x.no/websocket',
+ // wsUrl: 'ws://localhost:8080/websocket',
// wsUrl: 'wss://node.somenano.com/repeater',
rpcUrl: 'https://nanoproxy.numsu.dev/proxy',
diff --git a/lib/scale-rocket-count.ts b/lib/scale-rocket-count.ts
index b12bc3c..05b5161 100644
--- a/lib/scale-rocket-count.ts
+++ b/lib/scale-rocket-count.ts
@@ -8,8 +8,10 @@ export function scaleRocketCount(amount: number): number {
} else if (amount >= 10000) {
return 6;
} else if (amount >= 1000) {
+ return 4;
+ } else if (amount >= 100) {
return 2;
- } else if (amount >= 0) {
+ } else if (amount >= 10) {
return 1;
} else {
return 0;