The globe's nerd stats are instruments in the scene
Owner decision 2026-10-06: the globe tells its numbers where they belong instead of in a table. instruments.js adds one three.js group to globe.gl's scene and a DOM overlay of chips: - the Sun: a ray and a bead over the subsolar point (with the irradiance), the day/night line, the golden hour and the three twilights, the declination, the noon and midnight meridian, and the analemma at this hour, its stretch to the next equinox or solstice brighter; - a focused post's place: its horizon, its Sun's line and height, and its day lit on its latitude, with one chip for the place, the phase, the solar time, the elevation and the day's length; - the tropics and polar circles (the axial tilt), the CDN ring, the view's centre and spread, and rings around the posts in view; - a small orrery in the top left corner, re-anchored to the camera before each render, with the Earth–Sun distance, the seasons, the next equinox or solstice and the next perihelion or aphelion stacked under it; - the frame rate as a ring around the globe; the rest (points, textures, countries, renderer) as a legend. The chips are placed after each frame globe.gl draws, clear of each other, the moment's caption, the orrery and the legend, and slide back inside the canvas at its edge; country names keep clear of them. Geometry changes only inside a wake globe.js already made, so an idle globe still draws nothing. three.js's classes come from globe.gl's own objects, looked for before each render until its globe is in the scene. A phone's banner draws the day/night line and the subsolar point; full screen draws everything, and a globe built in the banner now moves its camera back when opened full screen. GlobePanel loses both tooltips and the one-second poll that read every post into a table; the Sun's rows stay as screen-reader text, and a failed start says so. Seven keys only the tooltips used are gone. GlobeTests (desktop with a located post written from Milano and pinned, in both themes and turned to the subsolar point; a phone's banner, full screen and back; an idle globe drawing no frame) pass. Under SwiftShader the instruments cost 1–3 ms of a ~50 ms frame and under 0.1 ms of script; FeedPerfTests' heaps are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
e88f4afc45
commit
e94e32d198
9 files changed
+1516
-181
No files matched your search
+131
@@ -130,4 +130,135 @@
|
||||
outline: 2px solid var(--color-accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* The globe's instruments (wwwroot/js/instruments.js): an overlay of chips beside what is drawn in the scene, the
|
||||
frame-rate ring around the globe and a two-line legend. It never takes the pointer. Each chip's colour is its
|
||||
instrument's: the Sun's warning, the twilights' info, the place's accent, the view's primary. */
|
||||
.globe-instruments {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 1000;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
contain: layout paint;
|
||||
}
|
||||
|
||||
.globe-tag {
|
||||
--tag: var(--color-base-content);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
font: 10px/1.25 ui-monospace, SFMono-Regular, Menlo, monospace;
|
||||
white-space: nowrap;
|
||||
padding: 0.1rem 0.4rem;
|
||||
border-radius: 999px;
|
||||
color: var(--color-base-content);
|
||||
background: color-mix(in oklab, var(--color-base-100) 78%, transparent);
|
||||
border: 1px solid color-mix(in oklab, var(--tag) 70%, transparent);
|
||||
box-shadow: 0 1px 4px rgb(0 0 0 / 0.2);
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.globe-tag-sun,
|
||||
.globe-tag-sun-faint {
|
||||
--tag: var(--color-warning);
|
||||
}
|
||||
|
||||
.globe-tag-twilight {
|
||||
--tag: var(--color-info);
|
||||
}
|
||||
|
||||
/* a place's chip: its place, phase and solar time over its Sun's height and its day */
|
||||
.globe-tag-place {
|
||||
--tag: var(--color-accent);
|
||||
white-space: pre;
|
||||
text-align: center;
|
||||
border-radius: 0.6rem;
|
||||
}
|
||||
|
||||
.globe-tag-server {
|
||||
--tag: var(--color-primary);
|
||||
}
|
||||
|
||||
.globe-tag-white {
|
||||
--tag: rgb(255 255 255);
|
||||
}
|
||||
|
||||
.globe-tag-orrery {
|
||||
--tag: var(--color-base-content);
|
||||
}
|
||||
|
||||
.globe-tag-sun-faint,
|
||||
.globe-tag-orrery-faint {
|
||||
opacity: 0.7;
|
||||
border-style: dashed;
|
||||
}
|
||||
|
||||
.globe-tag-ring {
|
||||
--tag: var(--color-base-content);
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
/* a place's chip says the phase of its day */
|
||||
.globe-tag-place[data-phase="day"] {
|
||||
--tag: var(--color-warning);
|
||||
}
|
||||
|
||||
.globe-tag-place[data-phase="night"],
|
||||
.globe-tag-place[data-phase="astronomical"] {
|
||||
--tag: var(--color-neutral);
|
||||
}
|
||||
|
||||
.globe-ring {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.globe-ring-track {
|
||||
fill: none;
|
||||
stroke: color-mix(in oklab, var(--color-base-content) 18%, transparent);
|
||||
stroke-width: 1.5;
|
||||
}
|
||||
|
||||
.globe-ring-value {
|
||||
fill: none;
|
||||
stroke: var(--color-success);
|
||||
stroke-width: 2.5;
|
||||
stroke-linecap: round;
|
||||
transition: stroke-dasharray 0.6s ease-out;
|
||||
}
|
||||
|
||||
.globe-ring[data-pace="fair"] .globe-ring-value {
|
||||
stroke: var(--color-warning);
|
||||
}
|
||||
|
||||
.globe-ring[data-pace="poor"] .globe-ring-value {
|
||||
stroke: var(--color-error);
|
||||
}
|
||||
|
||||
.globe-ring[data-pace="idle"] .globe-ring-track,
|
||||
.globe-ring[data-pace="paused"] .globe-ring-track {
|
||||
stroke-dasharray: 2 6;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.globe-ring-value {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
.globe-legend {
|
||||
position: absolute;
|
||||
left: 0.5rem;
|
||||
bottom: 0.5rem;
|
||||
max-width: calc(100% - 1rem);
|
||||
font: 9px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
|
||||
white-space: pre-line;
|
||||
color: var(--color-base-content);
|
||||
opacity: 0.65;
|
||||
text-shadow: 0 0 3px var(--color-base-100);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user