Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: interactive globe #421

Merged
merged 58 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
2910ef0
upgrade drizzle and drizzle-kit
mpfeil Oct 9, 2024
91165c8
add location to measurements for mobile devices
mpfeil Oct 9, 2024
43f79d8
drop last migration
mpfeil Oct 11, 2024
7d1b7ab
add locations for mobile devices
mpfeil Oct 15, 2024
79ec1c3
workaround to handle postgis geometry in query
mpfeil Oct 15, 2024
99a2bad
Merge branch 'dev' into feat/measurement-geometry
mpfeil Oct 15, 2024
2b0d761
add globe to landing page
freds-dev Oct 27, 2024
21ff58f
add arcs
freds-dev Oct 27, 2024
f154d36
use `react-globe.gl`
freds-dev Oct 27, 2024
dc6d5cd
rerun `npm i` due to build errors
freds-dev Oct 28, 2024
55b0b05
remove migrations
freds-dev Oct 29, 2024
e8f86e1
Merge branch 'dev' into feat/measurement-geometry
freds-dev Oct 29, 2024
8917fc7
add locations
freds-dev Oct 29, 2024
761fce9
disable esLint for now
freds-dev Oct 30, 2024
3b3ec0d
Merge branch 'dev' into feat/measurement-geometry
freds-dev Nov 8, 2024
a74539d
get rid of `button can not be a descendant of button` error
freds-dev Nov 18, 2024
e84c332
make tags optional
freds-dev Nov 18, 2024
3e7ad8d
mobile box overview
freds-dev Nov 20, 2024
88c7b1a
add dynamic popup to mobile trajectories
freds-dev Nov 20, 2024
91ed5c2
enhance mobile boxes
freds-dev Nov 20, 2024
a3d4b92
Merge branch 'dev' into feat/measurement-geometry
freds-dev Nov 20, 2024
d8dd0b5
add build target
freds-dev Nov 20, 2024
d9bdd03
fix `top level await` error
freds-dev Nov 21, 2024
63661e5
add trips switch
freds-dev Nov 21, 2024
20b1d99
remove colors when trips are deactivated
freds-dev Nov 21, 2024
dee7bb6
allow to select two sensors on mobile device
freds-dev Nov 21, 2024
07d1f52
enable switching overlaying mobile sensor
freds-dev Nov 22, 2024
d7db39e
add sensor unit to dependencies in MobileBoxLayer effect
freds-dev Nov 22, 2024
731a5b4
Merge branch 'dev' into feat/measurement-geometry
freds-dev Nov 22, 2024
d0dbba7
refactor(routes): update route configuration and dependencies
freds-dev Nov 22, 2024
59d9004
refactor(donut-chart-cluster): simplify destructuring and formatting …
freds-dev Nov 22, 2024
9e85703
refactor(device): comment out time column in getDevice function
freds-dev Nov 22, 2024
86905f3
refactor(graph): rename LineWithZoom to GraphWithZoom and update zoom…
freds-dev Nov 25, 2024
588208a
refactor(mobile): update MobileBoxView structure and clean up MobileO…
freds-dev Nov 25, 2024
6daa439
refactor(device): add time column to extras in getDevice function
freds-dev Nov 25, 2024
74058b8
refactor(package): remove chartjs-scale-timestack dependency from pac…
freds-dev Nov 25, 2024
0e8ea93
update package-lock.json
freds-dev Nov 26, 2024
ae7ddaa
Merge branch 'dev' into feat/measurement-geometry
freds-dev Nov 26, 2024
a6454c5
refactor(color): update color palette and introduce dynamic color cal…
freds-dev Nov 26, 2024
78b396c
refactor(device-detail): improve image handling and update log entry …
freds-dev Nov 26, 2024
8b1e018
Merge branch 'dev' into feat/measurement-geometry
mpfeil Nov 26, 2024
23d7578
feat(device-detail): enhance tag selection with dynamic styling and U…
freds-dev Nov 26, 2024
2f28728
remove unused flag components and refactor language selector to use a…
freds-dev Nov 27, 2024
758a2ed
refactor: reorganize landing components and remove unused files
freds-dev Nov 27, 2024
035d5c5
i got us a smiling face
freds-dev Nov 27, 2024
5049822
Merge branch 'dev' into feat/interactive-globe
freds-dev Nov 27, 2024
5f5afe3
Merge branch 'feat/measurement-geometry' into feat/interactive-globe
freds-dev Nov 28, 2024
0609758
refactor: remove unnecessary margin from connect section
freds-dev Nov 28, 2024
6a66579
feat: implement sensor data visualization in GlobeComponent
freds-dev Nov 28, 2024
486cd68
merge
freds-dev Nov 29, 2024
7b18ad3
minor optimizations
freds-dev Nov 29, 2024
c828c92
Merge branch 'dev' into feat/interactive-globe
freds-dev Dec 18, 2024
48a673d
feat: remove SVG face component and related hover functionality from …
freds-dev Dec 18, 2024
de794fa
update package-lock.json
freds-dev Dec 18, 2024
9d68123
fix landing page tests
freds-dev Jan 2, 2025
2f4b26b
refactor: remove landing page tests
freds-dev Jan 2, 2025
26eb5e7
feat: integrate latest devices into GlobeComponent and update data fe…
freds-dev Jan 2, 2025
9088a72
test: add empty test block to landing page spec to prevent errors
freds-dev Jan 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/device-detail/entry-logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function EntryLogs({
<Activity className="w-5 h-5" />
</div>
<div className="flex-grow">
<p className="text-sm font-medium mb-2">{entryLogs[0].content}</p>
<p className="text-sm font-medium mb-2">{entryLogs[entryLogs.length -1].content}</p>
<div className="flex items-center text-xs text-muted-foreground">
<Clock className="w-3 h-3 mr-1" />
{new Date(entryLogs[0].createdAt).toLocaleString()}
Expand Down
18 changes: 0 additions & 18 deletions app/components/landing/donate-iframe.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions app/components/landing/donate-text.tsx

This file was deleted.

23 changes: 0 additions & 23 deletions app/components/landing/donate.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion app/components/landing/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default function Footer() {
return (
<footer className="w-full bg-white px-4 text-gray-300 dark:bg-black dark:text-gray-100 sm:p-6 lg:text-lg">
<footer id="footer" className="w-full bg-white px-4 text-gray-300 dark:bg-black dark:text-gray-100 sm:p-6 lg:text-lg">
<hr className="my-6 border-gray-300 dark:border-gray-100 sm:mx-auto lg:my-8" />
<div className="mx-auto w-full max-w-screen-xl p-4 md:flex md:items-center md:justify-between">
<span className="text-sm text-gray-500 dark:text-gray-400 sm:text-center">
Expand Down
9 changes: 0 additions & 9 deletions app/components/landing/ger-flag.tsx

This file was deleted.

55 changes: 55 additions & 0 deletions app/components/landing/globe.client.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
"use client";

import { useEffect, useRef } from "react";
import Globe from "react-globe.gl";

interface Device {
id: string;
name: string;
latitude: number;
longitude: number;
}

interface GlobeComponentProps {
latestDevices: Device[];
}

export const GlobeComponent = ({ latestDevices }: GlobeComponentProps) => {
const globeEl = useRef<any>(null);

const colorInterpolator = (t: number) =>
`rgba(${50 + Math.floor(t * 50)}, ${100 + Math.floor(t * 100)}, 255, ${Math.sqrt(1 - t)})`;

// Transform latestDevices into the format required by Globe's ringsData
const sensorData = latestDevices.map((device) => ({
lat: device.latitude,
lng: device.longitude,
maxR: 10,
propagationSpeed: 5,
repeatPeriod: 1000,
}));

useEffect(() => {
if (globeEl.current) {
globeEl.current.controls().autoRotate = true;
globeEl.current.controls().autoRotateSpeed = 1.0;
globeEl.current.controls().enableZoom = false;
}
}, []);

return (
<Globe
ref={globeEl}
globeImageUrl="//unpkg.com/three-globe/example/img/earth-day.jpg"
bumpImageUrl="//unpkg.com/three-globe/example/img/earth-topology.png"
backgroundColor="rgba(0, 0, 0, 0)"
width={500}
height={500}
ringsData={sensorData}
ringColor={() => colorInterpolator}
ringMaxRadius="maxR"
ringPropagationSpeed="propagationSpeed"
ringRepeatPeriod="repeatPeriod"
/>
);
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Link } from "@remix-run/react";
import { useState } from "react";
import { ModeToggle } from "../../mode-toggle";
import LanguageSelector from "./language-selector";
import { ModeToggle } from "../mode-toggle";

const links = [
{
Expand Down Expand Up @@ -34,8 +34,8 @@ export default function Header() {
const [openMenu, setOpenMenu] = useState(false);

return (
<nav className="relative z-50 mx-auto flex max-w-7xl justify-between px-2 py-2 dark:border-gray-300 dark:bg-black sm:px-6 md:py-8 lg:px-8">
<div className="container z-50 mx-auto flex flex-wrap items-center justify-between font-serif">
<nav id="header" className="relative z-50 h-16 py-6 mx-auto flex max-w-7xl justify-between dark:border-gray-300 dark:bg-black">
<div className="container z-50 mx-auto flex flex-wrap items-center justify-between font-serif px-4">
{/* Osem Logo*/}
<div className="flex max-w-screen-xl flex-wrap items-center justify-between">
{/* Osem Logo*/}
Expand Down
32 changes: 32 additions & 0 deletions app/components/landing/header/language-selector.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { useFetcher, useLoaderData } from "@remix-run/react";
import { useState } from "react";
import i18next from "i18next";
import type { loader } from "~/root";
import { Button } from "~/components/ui/button";

export default function LanguageSelector() {
const data = useLoaderData<typeof loader>();
const fetcher = useFetcher();
const [locale, setLocale] = useState(data.locale || "en");

const toggleLanguage = () => {
const newLocale = locale === "en" ? "de" : "en"; // Toggle between "en" and "de"
setLocale(newLocale);
i18next.changeLanguage(newLocale); // Change the language in the app
fetcher.submit(
{ language: newLocale },
{ method: "post", action: "/action/set-language" }, // Persist the new language
);
};

return (
<Button
variant="ghost"
size="icon"
onClick={toggleLanguage}
className="hover:bg-transparent dark:hover:text-white hover:text-black"
>
{locale === "de" ? <p>DE</p> : <p>EN</p>}
</Button>
);
}
61 changes: 0 additions & 61 deletions app/components/landing/language-selector.tsx

This file was deleted.

43 changes: 0 additions & 43 deletions app/components/landing/pricing-plans.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { BookA, Wrench } from "lucide-react";
export default function Connect() {
return (
<section
id="connect-section"
className="flex justify-between mx-32 gap-20 border-t border-gray-200 py-20"
id="connect"
className="h-full flex justify-center items-center gap-20 py-20"
>
<div id="left" className="w-1/2 flex flex-col gap-10">
<div id="title" className="text-2xl font-semibold">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function getZIndex({

export default function FeaturesCarousel({ data }: FeaturesProps) {
const [[activeIndex, direction], setActiveIndex] = useState<[number, number]>(
[0, 0]
[0, 0],
);
const [isButtonDisabled, setIsButtonDisabled] = useState(false);
const [isMobileScreen, setIsMobileScreen] = useState(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
export default function Features() {
return (
<section
id="features-section"
className="flex justify-between mx-32 gap-10 border-t border-gray-200 py-20"
id="features"
className="flex justify-between gap-10"
>
<div id="left" className="w-1/2 flex flex-col gap-10">
<div id="title" className="text-2xl font-semibold">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ArrowUpDown, RadioTower, Unplug } from "lucide-react";
export default function Integrations() {
return (
<section
id="integrations-section"
className="flex justify-between mx-32 gap-10 border-t border-gray-200 py-20"
id="integrations"
className="flex justify-between gap-10"
>
<div id="left" className="w-1/2 flex flex-col gap-10">
<div id="title" className="text-2xl font-semibold">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ type PartnersProps = {
export default function Partners({ data }: PartnersProps) {
return (
<div
id="partners-section"
className="flex h-full min-h-full items-center justify-center text-xl text-gray-300 dark:text-gray-100"
id="partners"
className="flex h-full items-center justify-center text-xl text-gray-300 dark:text-gray-100"
>
<div className="flex h-full w-5/6 flex-col justify-evenly">
<div className="flex items-center justify-center pb-10">
<p className="dark:text-blue-200 font-serif text-6xl font-black text-blue-100 subpixel-antialiased">
Partners
</p>
</div>
<div className="flex flex-wrap items-center justify-center">
<div className="flex items-center justify-center">
{data.map((partner, index) => {
return (
<motion.div
Expand Down
Loading
Loading