|
271 | 271 | border-radius: var(--radius-sm) |
272 | 272 | } |
273 | 273 |
|
| 274 | + /* Hamburger that opens the off-canvas file drawer — the topbar's only tree affordance once |
| 275 | + the tree goes off-canvas. Hidden by default; revealed only under the ≤1100px media query |
| 276 | + (and re-hidden in single-file / file-mode, which have no tree). */ |
| 277 | + .nav-toggle { |
| 278 | + display: none; |
| 279 | + align-items: center; |
| 280 | + justify-content: center; |
| 281 | + width: 26px; |
| 282 | + height: 26px; |
| 283 | + padding: 0; |
| 284 | + margin-left: -4px; |
| 285 | + border: 0; |
| 286 | + border-radius: var(--radius-sm); |
| 287 | + background: transparent; |
| 288 | + color: var(--muted); |
| 289 | + cursor: pointer |
| 290 | + } |
| 291 | + |
| 292 | + .nav-toggle:hover { |
| 293 | + background: var(--surface-raised); |
| 294 | + color: var(--ink) |
| 295 | + } |
| 296 | + |
| 297 | + /* Scrim behind the open file drawer; CSS-gated to narrow widths (see media query). */ |
| 298 | + .tree-backdrop { |
| 299 | + display: none |
| 300 | + } |
| 301 | + |
274 | 302 | .actions { |
275 | 303 | justify-self: end; |
276 | 304 | display: flex; |
|
427 | 455 | display: inline-flex |
428 | 456 | } |
429 | 457 |
|
| 458 | + /* No tree exists in these modes (tree is display:none below), so suppress the drawer toggle. */ |
| 459 | + body.single .nav-toggle, |
| 460 | + body.file-mode .nav-toggle { |
| 461 | + display: none !important |
| 462 | + } |
| 463 | + |
430 | 464 | .right { |
431 | 465 | border-left: 1px solid var(--line) |
432 | 466 | } |
|
2482 | 2516 | margin-left: 4px |
2483 | 2517 | } |
2484 | 2518 |
|
| 2519 | + /* Narrow widths: the file tree leaves the flow and becomes an off-canvas left drawer, so the |
| 2520 | + app stays a fixed-height single column with the diff filling it (the core surface owns the |
| 2521 | + screen) — no more tree-on-top page-scroll stacking. The tree is hidden by default and slides |
| 2522 | + in over a dimmed backdrop when opened (hamburger / ⇧B); selecting a file auto-closes it. */ |
2485 | 2523 | @media(max-width:1100px) { |
2486 | | - body { |
2487 | | - overflow: auto |
| 2524 | + .main { |
| 2525 | + grid-template-columns: minmax(0, 1fr) |
2488 | 2526 | } |
2489 | 2527 |
|
2490 | | - .app { |
2491 | | - height: auto; |
2492 | | - min-height: 100% |
| 2528 | + .resizer { |
| 2529 | + display: none |
2493 | 2530 | } |
2494 | 2531 |
|
2495 | | - .main { |
2496 | | - grid-template-columns: 1fr |
| 2532 | + .nav-toggle { |
| 2533 | + display: inline-flex |
2497 | 2534 | } |
2498 | 2535 |
|
2499 | | - .resizer { |
2500 | | - display: none |
| 2536 | + .tree { |
| 2537 | + position: fixed; |
| 2538 | + top: 48px; |
| 2539 | + left: 0; |
| 2540 | + bottom: 0; |
| 2541 | + width: min(86vw, 300px); |
| 2542 | + z-index: 30; |
| 2543 | + border-right: 1px solid var(--line); |
| 2544 | + box-shadow: 8px 0 24px rgba(0, 0, 0, .35); |
| 2545 | + transform: translateX(-100%); |
| 2546 | + transition: transform .18s ease |
| 2547 | + } |
| 2548 | + |
| 2549 | + .tree.drawer-open { |
| 2550 | + transform: translateX(0) |
2501 | 2551 | } |
2502 | 2552 |
|
2503 | | - .tree, |
2504 | | - .right { |
2505 | | - border: 0; |
2506 | | - border-bottom: 1px solid var(--line) |
| 2553 | + .tree-backdrop.open { |
| 2554 | + display: block; |
| 2555 | + position: fixed; |
| 2556 | + inset: 48px 0 0 0; |
| 2557 | + z-index: 29; |
| 2558 | + background: rgba(0, 0, 0, .5) |
2507 | 2559 | } |
2508 | 2560 |
|
| 2561 | + /* Float the comment surfaces over the diff rather than in-flow — an in-flow element would |
| 2562 | + add a row to the now fixed-height single column and clip the diff. */ |
2509 | 2563 | .action-pop, |
2510 | 2564 | .composer { |
2511 | | - position: static; |
| 2565 | + position: fixed; |
| 2566 | + left: 12px; |
| 2567 | + right: 12px; |
| 2568 | + bottom: 12px; |
| 2569 | + top: auto; |
2512 | 2570 | width: auto; |
2513 | | - margin: 12px |
| 2571 | + max-width: none; |
| 2572 | + margin: 0; |
| 2573 | + z-index: 40 |
2514 | 2574 | } |
2515 | 2575 | } |
2516 | 2576 |
|
|
2538 | 2598 | <body> |
2539 | 2599 | <div class="app" x-data> |
2540 | 2600 | <header class="top"> |
2541 | | - <div class="brand"><svg class="brand-logo" aria-hidden="true" viewBox="4 -5 120 120" fill="none" xmlns="http://www.w3.org/2000/svg"><g filter="url(#hb_f0)"><circle cx="54.0259" cy="55.9741" r="44.0259" fill="#EB5103"/></g><g filter="url(#hb_f1)"><circle cx="72.6284" cy="55.9741" r="44.0259" fill="#EFCA44"/></g><g filter="url(#hb_f2)"><circle cx="64.5923" cy="54.0259" r="44.0259" fill="#FAF6EA"/></g><defs><filter id="hb_f0" x="0.699" y="2.647" width="106.654" height="106.654" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="bg"/><feBlend mode="normal" in="SourceGraphic" in2="bg" result="shape"/><feGaussianBlur stdDeviation="4.6505"/></filter><filter id="hb_f1" x="19.301" y="2.647" width="106.654" height="106.654" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="bg"/><feBlend mode="normal" in="SourceGraphic" in2="bg" result="shape"/><feGaussianBlur stdDeviation="4.6505"/></filter><filter id="hb_f2" x="11.265" y="0.699" width="106.654" height="106.654" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="bg"/><feBlend mode="normal" in="SourceGraphic" in2="bg" result="shape"/><feGaussianBlur stdDeviation="4.6505"/></filter></defs></svg><span>Galley</span></div> |
| 2601 | + <div class="brand"><button class="nav-toggle" data-tip="Files (⇧B)" aria-label="Toggle file tree" |
| 2602 | + @click="$store.g.treeDrawerOpen = !$store.g.treeDrawerOpen"><svg class="ic" viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M2 4h12M2 8h12M2 12h12"/></svg></button><svg class="brand-logo" aria-hidden="true" viewBox="4 -5 120 120" fill="none" xmlns="http://www.w3.org/2000/svg"><g filter="url(#hb_f0)"><circle cx="54.0259" cy="55.9741" r="44.0259" fill="#EB5103"/></g><g filter="url(#hb_f1)"><circle cx="72.6284" cy="55.9741" r="44.0259" fill="#EFCA44"/></g><g filter="url(#hb_f2)"><circle cx="64.5923" cy="54.0259" r="44.0259" fill="#FAF6EA"/></g><defs><filter id="hb_f0" x="0.699" y="2.647" width="106.654" height="106.654" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="bg"/><feBlend mode="normal" in="SourceGraphic" in2="bg" result="shape"/><feGaussianBlur stdDeviation="4.6505"/></filter><filter id="hb_f1" x="19.301" y="2.647" width="106.654" height="106.654" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="bg"/><feBlend mode="normal" in="SourceGraphic" in2="bg" result="shape"/><feGaussianBlur stdDeviation="4.6505"/></filter><filter id="hb_f2" x="11.265" y="0.699" width="106.654" height="106.654" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="bg"/><feBlend mode="normal" in="SourceGraphic" in2="bg" result="shape"/><feGaussianBlur stdDeviation="4.6505"/></filter></defs></svg><span>Galley</span></div> |
2542 | 2603 | <div class="toggles"> |
2543 | 2604 | <div class="toggle" x-show="$store.g.isMarkdownFile()" data-tip="Rendered / source (m)"><button :class="{active: $store.g.fileView==='rendered'}" |
2544 | 2605 | @click="$store.g.setFileView('rendered')">Rendered</button><button |
|
2555 | 2616 | <div class="top-progress" id="progressStrip" style="display:none"><i id="progressFill"></i></div> |
2556 | 2617 | </header> |
2557 | 2618 | <main class="main"> |
2558 | | - <aside class="tree"> |
| 2619 | + <aside class="tree" :class="{'drawer-open': $store.g.treeDrawerOpen}"> |
2559 | 2620 | <div class="tree-tabs" x-show="$store.g.hasGuide && $store.g.hasGuide()" x-cloak> |
2560 | 2621 | <!-- The w hint sits on the INACTIVE tab — the one pressing w switches to. --> |
2561 | 2622 | <button :class="{active: $store.g.sidebarTab==='tree'}" @click="$store.g.sidebarTab='tree'">Tree <kbd x-show="$store.g.sidebarTab!=='tree'">w</kbd></button> |
|
2605 | 2666 | </div> |
2606 | 2667 | <button class="tree-settings" @click="$store.g.openSettings()"><svg class="ic"><use href="#gly-settings"></use></svg><span>Settings</span><kbd>⇧,</kbd></button> |
2607 | 2668 | </aside> |
| 2669 | + <!-- Narrow-width only (CSS-gated): dims the diff behind the open file drawer; tap to close. --> |
| 2670 | + <div class="tree-backdrop" :class="{open: $store.g.treeDrawerOpen}" @click="$store.g.treeDrawerOpen=false"></div> |
2608 | 2671 | <div class="resizer" data-resize="left"></div> |
2609 | 2672 | <section class="center"> |
2610 | 2673 | <div class="guidebar" x-show="$store.g.showGuideBar && $store.g.showGuideBar()" x-cloak> |
|
0 commit comments