Skip to content

Commit

Permalink
return of the globe
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbull committed Jan 11, 2025
1 parent c5de713 commit f025990
Show file tree
Hide file tree
Showing 15 changed files with 427 additions and 5 deletions.
1 change: 1 addition & 0 deletions frontend/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@tanstack/react-router": "^1.95.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-globe.gl": "^2.29.4",
"react-query-devtools": "^2.6.3",
"zustand": "^5.0.3"
},
Expand Down
405 changes: 405 additions & 0 deletions frontend/app/pnpm-lock.yaml

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions frontend/app/src/components/GlobeView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Globe, { GlobeMethods } from "react-globe.gl";
import globeImageUrl from "../img/earth-blue-marble.jpg";

export function GlobeView() {
return (
<Globe
// ref={globeEl}
// height={globeSize.height}
globeImageUrl={globeImageUrl}
backgroundColor="rgb(15 23 42)"
// onGlobeClick={handleGlobeClick}
/>
)
}
2 changes: 2 additions & 0 deletions frontend/app/src/components/SpotSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { GlobeView } from "./GlobeView";
import { SpotList } from "./SpotList";

export function SpotSelector() {
return (
<>
<p>test</p>
<GlobeView />
<SpotList />
</>
);
Expand Down
Binary file added frontend/app/src/img/circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/app/src/img/earth-blue-marble.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/app/src/img/earth-dark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/app/src/img/earth-topology.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/app/src/img/earth-water.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/app/src/img/earthSpecular.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/app/src/img/night-sky.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/app/src/img/worldColour.5400x2700.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/app/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #1f2937;
background-color: #0F172A;

font-synthesis: none;
text-rendering: optimizeLegibility;
Expand Down
8 changes: 4 additions & 4 deletions frontend/my-app/src/components/GlobeSpots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const GlobeSpots: React.FC<any> = ({
const filteredSpots = nearbySpots.filter(
(spot) =>
spot.spot_name.toLowerCase().includes(query.toLowerCase()) ||
spot.street_address.toLowerCase().includes(query.toLowerCase()),
spot.street_address.toLowerCase().includes(query.toLowerCase())
);

// Defining initial perspective and controls for globe component
Expand All @@ -57,7 +57,7 @@ const GlobeSpots: React.FC<any> = ({
const fetchNearbySpots = async () => {
try {
const res = await fetch(
`${process.env.REACT_APP_BACKEND_URL ?? "http://localhost:8000"}/spots`,
`${process.env.REACT_APP_BACKEND_URL ?? "http://localhost:8000"}/spots`
);
const data: Spot[] = await res.json();
setNearbySpots(data);
Expand All @@ -80,7 +80,7 @@ const GlobeSpots: React.FC<any> = ({
lng: data.longitude,
altitude: altitude,
},
ms,
ms
);
setCurrentSpot(data);
setTimeout(() => {
Expand All @@ -107,7 +107,7 @@ const GlobeSpots: React.FC<any> = ({
lng: spotClick[1],
altitude: 0.2,
},
2500,
2500
);
setTimeout(() => {
setCurrentComponent("AddSpot");
Expand Down

0 comments on commit f025990

Please sign in to comment.