From 967b4647790d814c30fd461473a80ae5477e0408 Mon Sep 17 00:00:00 2001 From: Adam French Date: Thu, 15 Oct 2026 00:10:14 +0100 Subject: [PATCH] Make the landing page a box canvas, and add Link box templates The fixed bio-and-links page is gone; / is now an editable canvas (page key "index") like /stp. The old content is kept as boxes in landingLayout.js behind an "Import old landing page" button, which now shows on a non-empty canvas too and confirms before adding. The overlay mode only the landing page used is removed from BoxCanvas. New "Link" and "Link row" HTML templates give bordered link buttons that open with target=_top/_blank, since the box is a sandboxed frame. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 2 +- vue/README.md | 19 +++--- vue/src/views/home3/BoxCanvas.vue | 77 +++++----------------- vue/src/views/home3/BoxEditor.vue | 5 +- vue/src/views/home3/templates.js | 33 +++++++++- vue/src/views/landing/Landing.vue | 88 +++++--------------------- vue/src/views/landing/landingLayout.js | 79 +++++++++++++++++++++++ 7 files changed, 155 insertions(+), 148 deletions(-) create mode 100644 vue/src/views/landing/landingLayout.js diff --git a/CLAUDE.md b/CLAUDE.md index 0de0316..f6d3949 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -82,7 +82,7 @@ Dockerized multi-service personal website self-hosted on a Raspberry Pi. - `src/graphql.js` — thin axios-based GraphQL client (`POST /api/graphql`) - `src/api.js` — thin REST client for the `/api` JSON endpoints; failures become an `ApiError` carrying the backend's `error` message and the status - `src/stores/` — Pinia stores for auth, posts, favorites, activities, songs, messages, homeData, places, boxes, pages. `createCrudStore.js` is the factory behind places, boxes and pages; `createMirrorStore.js` is the one behind the home-page slices -- `src/views/` — page components (Home, Admin, CV, Notes, Bookmarks, shrines). `/stp` is `views/home3/Home3.vue`: a canvas of admin-arranged boxes (built-in widgets or sandboxed-iframe HTML) stored as the `Box` GraphQL type. The canvas (`views/home3/BoxCanvas.vue`) is reusable per page key: the landing page overlays one for notes, and admin-created `Page`s (e.g. shrines) are served at `/` by the router's catch-all, `views/canvas/CanvasPage.vue`. Boxes and pages can be admin-only, filtered server-side. See "The /stp canvas" in `vue/README.md` +- `src/views/` — page components (Home, Admin, CV, Notes, Bookmarks, shrines). `/stp` is `views/home3/Home3.vue`: a canvas of admin-arranged boxes (built-in widgets or sandboxed-iframe HTML) stored as the `Box` GraphQL type. The canvas (`views/home3/BoxCanvas.vue`) is reusable per page key: the landing page (`/`) is one too, and admin-created `Page`s (e.g. shrines) are served at `/` by the router's catch-all, `views/canvas/CanvasPage.vue`. Boxes and pages can be admin-only, filtered server-side. See "The /stp canvas" in `vue/README.md` - `src/components/` — reusable UI components - `src/assets/styles.css` — design tokens (Tailwind `@theme`), base element styles, shared classes and transitions. `layouts/CVLayout.vue` re-points the colour tokens for the light CV theme. See "Styling" in `vue/README.md`. diff --git a/vue/README.md b/vue/README.md index 64bb6ab..1e76b37 100644 --- a/vue/README.md +++ b/vue/README.md @@ -65,7 +65,7 @@ Two layout shells, defined in `src/router/index.js`: | Path | Layout | Notes | | --- | --- | --- | -| `/` | DefaultLayout | Landing page (statically imported — it's the first paint), with a canvas overlay for pinned notes (page key `index`) | +| `/` | DefaultLayout | Landing page (statically imported — it's the first paint): a box canvas, page key `index`; the old fixed page is its starter layout, `views/landing/landingLayout.js` | | `/stp` | DefaultLayout | The personal home page: an admin-editable canvas of boxes (`views/home3/`, see "The /stp canvas" below) | | `/admin`, `/admin/login` | DefaultLayout | `/admin` is guarded by `meta.requiresAdmin` | | `/automata`, `/hotels`, `/shrines` | DefaultLayout | Each shrine under `/shrines/` is a canvas page | @@ -205,10 +205,8 @@ so every visitor sees the saved layout. The canvas is `views/home3/BoxCanvas.vue and it is not only `/stp`: every box has a `page` key, and the same component renders any page's boxes. -- **Pages.** `"stp"` is `/stp` (`Home3.vue`). `"index"` is the landing page, - where the canvas is an `overlay` over the page's own content: it takes no - room when empty, lets clicks through except on boxes, and reports its height - so the page grows to fit. Any other key is the slug of a **`Page`** (GraphQL +- **Pages.** `"stp"` is `/stp` (`Home3.vue`). `"index"` is the landing page + (`Landing.vue`), which is nothing but the canvas. Any other key is the slug of a **`Page`** (GraphQL type, `stores/pages.js`), an admin-created page served at `/` by the router's catch-all (`views/canvas/CanvasPage.vue`). Pages are created from the admin panel's Pages tab, from `/shrines`, or from the 404 of the address @@ -244,13 +242,16 @@ renders any page's boxes. the save fails. `BoxEditor.vue` is the side panel. Settings save on change; HTML is a draft that previews live and saves with Save or Ctrl/Cmd+S. CodeMirror is loaded only when that panel opens; the panel is teleported to - `` so the landing overlay's `pointer-events: none` doesn't reach it. + ``. Image and video files dropped onto the canvas in edit mode are uploaded and each becomes an unframed box at the drop point. "Insert upload" stores a file through the chat's public upload endpoint and puts an ``/`