"use client"; import { useEffect, useState } from "react"; import { formatCoords } from "@/lib/display"; import { outlineButton, pixelLabel, sectionHeading } from "@/lib/styles"; import type { Place } from "@/lib/weather/types"; import { HeartMeter, SkyIcon } from "./PixelArt"; import { Slot } from "./Slot"; const WAYPOINTS: { place: Place; terrain: string }[] = [ { place: { name: "New York", region: "New York", country: "US", lat: 40.7128, lon: -74.006 }, terrain: "Atlantic harbor", }, { place: { name: "Seattle", region: "Washington", country: "US", lat: 47.6062, lon: -122.3321 }, terrain: "Puget Sound", }, { place: { name: "Denver", region: "Colorado", country: "US", lat: 39.7392, lon: -104.9903 }, terrain: "Front Range", }, { place: { name: "Reykjavik", country: "IS", lat: 64.1466, lon: -21.9426 }, terrain: "North Atlantic", }, { place: { name: "London", country: "GB", lat: 51.5072, lon: -0.1276 }, terrain: "Thames valley", }, { place: { name: "Tokyo", country: "JP", lat: 35.6762, lon: 139.6503 }, terrain: "Tokyo Bay", }, ]; const HIGHLIGHTS = [ { label: "Horizons", title: "Hourly & 14-day", detail: "Crosshair temperature & precip chart, exact hourly table, and daily range bars.", }, { label: "Live sky map", title: "Animated radar", detail: "High-detail US NEXRAD & global RainViewer loops, plus 5 OpenWeather tile layers.", }, { label: "Field readings", title: "Comfort & AQI", detail: "Five-heart comfort gauge, US AQI & PM2.5, UV stamina bars, NWS alerts, and moon phase.", }, ]; /** * Homepage landing view shown before a destination is chosen. * Introduces the station aesthetic and lets visitors jump straight into a waypoint. */ export function HomeLanding({ onSelectPlace, onFocusSearch, activeProviderLabel, }: { onSelectPlace: (place: Place) => void; onFocusSearch: () => void; activeProviderLabel?: string; }) { const [isDaytime, setIsDaytime] = useState(true); useEffect(() => { const hour = new Date().getHours(); setIsDaytime(hour >= 6 && hour < 19); }, []); return (
{activeProviderLabel ? `${activeProviderLabel} active · Ready` : "Weather station ready"}
Search any town or city above, share your current coordinates, or choose a waypoint below to inspect live conditions, hourly horizons, and animated radar.
{item.label}
{item.title}
{item.detail}