Skip to content

Commit

Permalink
lowercase oops
Browse files Browse the repository at this point in the history
  • Loading branch information
RidwanSharkar committed Oct 29, 2024
1 parent 6bfbfa4 commit 3253700
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 42 deletions.
28 changes: 8 additions & 20 deletions warpgate/EnhancedPlanet.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useRef, useState, useEffect } from 'react';
import { useFrame, useLoader } from '@react-three/fiber';
import { Mesh, Euler, TextureLoader } from 'three';
import { Html } from '@react-three/drei';
import Moon from './Moon';
import * as THREE from 'three';
import { CelestialObjectGlow } from './CelestialObjectGlow';
Expand Down Expand Up @@ -58,7 +57,7 @@ const EnhancedPlanet: React.FC<EnhancedPlanetProps> = ({

const handleClick = () => {
onSelectPlanet(index, {
position: [0, 0, 0], // MAKE RANDOM
position: [0, 0, 0],
link,
label,
description,
Expand Down Expand Up @@ -101,14 +100,18 @@ const EnhancedPlanet: React.FC<EnhancedPlanetProps> = ({
onPointerOver={(e) => {
e.stopPropagation();
setHovered(true);
document.body.style.cursor = 'pointer'; // Set cursor here for consistency
}}
onPointerOut={(e) => {
e.stopPropagation();
setHovered(false);
if (!selected) {
document.body.style.cursor = 'auto'; // Reset cursor if not selected
}
}}
scale={selected ? [1.1, 1.1, 1.1] : [1, 1, 1]} // scale when selected
scale={selected ? [1.0, 1.0, 1.0] : [1, 1, 1]} // scale when selected meh
>
<sphereGeometry args={[size, 64, 64]} />
<sphereGeometry args={[size, 96, 96]} />
<meshStandardMaterial color={planetColor} />

{/* HOVER + SELECT GLOW */}
Expand Down Expand Up @@ -172,22 +175,7 @@ const EnhancedPlanet: React.FC<EnhancedPlanetProps> = ({
</mesh>
)}

{/* Tooltip */}
{(hovered || selected) && label && (
<Html
distanceFactor={10}
position={[0, size + 1.5, 0]}
style={{
background: 'rgba(0, 0, 0, 0.6)',
padding: '5px 10px',
borderRadius: '4px',
color: 'white',
whiteSpace: 'nowrap',
pointerEvents: 'none',
}}
>
</Html>
)}



</mesh>
Expand Down
4 changes: 2 additions & 2 deletions warpgate/EnhancedPlanetGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ const EnhancedPlanetGroup: React.FC<EnhancedPlanetGroupProps> = ({ onSelectPlane
orbitSpeed: 0.9,
size: 0.15,
moonColor: '#80FF72',
link: 'https://github.com/ridwansharkar/pharmacological-compound-classifier.com',
link: 'https://github.com/ridwansharkar/Pharmacological-Compound-Classifier.com',
label: 'Compound Classifier',
},
{ // Moon 4: MMA Arbitrager
orbitRadius: 2.1,
orbitSpeed: 0.1,
size: 0.11,
moonColor: '#f0a5ab',
link: 'https://github.com/ridwansharkar/arbitrage-better',
link: 'https://github.com/ridwansharkar/Arbitrage-Better',
label: 'MMA Arbitrager',
},
],
Expand Down
32 changes: 13 additions & 19 deletions warpgate/InfoPanel.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,30 @@

.infoPanel {
position: fixed;
top:30px; /* Distance from the top of the screen */
left: 39%; /* Center horizontally */
background: rgba(0, 0, 0, 0.7); /* Semi-transparent dark background */
top: 30px;
left: 50%;
transform: translateX(-50%);
display: flex; /* Flexbox for row layout */
align-items: center; /* Center content vertically */
justify-content: space-between; /* Space between elements */
background: rgba(0, 0, 0, 0.7);
color: #ffffff;
padding: 15px 22.5px;
border-radius: 20px;
width: 300px;
max-width: 90%;
width: 30%; /* Adjust width as needed */
max-width: 600px; /* Set a maximum width */
box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px); /* Frosted glass effect */
backdrop-filter: blur(10px);
opacity: 0;
transition: opacity 0.5s ease, transform 0.5s ease;
z-index: 1000;
z-index: 1000;
border: 2px solid transparent;
background-clip: padding-box;
font-family: 'Roboto', sans-serif;
}



.infoPanel::before {
content: '';
position: absolute;
Expand All @@ -34,18 +40,6 @@
border-radius: 12px;
}

.closeButton {
position: absolute;
top: 10px;
right: 15px;
background: transparent;
border: none;
color: #ffffff;
font-size: 1.5rem;
cursor: pointer;
transition: color 0.3s ease;
}

.closeButton:hover {
color: #ff6b6b; /* Change color on hover */
}
Expand Down
2 changes: 1 addition & 1 deletion warpgate/Sun.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const Sun = forwardRef<Mesh, SunProps>(({
// Glow
const glowMaterial = glowRef.current?.material as ShaderMaterial;
if (glowMaterial?.uniforms) {
glowMaterial.uniforms.intensity.value = 1.0 + Math.sin(t) * 0.1;
glowMaterial.uniforms.intensity.value = 1.0 + Math.sin(t) * 0.4;
}
});

Expand Down

0 comments on commit 3253700

Please sign in to comment.