Spaces:
Running
Running
Tutorial: pin coachmarks to a bottom banner so they never cover the UI
Browse filesThe center-anchored callouts (opener, create-modal steps) obscured the map/modal/picker.
Route every step to one consistent banner low on the screen (centred, above the controls
+ picker) — readable, click-through everywhere else, and 'starts at the bottom'. Verified:
opener sits in the bottom third with the picker fully clickable below it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- web/tutorial.js +8 -9
web/tutorial.js
CHANGED
|
@@ -9,15 +9,14 @@ const save = (s) => { try { localStorage.setItem(KEY, JSON.stringify(s)) } catch
|
|
| 9 |
function elc(tag, css, text) { const n = document.createElement(tag); if (css) n.style.cssText = css; if (text != null) n.textContent = text; return n }
|
| 10 |
|
| 11 |
// Place a fixed-position callout in a screen region, offset so it doesn't cover the control.
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
}
|
| 21 |
|
| 22 |
export function createTutorial(steps) {
|
| 23 |
let state = { step: 0, done: false, dismissed: false, ...load() }
|
|
|
|
| 9 |
function elc(tag, css, text) { const n = document.createElement(tag); if (css) n.style.cssText = css; if (text != null) n.textContent = text; return n }
|
| 10 |
|
| 11 |
// Place a fixed-position callout in a screen region, offset so it doesn't cover the control.
|
| 12 |
+
// All anchors sit in the LOWER part of the screen so the callout never covers the map, the create
|
| 13 |
+
// modal, the picker or the top UI — and you can still read + click through. 'bottom' is the default
|
| 14 |
+
// banner (centred, just above the on-screen controls); the others nudge left/right toward a control.
|
| 15 |
+
// One consistent banner low on the screen (centred, above the on-screen controls + picker) so the
|
| 16 |
+
// callout never covers the map, the create modal, the picker or the top UI — you can read it and
|
| 17 |
+
// still click through everywhere else. Every step maps here.
|
| 18 |
+
const BANNER = 'left:50%;bottom:170px;transform:translateX(-50%)'
|
| 19 |
+
const REGION = { center: BANNER, bottom: BANNER, 'bottom-center': BANNER, 'bottom-left': BANNER, 'bottom-right': BANNER, 'top-left': BANNER, 'top-right': BANNER, right: BANNER }
|
|
|
|
| 20 |
|
| 21 |
export function createTutorial(steps) {
|
| 22 |
let state = { step: 0, done: false, dismissed: false, ...load() }
|