Fix the landing notes editor, drop-to-upload pictures, retire Demoman
The box editor rendered inside the landing page's overlay canvas, which is pointer-events: none so the page underneath stays clickable; the panel inherited it and ignored every click and keystroke. It is now teleported to <body>. Image and video files dropped onto a canvas in edit mode are uploaded and each becomes an unframed box at the drop point, sized to its aspect ratio. The upload code moves to home3/upload.js, shared with the editor's "Insert upload". The hand-written Demoman shrine is unrouted (and its slug unreserved) so it can be remade as a canvas page. /shrines lists only canvas pages and keeps the admin-only create form behind a "+ New shrine" button. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -131,11 +131,11 @@ const galleryHtml = (srcs) => `<style>
|
||||
${srcs.map((src) => ` <img src="${src}" alt="">`).join("\n")}
|
||||
</div>`;
|
||||
|
||||
const VIDEO = `<style>
|
||||
const videoHtml = (src) => `<style>
|
||||
body { padding: 0; overflow: hidden; background: #000; }
|
||||
video { display: block; width: 100%; height: 100%; object-fit: contain; }
|
||||
</style>
|
||||
<video src="/img/demoman/1760582395316219.webm" controls loop muted></video>`;
|
||||
<video src="${src}" controls loop muted></video>`;
|
||||
|
||||
/**
|
||||
* Menu entries; `size` is [w, h] in canvas px. `adminOnly` sets the new
|
||||
@@ -147,10 +147,10 @@ export const TEMPLATES = [
|
||||
{ label: "Text", title: "Text", html: TEXT, size: [400, 260] },
|
||||
{ label: "Image / GIF", title: "Image", html: imageHtml("/img/memes/fire-woman.gif"), size: [240, 240], framed: false },
|
||||
{ label: "Image gallery", title: "Gallery", html: galleryHtml(["/img/memes/fire-woman.gif", "/img/memes/epic.jpeg"]), size: [460, 320] },
|
||||
{ label: "Video", title: "Video", html: VIDEO, size: [400, 260], framed: false },
|
||||
{ label: "Video", title: "Video", html: videoHtml("/img/demoman/1760582395316219.webm"), size: [400, 260], framed: false },
|
||||
{ label: "Clock", title: "Clock", html: CLOCK, size: [240, 120] },
|
||||
{ label: "Weather", title: "Weather", html: WEATHER, size: [240, 170] },
|
||||
{ label: "Empty HTML", title: "HTML", html: EMPTY, size: [300, 200] },
|
||||
];
|
||||
|
||||
export { imageHtml, galleryHtml };
|
||||
export { imageHtml, galleryHtml, videoHtml };
|
||||
|
||||
Reference in New Issue
Block a user