Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions web/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -2262,6 +2262,7 @@ dialog.method::backdrop {
}
.rail .dock { flex-direction: row; align-items: center; height: 52px; border-radius: var(--radius-m); }
.rail .dock-item { justify-content: center; padding: 0 10px; }
.rail .dock-item:not(.on) .dock-name { display: none; }
.rail .dock-sep { width: 1px; height: 20px; margin: 0 4px; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.22), transparent); }
.rail .dock-label { left: 50%; top: auto; bottom: calc(100% + 12px); translate: -50% 0; }
.deck { bottom: calc(var(--sheet) + var(--edge) + 62px); }
Expand Down
6 changes: 1 addition & 5 deletions web/src/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -556,11 +556,7 @@ export function Panel(p: Props) {
content: (
<>
<AnimatedTabs size="sm" tabs={(["anomaly", "raw"] as const).map((k) => ({ id: k, label: t(lang, k) }))} value={menuView} onChange={setView} />
<Chart series={shown!} result={result!} view={menuView} unit={unit} decimals={v.decimals} startYear={eff[0]} endYear={eff[1]} lang={lang} bendYear={bend?.year} />
<button className="link-btn" onClick={() => p.onDrawer("chart")}>
<Icon name="expand" size={14} /> {tr ? "Dönem ve mevsim ayarlarıyla aç" : "Open with period and season controls"}
</button>
</>
<Chart series={shown!} result={result!} view={menuView} unit={unit} decimals={v.decimals} startYear={eff[0]} endYear={eff[1]} lang={lang} bendYear={bend?.year} /> </>
),
onClick: () => setOpenRow(openRow === "graph" ? null : "graph"),
}
Expand Down
21 changes: 5 additions & 16 deletions web/src/VariableDock.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* Variable dock: the nine MERRA-2 variables in one floating bar along the bottom of the globe.
* The chosen variable shows its name next to its icon and a soft background slides to it
* (motion layoutId); the others are icons with a label on hover. Groups are split by thin
* Every variable shows its name next to its icon (on phones only the chosen one) and a soft
* background slides to the chosen one (motion layoutId); hover adds the unit. Groups are split by thin
* separators. Started from Magic UI "Dock" (MIT), magnification removed so the bar stays calm.
* Written with AI assistance (Claude).
*/
import { Fragment, useState } from "react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
import { motion, useReducedMotion } from "motion/react";
import type { VarId, VariableInfo } from "./data.ts";
import { VAR_GROUPS, VAR_ICONS } from "./content.ts";
import { Icon } from "./icons.tsx";
Expand Down Expand Up @@ -77,19 +77,8 @@ function DockItem(p: {
>
{p.active && <motion.span layoutId="dock-bg" className="dock-bg" transition={spring} />}
<Icon name={p.icon} size={18} />
<AnimatePresence initial={false}>
{p.active && (
<motion.span
className="dock-name"
initial={{ opacity: 0, width: 0 }}
animate={{ opacity: 1, width: "auto" }}
exit={{ opacity: 0, width: 0 }}
transition={p.reduce ? { duration: 0 } : { duration: 0.22, ease: [0.22, 1, 0.36, 1] }}
>
{p.name}
</motion.span>
)}
</AnimatePresence>
{/* every name stays on screen; on phones (row layout) CSS keeps only the chosen one */}
<span className="dock-name">{p.name}</span>
{hover && !p.active && (
<motion.span className="dock-label" initial={{ opacity: 0, y: 4 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.12 }}>
{p.label}
Expand Down
4 changes: 2 additions & 2 deletions web/src/responsive.css
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@
.period {
width: var(--left-w, 380px);
}
/* the rail starts right under the period card instead of floating at mid-screen */
/* the rail starts a little under the period card instead of floating at mid-screen */
.rail {
top: calc(var(--left-bottom, 176px) + 10px);
top: calc(var(--left-bottom, 176px) + 40px);
translate: none;
}
/* the legend sits on the same left edge, as wide as the rail column */
Expand Down
Loading