From 6acf08c3dde91ddfa285d5ad0c4a3373507da696 Mon Sep 17 00:00:00 2001 From: Ridwan Sharkar Date: Tue, 19 Nov 2024 12:26:11 -0500 Subject: [PATCH] internationally renowned physics bro suggests hyperbolic trajectories --- README.md | 2 +- public/textures/BorrowedOrder_logo.svg | 1 + warpgate/EnhancedPlanetGroup.tsx | 108 ++++++++++++++++--------- warpgate/Exoplanet.tsx | 8 +- 4 files changed, 75 insertions(+), 44 deletions(-) create mode 100644 public/textures/BorrowedOrder_logo.svg diff --git a/README.md b/README.md index eaab3f8..2513c98 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# Planetfolio v2.0 +# Planetfolio v2.2 ![Planetfolio v2 0](https://github.com/user-attachments/assets/67420c06-3db2-4496-9796-9b7cdd9e9ee7) diff --git a/public/textures/BorrowedOrder_logo.svg b/public/textures/BorrowedOrder_logo.svg new file mode 100644 index 0000000..0ea0e4b --- /dev/null +++ b/public/textures/BorrowedOrder_logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/warpgate/EnhancedPlanetGroup.tsx b/warpgate/EnhancedPlanetGroup.tsx index 2452951..d41f4a6 100644 --- a/warpgate/EnhancedPlanetGroup.tsx +++ b/warpgate/EnhancedPlanetGroup.tsx @@ -83,6 +83,22 @@ const EnhancedPlanetGroup: React.FC = ({ onSelectPlane ], logoTexturePath: '/textures/Fretboardx_logo.png', }, + // PLANET 1.5: Spotify + { + position: [0, 0, 0], + link: 'https://open.spotify.com/user/1268486981', + label: 'Spotify', + description: 'getPlaylists()', + orbitRadius: 2.33, + orbitSpeed: 0.775, + planetColor: '#F9B9F2', + rings: [ + { color: 'white', innerScale: 1.2, outerScale: 1.5, inclination: Math.PI / 2 }, + ], + size: 0.225, + rotationSpeed: 0.02, + logoTexturePath: '/textures/Spotify_logo.svg', + }, // PLANET 2: LINKEDIN { position: [0, 0, 0], @@ -99,6 +115,40 @@ const EnhancedPlanetGroup: React.FC = ({ onSelectPlane ], logoTexturePath: '/textures/LinkedIn_logo.svg', }, + // PLANET 3,25: BORROWED ORDER + { + position: [0, 0, 0], + link: 'https://ridwansharkar.github.io/Borrowed-Order/', + label: 'Borrowed Order', + description: 'visualize()', + orbitRadius: 6.3, + orbitSpeed: 0.125, + startAngle: (2 * Math.PI) / 3, + planetColor: '#c7434d', + size: 0.24, + rotationSpeed: 0.03, + rings: [ + { color: '#00FFFF', innerScale: 1.3, outerScale: 1.45, inclination: -Math.PI / 3 } + ], + logoTexturePath: '/textures/BorrowedOrder_logo.svg', + }, + // PLANET 3.5: Nutrimancer + { + position: [0, 0, 0], // Starting on the opposite side of the orbit + link: 'https://github.com/RidwanSharkar/The-Nutrimancers-Codex', + label: "The Nutrimancer's Codex - Vol. II", + description: 'unknown()', + orbitRadius: 6.3, + orbitSpeed: 0.125, + startAngle: (4 * Math.PI) / 3, + planetColor: '#84DCC6', //85FFC7 + rings: [ + { color: '#7EE081', innerScale: 1.25, outerScale: 1.6, inclination: Math.PI / 4.5 }, + ], + size: 0.325, + rotationSpeed: 0.01, + logoTexturePath: '/textures/Nutrimancer_logo.svg', + }, // PLANET 3: GITHUB { position: [0, 0, 0], @@ -143,23 +193,7 @@ const EnhancedPlanetGroup: React.FC = ({ onSelectPlane ], logoTexturePath: '/textures/Github_logo.svg', }, - // PLANET 3.5: Nutrimancer - { - position: [0, 0, 0], // Starting on the opposite side of the orbit - link: 'https://github.com/RidwanSharkar/The-Nutrimancers-Codex', - label: "The Nutrimancer's Codex - Vol. II", - description: 'unknown()', - orbitRadius: 6.3, - orbitSpeed: 0.125, - startAngle: Math.PI, - planetColor: '#84DCC6', //85FFC7 - rings: [ - { color: '#7EE081', innerScale: 1.25, outerScale: 1.6, inclination: Math.PI / 4.5 }, - ], - size: 0.325, - rotationSpeed: 0.01, - logoTexturePath: '/textures/Nutrimancer_logo.svg', - }, + // PLANET 4: IG ART STATION { position: [0, 0, 0], @@ -212,22 +246,7 @@ const EnhancedPlanetGroup: React.FC = ({ onSelectPlane ], logoTexturePath: '/textures/Mythos_logo.png', }, - // PLANET 6: Spotify - { - position: [0, 0, 0], - link: 'https://open.spotify.com/user/1268486981', - label: 'Spotify', - description: 'getPlaylists()', - orbitRadius: 4.7, - orbitSpeed: 0.47, - planetColor: '#F9B9F2', - rings: [ - { color: 'white', innerScale: 1.2, outerScale: 1.5, inclination: Math.PI / 2 }, - ], - size: 0.225, - rotationSpeed: 0.02, - logoTexturePath: '/textures/Spotify_logo.svg', - }, + ], []); // Initialize refs for each planet @@ -286,7 +305,7 @@ const EnhancedPlanetGroup: React.FC = ({ onSelectPlane useEffect(() => { const interval = setInterval(() => { setExoplanets(prev => [...prev, Date.now()]); // timestamp as unique ID - }, 15000); // 30000 ms = 30 seconds + }, 15000); return () => clearInterval(interval); }, []); @@ -296,6 +315,11 @@ const EnhancedPlanetGroup: React.FC = ({ onSelectPlane setExoplanets(prev => prev.filter(exoId => exoId !== id)); }; + const uniqueOrbitRadii = useMemo(() => { + const radii = planets.map(planet => planet.orbitRadius); + return Array.from(new Set(radii)); + }, [planets]); + return ( @@ -305,17 +329,23 @@ const EnhancedPlanetGroup: React.FC = ({ onSelectPlane planetSizes={getPlanetSizes()} onCollision={handleCollision} /> - {/* Render orbit paths */} - {planets.map((planet, index) => ( + + {/* Render unique orbit paths */} + {uniqueOrbitRadii.map((orbitRadius, index) => ( - + ))} diff --git a/warpgate/Exoplanet.tsx b/warpgate/Exoplanet.tsx index 9075e7a..d3d870f 100644 --- a/warpgate/Exoplanet.tsx +++ b/warpgate/Exoplanet.tsx @@ -20,12 +20,12 @@ const Exoplanet: React.FC = ({ onRemove }) => { // Constants for simulation const SPAWN_RADIUS = 50; const HYPERBOLIC_THRESHOLD = 40; // GRAVITY INFLUENCE - const MIN_DISTANCE = 2; - const BASE_GRAVITY_STRENGTH = 0.10; // GRAVITY STRENGTH - const CLOSE_APPROACH_THRESHOLD = 8; // APPROACH THRESHOLD + const MIN_DISTANCE = 1.8; // ACTUAL COLLSION SIZE + const BASE_GRAVITY_STRENGTH = 0.15; // GRAVITY STRENGTH + const CLOSE_APPROACH_THRESHOLD = 2.3; // APPROACH THRESHOLD const targetPoint = useMemo(() => { - const radius = Math.random() * 7; // COLLISION ZONE + const radius = Math.random() * 10; // COLLISION PLANE const theta = Math.random() * 2 * Math.PI; const phi = Math.acos(2 * Math.random() - 1); return new Vector3(