Files
zhengwr 23cf3af678 Web template: adopt session-evolved features + render-on-demand everywhere
Ported from the test3d-5 session build: in-page variant switching, share
link (full state in URL hash), auto tour, toast, building-grouped floor
toggles, per-(floor,category) geometry merge (draw calls), progressive
overview->standard loading. Hardened during the port: {{BUILD}} placeholder
restored (Date.now() defeated caching), single-GLB deployments skip the
phantom overview.glb phase, building-group fallback now derives from
floor-key prefixes (assemble_campus convention) instead of a hardcoded "A"
test, bookmarks completed (list + restore + remove + hash persistence).

Render-on-demand lands in BOTH the template and the offline viewer: static
scenes rendered at 60fps pegged the GPU/fans for identical frames —
invalidate()-driven rendering + shadowMap.autoUpdate=false (bake per
change). 27号 measured: template web 0 frames over 3s idle, offline viewer
25 frames total through load; features browser-verified (tour, bookmarks,
hash restore), zero console errors. window.__renders is the diagnostic
counter — idle growth must be 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 12:55:03 +08:00

459 lines
7.6 KiB
CSS

:root {
color-scheme: dark;
--bg: #272a2d;
--panel: rgba(246, 244, 236, 0.92);
--panel-dark: #202326;
--ink: #151719;
--muted: #65707b;
--line: rgba(21, 23, 25, 0.14);
--accent: #2f7d70;
--blue: #2e5f9f;
--shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* {
box-sizing: border-box;
}
html,
body,
#app-shell {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
}
body {
background: var(--bg);
}
#scene {
position: fixed;
inset: 0;
width: 100%;
height: 100%;
display: block;
}
.panel {
position: fixed;
border: 1px solid rgba(255, 255, 255, 0.42);
border-radius: 8px;
background: var(--panel);
color: var(--ink);
box-shadow: var(--shadow);
backdrop-filter: blur(16px);
}
.project-panel {
top: 20px;
left: 20px;
width: min(360px, calc(100vw - 40px));
padding: 16px;
}
.project-title {
display: grid;
grid-template-columns: 12px minmax(0, 1fr);
gap: 12px;
align-items: center;
}
.mark {
width: 12px;
height: 44px;
border-radius: 3px;
background: linear-gradient(180deg, #2f7d70, #c58b2c);
}
h1 {
margin: 0;
color: var(--ink);
font-size: 19px;
line-height: 1.2;
letter-spacing: 0;
}
p {
margin: 4px 0 0;
color: var(--muted);
font-size: 13px;
line-height: 1.35;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 8px;
margin: 14px 0 0;
}
.stats-grid div {
min-width: 0;
padding: 8px;
border-radius: 6px;
background: rgba(255, 255, 255, 0.58);
border: 1px solid var(--line);
}
.stats-grid dt {
color: var(--muted);
font-size: 10px;
}
.stats-grid dd {
margin: 3px 0 0;
color: var(--ink);
font-size: 13px;
font-weight: 700;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.controls-panel {
left: 20px;
bottom: 20px;
width: min(384px, calc(100vw - 40px));
max-height: calc(100vh - 280px);
overflow-y: auto;
padding: 14px;
}
.controls-panel::-webkit-scrollbar {
width: 6px;
}
.controls-panel::-webkit-scrollbar-thumb {
background: rgba(0,0,0,0.18);
border-radius: 3px;
}
.control-group + .control-group {
margin-top: 13px;
padding-top: 13px;
border-top: 1px solid var(--line);
}
.group-label,
.range-row {
margin-bottom: 8px;
color: var(--muted);
font-size: 12px;
font-weight: 700;
}
.range-row {
display: flex;
justify-content: space-between;
margin-bottom: 8px;
}
/* ── Building-grouped floor controls ── */
.building-group {
margin-bottom: 10px;
}
.building-group:last-child {
margin-bottom: 0;
}
.building-header {
display: flex;
align-items: center;
gap: 7px;
padding: 5px 8px;
border-radius: 6px;
background: rgba(47, 125, 112, 0.1);
color: var(--accent);
font-size: 12px;
font-weight: 800;
cursor: pointer;
user-select: none;
margin-bottom: 5px;
}
.building-header input {
width: 13px;
height: 13px;
accent-color: var(--accent);
}
.building-label {
flex: 1;
}
.floor-list {
display: flex;
flex-wrap: wrap;
gap: 6px;
padding-left: 4px;
}
.toggle-grid {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.toggle {
min-height: 32px;
display: inline-flex;
align-items: center;
gap: 7px;
padding: 6px 9px;
border: 1px solid var(--line);
border-radius: 6px;
background: rgba(255, 255, 255, 0.58);
color: var(--ink);
font-size: 12px;
font-weight: 700;
cursor: pointer;
user-select: none;
}
.toggle input {
width: 13px;
height: 13px;
accent-color: var(--accent);
}
.swatch {
width: 11px;
height: 11px;
border-radius: 50%;
border: 1px solid rgba(0, 0, 0, 0.2);
}
/* ── Variant controls ── */
.variant-list {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.variant-btn {
min-height: 32px;
padding: 6px 12px;
border: 1px solid var(--line);
border-radius: 6px;
background: rgba(255, 255, 255, 0.58);
color: var(--ink);
font-size: 12px;
font-weight: 700;
cursor: pointer;
transition: background 0.15s;
}
.variant-btn:hover {
background: rgba(47, 125, 112, 0.12);
}
.variant-btn.active {
background: var(--accent);
color: #fff;
border-color: var(--accent);
}
.download-link {
min-height: 32px;
display: inline-flex;
align-items: center;
padding: 6px 10px;
border: 1px solid var(--line);
border-radius: 6px;
background: rgba(255, 255, 255, 0.58);
color: var(--ink);
font-size: 12px;
font-weight: 800;
text-decoration: none;
}
.download-link:hover {
background: rgba(47, 125, 112, 0.16);
}
input[type="range"] {
width: 100%;
accent-color: var(--blue);
}
.toolbar {
position: fixed;
right: 20px;
top: 20px;
display: flex;
flex-wrap: wrap;
gap: 8px;
padding: 8px;
border-radius: 8px;
background: rgba(32, 35, 38, 0.86);
box-shadow: var(--shadow);
backdrop-filter: blur(16px);
max-width: 200px;
}
.tool-button {
width: 40px;
height: 40px;
display: grid;
place-items: center;
border: 1px solid rgba(255, 255, 255, 0.16);
border-radius: 7px;
background: rgba(255, 255, 255, 0.08);
color: #f4f3ef;
cursor: pointer;
text-decoration: none;
}
.tool-button:hover,
.tool-button.active {
background: #2f7d70;
}
.tool-button svg {
width: 19px;
height: 19px;
}
.inspect-panel {
right: 20px;
bottom: 20px;
width: min(300px, calc(100vw - 40px));
padding: 14px;
}
.inspect-title {
font-size: 14px;
font-weight: 800;
}
.inspect-body {
margin-top: 5px;
color: var(--muted);
font-size: 12px;
line-height: 1.4;
}
.loading {
position: fixed;
inset: 0;
display: grid;
place-items: center;
gap: 12px;
align-content: center;
background: rgba(39, 42, 45, 0.82);
color: #f6f4ec;
font-size: 13px;
}
.loading.hidden {
display: none;
}
.loading-bar {
width: min(320px, 76vw);
height: 6px;
overflow: hidden;
border-radius: 999px;
background: rgba(255, 255, 255, 0.22);
}
.loading-bar span {
display: block;
width: 12%;
height: 100%;
background: #d1a445;
transition: width 0.3s;
}
/* ── Toast ── */
.toast {
position: fixed;
bottom: 80px;
left: 50%;
transform: translateX(-50%) translateY(20px);
padding: 10px 20px;
border-radius: 8px;
background: rgba(32, 35, 38, 0.95);
color: #f6f4ec;
font-size: 13px;
font-weight: 600;
box-shadow: var(--shadow);
opacity: 0;
pointer-events: none;
transition: opacity 0.25s, transform 0.25s;
z-index: 9999;
}
.toast.show {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
@media (max-width: 760px) {
.project-panel {
top: 10px;
left: 10px;
width: calc(100vw - 20px);
}
.toolbar {
top: auto;
right: 10px;
bottom: 10px;
max-width: 152px;
}
.controls-panel {
left: 10px;
bottom: 72px;
width: calc(100vw - 20px);
max-height: 43vh;
overflow: auto;
}
.inspect-panel {
display: none;
}
.stats-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
/* ── Camera bookmarks ─────────────────────────────── */
.bookmark-list {
display: flex;
flex-wrap: wrap;
gap: 6px;
max-width: 220px;
}
.bookmark-item {
display: inline-flex;
align-items: stretch;
border: 1px solid var(--line);
border-radius: 6px;
overflow: hidden;
background: rgba(255, 255, 255, 0.58);
}
.bookmark-item button {
border: 0;
background: transparent;
color: var(--ink);
font-size: 12px;
font-weight: 700;
padding: 4px 8px;
cursor: pointer;
}
.bookmark-item button:hover {
background: rgba(47, 125, 112, 0.12);
}
.bookmark-item .bookmark-remove {
padding: 4px 6px;
font-weight: 400;
opacity: 0.55;
border-left: 1px solid var(--line);
}