diff --git a/public/videos/phase-3/bg/cloud_cover_global_100km.mp4 b/public/videos/phase-3/bg/cloud_cover_global_100km.mp4 new file mode 100644 index 0000000..0c83b4f Binary files /dev/null and b/public/videos/phase-3/bg/cloud_cover_global_100km.mp4 differ diff --git a/public/videos/phase-3/bg/cloud_cover_global_100km_original.mp4 b/public/videos/phase-3/bg/cloud_cover_global_100km_original.mp4 new file mode 100644 index 0000000..681cb4f Binary files /dev/null and b/public/videos/phase-3/bg/cloud_cover_global_100km_original.mp4 differ diff --git a/public/videos/phase-3/bg/sst_global_100km.mp4 b/public/videos/phase-3/bg/sst_global_100km.mp4 new file mode 100644 index 0000000..daa6059 Binary files /dev/null and b/public/videos/phase-3/bg/sst_global_100km.mp4 differ diff --git a/public/videos/phase-3/bg/tp_global_100km.mp4 b/public/videos/phase-3/bg/tp_global_100km.mp4 new file mode 100644 index 0000000..21362b4 Binary files /dev/null and b/public/videos/phase-3/bg/tp_global_100km.mp4 differ diff --git a/public/videos/phase-3/originals/tooltip/sst_10km.mp4 b/public/videos/phase-3/originals/tooltip/sst_10km.mp4 new file mode 100644 index 0000000..fd62356 Binary files /dev/null and b/public/videos/phase-3/originals/tooltip/sst_10km.mp4 differ diff --git a/public/videos/phase-3/originals/tooltip/tas_10km.mp4 b/public/videos/phase-3/originals/tooltip/tas_10km.mp4 new file mode 100644 index 0000000..efa1a68 Binary files /dev/null and b/public/videos/phase-3/originals/tooltip/tas_10km.mp4 differ diff --git a/public/videos/phase-3/originals/tooltip/tp_amazonia_10km.mp4 b/public/videos/phase-3/originals/tooltip/tp_amazonia_10km.mp4 new file mode 100644 index 0000000..daa9f3f Binary files /dev/null and b/public/videos/phase-3/originals/tooltip/tp_amazonia_10km.mp4 differ diff --git a/public/videos/phase-3/tooltip/cloud_cover_10km_square.mp4 b/public/videos/phase-3/tooltip/cloud_cover_10km_square.mp4 new file mode 100644 index 0000000..5bee6b7 Binary files /dev/null and b/public/videos/phase-3/tooltip/cloud_cover_10km_square.mp4 differ diff --git a/public/videos/phase-3/tooltip/sst_10km_square.webm b/public/videos/phase-3/tooltip/sst_10km_square.webm new file mode 100644 index 0000000..7092832 Binary files /dev/null and b/public/videos/phase-3/tooltip/sst_10km_square.webm differ diff --git a/public/videos/phase-3/tooltip/tas_10km_square.webm b/public/videos/phase-3/tooltip/tas_10km_square.webm new file mode 100644 index 0000000..9c6dc5b Binary files /dev/null and b/public/videos/phase-3/tooltip/tas_10km_square.webm differ diff --git a/public/videos/phase-3/tooltip/tp_amazonia_10km_square.webm b/public/videos/phase-3/tooltip/tp_amazonia_10km_square.webm new file mode 100644 index 0000000..cedb629 Binary files /dev/null and b/public/videos/phase-3/tooltip/tp_amazonia_10km_square.webm differ diff --git a/src/components/globe-map/data.ts b/src/components/globe-map/data.ts index c1e735a..de96e65 100644 --- a/src/components/globe-map/data.ts +++ b/src/components/globe-map/data.ts @@ -7,6 +7,13 @@ export const markers: MarkerType[] = [ { id: "Sea surface temp", lat: 0.75, lng: -111.0 }, ]; +export const BACKGROUND_VIDEOS = [ + "videos/phase-3/bg/tp_global_100km.mp4", + "videos/phase-3/bg/cloud_cover_global_100km.mp4", + "videos/phase-3/bg/tas_100km.mp4", + "videos/phase-3/bg/sst_global_100km.mp4", +]; + export const popupContent = [ { id: "Amazonia", @@ -14,7 +21,7 @@ export const popupContent = [ subtitle: "Diurnal precipitation cycle", description: "The diurnal precipitation cycle over the Amazon rainforest highlights the complex interactions and feedbacks between atmosphere and land. The diurnal rainfall, maintained by moisture inflow from the Atlantic ocean into the Amazon basin, arises due to evapotranspiration and moisture recycling from the dense forest. This self-sustained cycle is in turn driven by sharp contrasts in temperature between day and night.", - video: "/videos/tp_amazonia_10km.webm", + video: "/videos/phase-3/tooltip/tp_amazonia_10km_square.webm", legend: { image: "/images/home-legend-1.svg", low: "0.0 m³/m²", @@ -27,7 +34,7 @@ export const popupContent = [ subtitle: "Tropical cyclone track", description: "Tropical cyclones in the North Atlantic Ocean typically form near the equator and propogate westward, often curving northward as they approach the Caribbean or the east coast of the US. These powerful storms are steered by trade winds and ocean currents, impacting coastal regions with strong winds, heavy rainfall, and storm surges.", - video: "/videos/wind_speed_global_10km.webm", + video: "/videos/phase-3/tooltip/cloud_cover_10km_square.mp4", legend: { image: "/images/home-legend-2.svg", low: "0%", @@ -40,7 +47,7 @@ export const popupContent = [ subtitle: "Diurnal temperature cycle", description: "The diurnal temperature cycle over the Pyrenees in the Iberian Peninsula describes the significant temperature fluctuations between day and night. During the day, sunlight heats the region, while at night, temperatures drop rapidly due to clear skies and high altitude, creating a marked difference in daily and nightly temperatures.", - video: "/videos/tas_10km.webm", + video: "videos/phase-3/tooltip/tas_10km_square.webm", legend: { image: "/images/home-legend-3.svg", low: "4º", @@ -53,7 +60,7 @@ export const popupContent = [ subtitle: "Ocean eddies and currents", description: "Ocean eddies and currents off the coast of Ecuador in the Pacific Ocean play a key role in shaping local marine ecosystems. The warm waters of the equatorial current interact with cooler, nutrient-rich upwellings (deep water), creating swirling currents, known as eddies, that support diverse marine life and influence weather patterns.", - video: "/videos/sst_10km.webm", + video: "videos/phase-3/tooltip/sst_10km_square.webm", legend: { image: "/images/home-legend-4.svg", low: "19º", diff --git a/src/components/globe-map/globe-group.tsx b/src/components/globe-map/globe-group.tsx index 262946f..a1dc64f 100644 --- a/src/components/globe-map/globe-group.tsx +++ b/src/components/globe-map/globe-group.tsx @@ -1,8 +1,10 @@ +import { useMemo } from 'react'; import { Globe } from './globe'; import Marker from './marker'; import { useFrame } from '@react-three/fiber'; import type { markers as MarkerType } from './data'; import { Group } from 'three'; +import { BACKGROUND_VIDEOS } from './data'; const GlobeGroup = ({ hasMarkers, markers, selectedMarker, setEnabled, setSelectedMarker, rotate, videoMaterial, groupRef }: { @@ -17,6 +19,11 @@ const GlobeGroup = ({ hasMarkers, markers, selectedMarker, setEnabled, setSelect } ) => { + const markerBackgroundVideoMaterial = useMemo(() => { + if (!hasMarkers || selectedMarker === null) return null; + return BACKGROUND_VIDEOS[selectedMarker || 0]; + }, [selectedMarker, hasMarkers]); + useFrame(() => { if (rotate && groupRef.current) { groupRef.current.rotation.y += 0.01; @@ -25,7 +32,7 @@ const GlobeGroup = ({ hasMarkers, markers, selectedMarker, setEnabled, setSelect return ( - + { hasMarkers && markers.map((marker, index) => ( ( + <> +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +); const Popup = ({ closePopup, setSelectedMarker, index }: { closePopup: () => void @@ -19,12 +39,20 @@ const Popup = ({ closePopup, setSelectedMarker, index }: { "relative -mt-[140px] -ml-[140px] xl:-ml-[140px]": !isMobile, "fixed top-0 xs:left-[calc(50%-250px)] sm:left-[calc(50%-325px)] z-50 px-4 w-full h-full items-center justify-center xs:max-w-[500px] sm:max-w-[650px]": isMobile })}> -
-
+
+
- +
+ + +