Use the shared key legend and touch section in help
The help dialog's key list is .kbd-grid and its touch section .touch-only; the local modal-head and pause-button workarounds are gone.
This commit is contained in:
parent
ccb3a53e70
commit
a695a5cf1f
3 changed files with 33 additions and 22 deletions
16
build.js
16
build.js
|
|
@ -368,15 +368,9 @@ ${BASELINE}<link rel="stylesheet" href="fonts/carino-fonts.css">
|
||||||
for good after one play and never reappears on resize or fullscreen change. */
|
for good after one play and never reappears on resize or fullscreen change. */
|
||||||
@keyframes hint { 0% { opacity: 0 } 12% { opacity: .6 } 70% { opacity: .6 } 100% { opacity: 0 } }
|
@keyframes hint { 0% { opacity: 0 } 12% { opacity: .6 } 70% { opacity: .6 } 100% { opacity: 0 } }
|
||||||
@media (prefers-reduced-motion: reduce) { #hint { animation-duration: 14s } }
|
@media (prefers-reduced-motion: reduce) { #hint { animation-duration: 14s } }
|
||||||
/* The help overlay: Branding's modal; the touch section shows on coarse pointers only. */
|
/* The help overlay: Branding's modal, .kbd-grid key list and .touch-only touch section. */
|
||||||
.cc-keys { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; align-items: center;
|
.cc-keys { margin: 12px 0 0; }
|
||||||
margin: 12px 0 0; font-family: var(--mono); font-size: var(--fs-btn); color: var(--text-muted); }
|
.cc-touch { margin: 14px 0 0; }
|
||||||
.cc-keys dt { white-space: nowrap; }
|
|
||||||
.cc-keys dd { margin: 0; text-transform: uppercase; letter-spacing: .06em; }
|
|
||||||
.cc-touch { display: none; margin: 14px 0 0; }
|
|
||||||
.modal-head > div:first-child { flex: 1; }
|
|
||||||
@media (pointer: coarse) { .cc-touch { display: block; } }
|
|
||||||
#ccPause[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-faint); }
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body class="play-body">
|
<body class="play-body">
|
||||||
|
|
@ -396,11 +390,11 @@ ${BASELINE}<link rel="stylesheet" href="fonts/carino-fonts.css">
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p style="margin:0" data-i18n>Four worlds drawn in text characters. Leave it alone and it walks itself; take the camera whenever you like. Opening this pauses the city.</p>
|
<p style="margin:0" data-i18n>Four worlds drawn in text characters. Leave it alone and it walks itself; take the camera whenever you like. Opening this pauses the city.</p>
|
||||||
<div class="cc-touch">
|
<div class="cc-touch touch-only">
|
||||||
<div class="modal-sub" data-i18n>Touch</div>
|
<div class="modal-sub" data-i18n>Touch</div>
|
||||||
<p style="margin:6px 0 0" data-i18n>Left half of the screen walks, right half looks. Tap the city for fullscreen.</p>
|
<p style="margin:6px 0 0" data-i18n>Left half of the screen walks, right half looks. Tap the city for fullscreen.</p>
|
||||||
</div>
|
</div>
|
||||||
<dl class="cc-keys">
|
<dl class="kbd-grid cc-keys">
|
||||||
<dt><span class="kbd">W</span> <span class="kbd">A</span> <span class="kbd">S</span> <span class="kbd">D</span></dt><dd data-i18n>Walk</dd>
|
<dt><span class="kbd">W</span> <span class="kbd">A</span> <span class="kbd">S</span> <span class="kbd">D</span></dt><dd data-i18n>Walk</dd>
|
||||||
<dt><span class="kbd">←</span> <span class="kbd">→</span> <span class="kbd">↑</span> <span class="kbd">↓</span></dt><dd data-i18n>Look (or drag)</dd>
|
<dt><span class="kbd">←</span> <span class="kbd">→</span> <span class="kbd">↑</span> <span class="kbd">↓</span></dt><dd data-i18n>Look (or drag)</dd>
|
||||||
<dt><span class="kbd">Shift</span> <span class="kbd">C</span></dt><dd data-i18n>Run, crouch</dd>
|
<dt><span class="kbd">Shift</span> <span class="kbd">C</span></dt><dd data-i18n>Run, crouch</dd>
|
||||||
|
|
|
||||||
|
|
@ -394,6 +394,10 @@
|
||||||
.kbd.accent { color: var(--accent); border-color: var(--accent-dim); }
|
.kbd.accent { color: var(--accent); border-color: var(--accent-dim); }
|
||||||
.kbd-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-family: var(--mono); font-size: var(--fs-btn); color: var(--text-muted); }
|
.kbd-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-family: var(--mono); font-size: var(--fs-btn); color: var(--text-muted); }
|
||||||
.kbd-legend .lbl { text-transform: uppercase; letter-spacing: 0.06em; }
|
.kbd-legend .lbl { text-transform: uppercase; letter-spacing: 0.06em; }
|
||||||
|
/* help dialogs: keys beside what they do, as a <dl> */
|
||||||
|
.kbd-grid { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; align-items: center; margin: 0; font-family: var(--mono); font-size: var(--fs-btn); color: var(--text-sec); }
|
||||||
|
.kbd-grid dt { white-space: nowrap; }
|
||||||
|
.kbd-grid dd { margin: 0; text-transform: uppercase; letter-spacing: 0.06em; }
|
||||||
|
|
||||||
|
|
||||||
/* ── Data Viz ──────────────────────────────────────────────────────────
|
/* ── Data Viz ──────────────────────────────────────────────────────────
|
||||||
|
|
@ -657,6 +661,25 @@
|
||||||
.slice-menu.collapsed .s-num, body.state-module .slice-menu .s-num { display: none; }
|
.slice-menu.collapsed .s-num, body.state-module .slice-menu .s-num { display: none; }
|
||||||
}
|
}
|
||||||
@media (prefers-reduced-motion: reduce) { .slice-menu .slice, .slice-menu .slice::before { transition: none; } .slice-menu .slice:hover { flex: 1; } }
|
@media (prefers-reduced-motion: reduce) { .slice-menu .slice, .slice-menu .slice::before { transition: none; } .slice-menu .slice:hover { flex: 1; } }
|
||||||
|
/* .grid: many modules (a course). The overview wraps into tiles instead of
|
||||||
|
one row of columns, and the open-module bar keeps each tab at its
|
||||||
|
natural width and scrolls sideways. Reference: Learn, Hash. */
|
||||||
|
.slice-menu.grid { flex-wrap: wrap; }
|
||||||
|
.slice-menu.grid:not(.collapsed) .slice { flex: 1 1 280px; min-width: 240px; justify-content: flex-start; gap: 8px; padding: 22px 20px; border-bottom: 1px solid var(--border); }
|
||||||
|
.slice-menu.grid:not(.collapsed) .slice:hover, .slice-menu.grid:not(.collapsed) .slice:focus-visible { flex: 1.12 1 280px; }
|
||||||
|
.slice-menu.grid:not(.collapsed) .s-text { font-size: var(--fs-h3); }
|
||||||
|
body.state-module .slice-menu.grid, .slice-menu.grid.collapsed { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
|
||||||
|
@media (min-width: 641px) { body.state-module .slice-menu.grid .slice, .slice-menu.grid.collapsed .slice { flex: 0 0 auto; min-width: 110px; } }
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
.slice-menu.grid:not(.collapsed) .slice, .slice-menu.grid:not(.collapsed) .slice:hover { flex: none; min-width: 0; padding: 18px 16px; }
|
||||||
|
}
|
||||||
|
/* a tile's own progress: "3 / 8" and a fluid .progress bar */
|
||||||
|
.slice .s-count { font-family: var(--mono); font-size: var(--fs-label); color: var(--text-muted); font-variant-numeric: tabular-nums; }
|
||||||
|
.slice.is-complete .s-count { color: var(--accent); }
|
||||||
|
.slice .s-prog { width: 100%; height: 5px; }
|
||||||
|
body.state-module .slice-menu .s-prog, .slice-menu.collapsed .s-prog,
|
||||||
|
body.state-module .slice-menu .s-count, .slice-menu.collapsed .s-count { display: none; }
|
||||||
|
.slice-menu.grid:not(.collapsed) .s-count { margin-top: auto; padding-top: 6px; }
|
||||||
|
|
||||||
/* ============ filter chips ============
|
/* ============ filter chips ============
|
||||||
A Reference page's first control: a sticky bar of facet chips, one
|
A Reference page's first control: a sticky bar of facet chips, one
|
||||||
|
|
|
||||||
16
index.html
16
index.html
|
|
@ -50,15 +50,9 @@
|
||||||
for good after one play and never reappears on resize or fullscreen change. */
|
for good after one play and never reappears on resize or fullscreen change. */
|
||||||
@keyframes hint { 0% { opacity: 0 } 12% { opacity: .6 } 70% { opacity: .6 } 100% { opacity: 0 } }
|
@keyframes hint { 0% { opacity: 0 } 12% { opacity: .6 } 70% { opacity: .6 } 100% { opacity: 0 } }
|
||||||
@media (prefers-reduced-motion: reduce) { #hint { animation-duration: 14s } }
|
@media (prefers-reduced-motion: reduce) { #hint { animation-duration: 14s } }
|
||||||
/* The help overlay: Branding's modal; the touch section shows on coarse pointers only. */
|
/* The help overlay: Branding's modal, .kbd-grid key list and .touch-only touch section. */
|
||||||
.cc-keys { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; align-items: center;
|
.cc-keys { margin: 12px 0 0; }
|
||||||
margin: 12px 0 0; font-family: var(--mono); font-size: var(--fs-btn); color: var(--text-muted); }
|
.cc-touch { margin: 14px 0 0; }
|
||||||
.cc-keys dt { white-space: nowrap; }
|
|
||||||
.cc-keys dd { margin: 0; text-transform: uppercase; letter-spacing: .06em; }
|
|
||||||
.cc-touch { display: none; margin: 14px 0 0; }
|
|
||||||
.modal-head > div:first-child { flex: 1; }
|
|
||||||
@media (pointer: coarse) { .cc-touch { display: block; } }
|
|
||||||
#ccPause[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-faint); }
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body class="play-body">
|
<body class="play-body">
|
||||||
|
|
@ -78,11 +72,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p style="margin:0" data-i18n>Four worlds drawn in text characters. Leave it alone and it walks itself; take the camera whenever you like. Opening this pauses the city.</p>
|
<p style="margin:0" data-i18n>Four worlds drawn in text characters. Leave it alone and it walks itself; take the camera whenever you like. Opening this pauses the city.</p>
|
||||||
<div class="cc-touch">
|
<div class="cc-touch touch-only">
|
||||||
<div class="modal-sub" data-i18n>Touch</div>
|
<div class="modal-sub" data-i18n>Touch</div>
|
||||||
<p style="margin:6px 0 0" data-i18n>Left half of the screen walks, right half looks. Tap the city for fullscreen.</p>
|
<p style="margin:6px 0 0" data-i18n>Left half of the screen walks, right half looks. Tap the city for fullscreen.</p>
|
||||||
</div>
|
</div>
|
||||||
<dl class="cc-keys">
|
<dl class="kbd-grid cc-keys">
|
||||||
<dt><span class="kbd">W</span> <span class="kbd">A</span> <span class="kbd">S</span> <span class="kbd">D</span></dt><dd data-i18n>Walk</dd>
|
<dt><span class="kbd">W</span> <span class="kbd">A</span> <span class="kbd">S</span> <span class="kbd">D</span></dt><dd data-i18n>Walk</dd>
|
||||||
<dt><span class="kbd">←</span> <span class="kbd">→</span> <span class="kbd">↑</span> <span class="kbd">↓</span></dt><dd data-i18n>Look (or drag)</dd>
|
<dt><span class="kbd">←</span> <span class="kbd">→</span> <span class="kbd">↑</span> <span class="kbd">↓</span></dt><dd data-i18n>Look (or drag)</dd>
|
||||||
<dt><span class="kbd">Shift</span> <span class="kbd">C</span></dt><dd data-i18n>Run, crouch</dd>
|
<dt><span class="kbd">Shift</span> <span class="kbd">C</span></dt><dd data-i18n>Run, crouch</dd>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue