mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-28 23:50:08 +00:00
10713e41cd
Client lint, checks and tests were red on the globe Atlas: - The views own the globe and sky refs and hand them into useAtlasGlobe, so reading its state while rendering no longer counts as reading refs. - Helpers that shared a file with components move to their own modules (badge tiers, medal label, Dawarich notes, hub tabs, period label). - The place search derives its loading state, the search resets its active row on input, and the two silenced hook dependencies are named. - placeLabels, the hover chip and the overview figures are split up. - Raw text sizes become type tiers, the badge unlock docks on --z-overlay. - The stats card test follows the GlobeStat props; baselines lowered to the counts the run reported.
312 lines
8.0 KiB
CSS
312 lines
8.0 KiB
CSS
/*
|
|
* The globe Atlas chrome: glass capsules, labels, the country card.
|
|
* The globe is its own night sky, so the glass is tuned against it rather than
|
|
* against the app surfaces. The scene is a night sky in both modes; the controls
|
|
* on top (search, zoom, stats) follow the app's light or dark mode.
|
|
*/
|
|
.atlas-globe {
|
|
--ag-glass: linear-gradient(180deg, rgb(255 255 255 / 0.11), rgb(255 255 255 / 0.04));
|
|
--ag-glass-solid: rgb(16 20 34 / 0.9);
|
|
--ag-edge: rgb(255 255 255 / 0.13);
|
|
--ag-edge-hi: rgb(255 255 255 / 0.3);
|
|
--ag-hi: inset 0 1px 0 rgb(255 255 255 / 0.22);
|
|
--ag-shadow: 0 12px 32px rgb(0 0 0 / 0.38);
|
|
--ag-ink: rgb(238 242 255);
|
|
--ag-muted: rgb(150 160 182);
|
|
--ag-faint: rgb(100 110 132);
|
|
--ag-accent: rgb(125 211 252);
|
|
--ag-mint: rgb(94 234 212);
|
|
--ag-label: rgb(226 232 245 / 0.92);
|
|
--ag-label-shadow: 0 1px 2px rgb(0 0 0 / 0.85), 0 0 10px rgb(0 0 0 / 0.55);
|
|
position: relative;
|
|
color: var(--ag-ink);
|
|
background: rgb(3 5 12);
|
|
}
|
|
|
|
html:not(.dark) .ag-btn {
|
|
background: rgb(15 23 42 / 0.04);
|
|
}
|
|
|
|
html:not(.dark) .ag-btn[data-on='1'] {
|
|
background: rgb(37 99 235 / 0.12);
|
|
border-color: rgb(37 99 235 / 0.4);
|
|
}
|
|
|
|
html:not(.dark) .ag-bar {
|
|
background: rgb(15 23 42 / 0.08);
|
|
}
|
|
|
|
.ag-glass {
|
|
background: var(--ag-glass);
|
|
border: 1px solid var(--ag-edge);
|
|
box-shadow: var(--ag-hi), var(--ag-shadow);
|
|
backdrop-filter: blur(18px) saturate(150%);
|
|
-webkit-backdrop-filter: blur(18px) saturate(150%);
|
|
}
|
|
|
|
[data-no-transparency] .ag-glass,
|
|
.atlas-globe[data-moving='1'] .ag-glass-big {
|
|
backdrop-filter: none;
|
|
-webkit-backdrop-filter: none;
|
|
background: var(--ag-glass-solid);
|
|
}
|
|
|
|
.atlas-globe-label {
|
|
position: absolute;
|
|
left: 0; /* rtl-lint-disable: placed by a measured x on the canvas, physical on purpose */
|
|
top: 0;
|
|
white-space: nowrap;
|
|
font-weight: 500;
|
|
letter-spacing: 0.01em;
|
|
color: var(--ag-label);
|
|
text-shadow: var(--ag-label-shadow);
|
|
will-change: transform, opacity;
|
|
transition: opacity 0.25s;
|
|
}
|
|
|
|
.atlas-globe-label[data-region='1'] {
|
|
font-weight: 400;
|
|
opacity: 0.85;
|
|
letter-spacing: 0.02em;
|
|
}
|
|
|
|
.ag-num {
|
|
font-variant-numeric: tabular-nums;
|
|
letter-spacing: -0.02em;
|
|
}
|
|
|
|
.ag-muted {
|
|
color: var(--ag-muted);
|
|
}
|
|
|
|
.ag-faint {
|
|
color: var(--ag-faint);
|
|
}
|
|
|
|
.ag-btn {
|
|
border: 1px solid var(--ag-edge);
|
|
background: rgb(255 255 255 / 0.06);
|
|
transition:
|
|
border-color 0.2s,
|
|
background 0.2s;
|
|
}
|
|
|
|
.ag-btn:hover {
|
|
border-color: var(--ag-edge-hi);
|
|
}
|
|
|
|
.ag-btn[data-on='1'] {
|
|
background: rgb(125 211 252 / 0.18);
|
|
border-color: rgb(125 211 252 / 0.5);
|
|
}
|
|
|
|
.ag-bar {
|
|
height: 6px;
|
|
border-radius: 99px;
|
|
background: rgb(255 255 255 / 0.09);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.ag-bar > i {
|
|
display: block;
|
|
height: 100%;
|
|
border-radius: 99px;
|
|
background: linear-gradient(90deg, var(--ag-accent), var(--ag-mint));
|
|
box-shadow: 0 0 12px rgb(125 211 252 / 0.55);
|
|
transition: width 0.9s cubic-bezier(0.2, 0.9, 0.2, 1);
|
|
}
|
|
|
|
/* A badge in the Passport: a glass medal that tilts towards the pointer and flips. */
|
|
.ag-medal {
|
|
perspective: 600px;
|
|
cursor: default;
|
|
}
|
|
|
|
.ag-medal[data-earned='1'] {
|
|
cursor: pointer;
|
|
}
|
|
|
|
.ag-medal-body {
|
|
position: relative;
|
|
display: block;
|
|
width: 92px;
|
|
height: 104px;
|
|
transform-style: preserve-3d;
|
|
transform: rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) + var(--flip, 0deg)));
|
|
transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.25, 1.1);
|
|
}
|
|
|
|
.ag-medal[data-flipped='1'] {
|
|
--flip: 180deg;
|
|
}
|
|
|
|
.ag-medal-face,
|
|
.ag-medal-back {
|
|
position: absolute;
|
|
inset: 0;
|
|
backface-visibility: hidden;
|
|
}
|
|
|
|
.ag-medal-back {
|
|
transform: rotateY(180deg);
|
|
}
|
|
|
|
.ag-medal-shine {
|
|
position: absolute;
|
|
inset: 0;
|
|
clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
|
|
background:
|
|
radial-gradient(60% 45% at var(--mx, 30%) var(--my, 20%), rgb(255 255 255 / 0.5), rgb(255 255 255 / 0) 60%),
|
|
linear-gradient(
|
|
115deg,
|
|
rgb(125 211 252 / 0) 30%,
|
|
rgb(167 139 250 / 0.22) 45%,
|
|
rgb(94 234 212 / 0.2) 55%,
|
|
rgb(125 211 252 / 0) 70%
|
|
);
|
|
mix-blend-mode: screen;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.ag-medal[data-earned='0'] .ag-medal-shine {
|
|
opacity: 0.25;
|
|
}
|
|
|
|
.ag-shooting-star {
|
|
position: absolute;
|
|
width: 140px;
|
|
height: 2px;
|
|
border-radius: 99px;
|
|
transform-origin: right center;
|
|
background: linear-gradient(90deg, rgb(255 255 255 / 0), rgb(255 255 255 / 0.95));
|
|
box-shadow: 0 0 10px rgb(186 230 253 / 0.8);
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.ag-medal-body {
|
|
transform: rotateY(var(--flip, 0deg));
|
|
}
|
|
|
|
.ag-bar > i,
|
|
.atlas-globe-label {
|
|
transition: none;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* The controls on top of the scene wear TREK's map chrome, like every floating
|
|
* map control in the app: the sidebar surface, the app's text colours and the
|
|
* map control shadow. Only the scene itself (sky, globe, labels) is Atlas's own.
|
|
*/
|
|
:root .atlas-globe.atlas-globe {
|
|
--ag-glass: var(--sidebar-bg);
|
|
--ag-glass-solid: var(--sidebar-bg);
|
|
--ag-edge: var(--border-primary);
|
|
--ag-edge-hi: var(--text-faint, var(--border-primary));
|
|
--ag-hi: 0 0 0 0 transparent;
|
|
--ag-shadow: 0 2px 10px rgb(0 0 0 / 0.25);
|
|
--ag-ink: var(--text-primary);
|
|
--ag-muted: var(--text-muted);
|
|
--ag-faint: var(--text-faint, var(--text-muted));
|
|
}
|
|
|
|
:root .atlas-globe .ag-glass {
|
|
backdrop-filter: blur(20px) saturate(180%);
|
|
-webkit-backdrop-filter: blur(20px) saturate(180%);
|
|
}
|
|
|
|
/*
|
|
* TREK's liquid glass (the dashboard tiles' tokens, dashboard.css) for every
|
|
* control over the globe: shells, the stat cards inside them, the search, chips.
|
|
*/
|
|
.atlas-globe {
|
|
/* Over the night sky the dashboard's glass needs more white to still read as white. */
|
|
--glass-bg: linear-gradient(135deg, oklch(1 0 0 / 0.92) 0%, oklch(0.99 0.006 75 / 0.82) 100%);
|
|
--glass-border: oklch(1 0 0 / 0.75);
|
|
--glass-shadow: 0 1px 2px oklch(0.4 0.02 60 / 0.05), 0 12px 32px -14px oklch(0.3 0.02 60 / 0.2);
|
|
--glass-highlight: inset 0 1px 0 oklch(1 0 0 / 0.8);
|
|
--glass-blur: blur(22px) saturate(1.7);
|
|
--glass-card: oklch(1 0 0 / 0.7);
|
|
}
|
|
|
|
.dark .atlas-globe {
|
|
--glass-bg: linear-gradient(135deg, oklch(0.31 0 0 / 0.58) 0%, oklch(0.25 0 0 / 0.42) 100%);
|
|
--glass-border: oklch(1 0 0 / 0.1);
|
|
--glass-shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 12px 32px -14px oklch(0 0 0 / 0.55);
|
|
--glass-highlight: inset 0 1px 0 oklch(1 0 0 / 0.09);
|
|
--glass-card: oklch(1 0 0 / 0.05);
|
|
}
|
|
|
|
[data-no-transparency] .atlas-globe {
|
|
--glass-bg: var(--bg-card);
|
|
--glass-border: var(--border-primary);
|
|
--glass-highlight: 0 0 0 0 transparent;
|
|
--glass-blur: none;
|
|
--glass-card: var(--bg-tertiary, var(--bg-card));
|
|
}
|
|
|
|
.atlas-globe .ag-liquid {
|
|
background: var(--glass-bg);
|
|
border: 1px solid var(--glass-border);
|
|
box-shadow: var(--glass-shadow), var(--glass-highlight);
|
|
backdrop-filter: var(--glass-blur);
|
|
-webkit-backdrop-filter: var(--glass-blur);
|
|
}
|
|
|
|
.atlas-globe .ag-liquid-card {
|
|
background: var(--glass-card);
|
|
border: 1px solid var(--glass-border);
|
|
box-shadow: var(--glass-highlight);
|
|
}
|
|
|
|
.atlas-globe .ag-liquid-card:is(button):hover {
|
|
background: color-mix(in oklch, var(--glass-card), var(--text-primary) 6%);
|
|
}
|
|
|
|
/* A wish with coordinates pinned on the globe: a small amber disc with a star. */
|
|
.ag-pin {
|
|
display: grid;
|
|
place-items: center;
|
|
width: 22px;
|
|
height: 22px;
|
|
border-radius: 999px;
|
|
color: rgb(255 255 255);
|
|
background: rgb(245 158 11);
|
|
border: 1.5px solid rgb(255 255 255 / 0.9);
|
|
box-shadow:
|
|
0 2px 8px rgb(0 0 0 / 0.45),
|
|
0 0 14px rgb(251 191 36 / 0.45);
|
|
will-change: transform, opacity;
|
|
transition: opacity 0.2s;
|
|
}
|
|
|
|
.ag-pin[data-reached='1'] {
|
|
background: rgb(20 184 166);
|
|
box-shadow:
|
|
0 2px 8px rgb(0 0 0 / 0.45),
|
|
0 0 14px rgb(45 212 191 / 0.45);
|
|
}
|
|
|
|
/* The ring of light behind a badge that was just reached. */
|
|
.ag-unlock-ring {
|
|
position: absolute;
|
|
width: 220px;
|
|
height: 220px;
|
|
margin-top: -36px;
|
|
border-radius: 999px;
|
|
background: radial-gradient(circle, rgb(125 211 252 / 0.35) 0%, rgb(167 139 250 / 0.18) 40%, transparent 70%);
|
|
animation: ag-unlock-pulse 1.6s ease-out infinite;
|
|
pointer-events: none;
|
|
}
|
|
|
|
@keyframes ag-unlock-pulse {
|
|
0% {
|
|
transform: scale(0.7);
|
|
opacity: 0.9;
|
|
}
|
|
100% {
|
|
transform: scale(1.5);
|
|
opacity: 0;
|
|
}
|
|
}
|