Skip to content

Commit

Permalink
shuffle around ui
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbull committed Jan 16, 2025
1 parent 2e0d9b2 commit 547dc5d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 25 deletions.
6 changes: 5 additions & 1 deletion frontend/app/src/components/GlobeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ import type { GlobeMethods } from 'react-globe.gl';

export function GlobeView() {
const globeRef = useRef<GlobeMethods>(null!);
const { setGlobeRef, height } = useGlobe();
const { setGlobeRef, height} = useGlobe();

useEffect(() => {
if (globeRef.current) {
setGlobeRef(globeRef.current);
}
globeRef.current.pointOfView({lat: 31, lng: -76, altitude: 1.6})
globeRef.current.controls().enableZoom = false;
globeRef.current.controls().autoRotate = true;
globeRef.current.controls().autoRotateSpeed = 0.5;
}, [setGlobeRef]);

return (
Expand Down
21 changes: 0 additions & 21 deletions frontend/app/src/components/SpotSelector.tsx

This file was deleted.

1 change: 1 addition & 0 deletions frontend/app/src/hooks/useGlobe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export function useGlobe() {
};



const globeZoom = (spot: Spot, altitude: number, ms: number) => {
if (globeRef && spot) {
globeRef.pointOfView(
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/src/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const Route = createRootRoute({
component: () => {
return (
<QueryClientProvider client={queryClient}>
<div className="min-h-screen text-neon">
<div className="min-h-screen text-neon font-thin shadow-neon">
<main className="container mx-auto px-4 py-8">
<Outlet />
</main>
Expand Down
29 changes: 27 additions & 2 deletions frontend/app/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
import { createFileRoute } from "@tanstack/react-router";
import { SpotSelector } from "@/components/SpotSelector";
import { useGlobe } from "@/hooks/useGlobe";
import { GlobeView } from "@/components/GlobeView";
import { SpotList } from "@/components/SpotList";
import { SearchBar } from "@/components/SearchBar";

export const Route = createFileRoute('/')({
component: SpotSelector
});
});

export function SpotSelector() {
const { setHeight } = useGlobe();



return (
<>
<div className="flex flex-col items-center gap-2">
<h1 className="text-4xl font-normal text-center pt-2 uppercase" onClick={() => setHeight(2000)}>
BODHI CAST
</h1>
<h3 className="text-center uppercase">
Riding the Data Wave to Your Next Break
</h3>
<GlobeView />
<SearchBar />
<SpotList />
</div>
</>
);
}

0 comments on commit 547dc5d

Please sign in to comment.