Make the box canvas reusable: canvas pages, admin-only boxes, landing notes
The /stp canvas is now BoxCanvas.vue, keyed by a page. Boxes carry a
page ("stp", "index" for the landing page's notes overlay, or a Page
slug) and an adminOnly flag that the boxes resolver filters server-side.
A new Page type lets the admin create canvas pages in the browser,
served at /<slug> by the router's catch-all (CanvasPage.vue), starting
from a Blank, Shrine or Notes-board layout. Slugs that an SPA or nginx
route would answer first are refused. Renaming a page moves its boxes;
deleting it deletes them.
The GTO, Evangelion and Skipskipbenben placeholder routes are dropped
in favour of canvas pages listed on /shrines, which the landing page
now links to. The box editor gains an admin-only toggle and an
upload-and-insert button, and there are Note, Heading, Text, Gallery
and Video templates.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
<script setup>
|
||||
/**
|
||||
* Route `/` — the professional front door. Deliberately plain: a short bio and a
|
||||
* row of links out to the CV, the personal home page (/stp), the projects that
|
||||
* run as their own containers, and social profiles.
|
||||
* row of links out to the CV, the personal home page (/stp), the shrines, the
|
||||
* projects that run as their own containers, and social profiles.
|
||||
* Statically imported by the router (it is the first paint).
|
||||
*
|
||||
* Over it lies a BoxCanvas overlay (page key "index"), where the admin pins
|
||||
* notes and anything else; admin-only notes are never sent to visitors. With
|
||||
* no boxes the overlay takes no room and the page is exactly as before.
|
||||
*/
|
||||
import { defineAsyncComponent, ref } from "vue";
|
||||
import Link from "@/components/text/Link.vue";
|
||||
import InlineLink from "@/components/text/InlineLink.vue";
|
||||
import Header from "@/components/text/Header.vue";
|
||||
@@ -18,6 +23,15 @@ const projects = [
|
||||
{ name: "USACO", href: "/usaco/" },
|
||||
];
|
||||
|
||||
// Loaded after first paint, in its own chunk: the landing page is the one
|
||||
// view in the main bundle, and the canvas brings the box editor with it.
|
||||
const BoxCanvas = defineAsyncComponent(() =>
|
||||
import("@/views/home3/BoxCanvas.vue"),
|
||||
);
|
||||
|
||||
// The overlay is absolutely positioned, so the page grows to contain it.
|
||||
const overlayHeight = ref(0);
|
||||
|
||||
const links = [
|
||||
{ name: "GitHub", href: "https://github.com/SteveThePug" },
|
||||
{ name: "Gitea", href: "/gitea/explore/repos" },
|
||||
@@ -26,41 +40,45 @@ const links = [
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main class="flex justify-center px-4 py-16">
|
||||
<div class="max-w-xl w-full flex flex-col gap-12">
|
||||
<section>
|
||||
<Header>Adam French</Header>
|
||||
<Paragraph>
|
||||
Junior software engineer focused on full-stack development, systems
|
||||
programming, and infrastructure. First Class Honours in Computer
|
||||
Science with Mathematics from Leeds and Waterloo.
|
||||
</Paragraph>
|
||||
</section>
|
||||
<main class="relative" :style="{ minHeight: `${overlayHeight}px` }">
|
||||
<div class="flex justify-center px-4 py-16">
|
||||
<div class="max-w-xl w-full flex flex-col gap-12">
|
||||
<section>
|
||||
<Header>Adam French</Header>
|
||||
<Paragraph>
|
||||
Junior software engineer focused on full-stack development, systems
|
||||
programming, and infrastructure. First Class Honours in Computer
|
||||
Science with Mathematics from Leeds and Waterloo.
|
||||
</Paragraph>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<Header>About</Header>
|
||||
<Paragraph>
|
||||
This website is self-hosted and has a lot more on it than it needs to.
|
||||
Please have a look at my
|
||||
<InlineLink to="/cv">CV</InlineLink> for a full breakdown of my
|
||||
experience, projects, and skills. Please visit
|
||||
<InlineLink to="/stp">STP</InlineLink> for the prefered but less
|
||||
professional experience.
|
||||
</Paragraph>
|
||||
</section>
|
||||
<section>
|
||||
<Header>About</Header>
|
||||
<Paragraph>
|
||||
This website is self-hosted and has a lot more on it than it needs to.
|
||||
Please have a look at my
|
||||
<InlineLink to="/cv">CV</InlineLink> for a full breakdown of my
|
||||
experience, projects, and skills. Please visit
|
||||
<InlineLink to="/stp">STP</InlineLink> for the prefered but less
|
||||
professional experience.
|
||||
</Paragraph>
|
||||
</section>
|
||||
|
||||
<nav class="navRow flex flex-row flex-wrap gap-4 justify-around">
|
||||
<Link to="/cv"> CV </Link>
|
||||
<Link to="/stp"> STP </Link>
|
||||
<Link v-for="p in projects" :key="p.name" :href="p.href">
|
||||
{{ p.name }}
|
||||
</Link>
|
||||
<Link href="mailto:[email protected]"> Email </Link>
|
||||
<Link v-for="link in links" :key="link.name" :href="link.href">
|
||||
{{ link.name }}
|
||||
</Link>
|
||||
</nav>
|
||||
<nav class="navRow flex flex-row flex-wrap gap-4 justify-around">
|
||||
<Link to="/cv"> CV </Link>
|
||||
<Link to="/stp"> STP </Link>
|
||||
<Link to="/shrines"> Shrines </Link>
|
||||
<Link v-for="p in projects" :key="p.name" :href="p.href">
|
||||
{{ p.name }}
|
||||
</Link>
|
||||
<Link href="mailto:[email protected]"> Email </Link>
|
||||
<Link v-for="link in links" :key="link.name" :href="link.href">
|
||||
{{ link.name }}
|
||||
</Link>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<BoxCanvas page="index" overlay @height="overlayHeight = $event" />
|
||||
</main>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user