New demo artwork: Procedural String Lights

This commit is contained in:
Keavon Chambers 2024-01-05 06:24:13 -08:00
parent b3e4caec1a
commit c7fd9cfc21
7 changed files with 9 additions and 3 deletions

View file

@ -2,10 +2,12 @@
// Demo artwork
import ThumbnailJustAPottedCactus from "@graphite-frontend/assets/images/demo-artwork/thumbnail-just-a-potted-cactus.png";
import ThumbnailProceduralStringLights from "@graphite-frontend/assets/images/demo-artwork/thumbnail-procedural-string-lights.png";
import ThumbnailValleyOfSpires from "@graphite-frontend/assets/images/demo-artwork/thumbnail-valley-of-spires.png";
const DEMO_ARTWORK = {
ThumbnailJustAPottedCactus,
ThumbnailProceduralStringLights,
ThumbnailValleyOfSpires,
} as const;

View file

@ -69,8 +69,9 @@ export function createEditor() {
if (!demoArtwork) return;
try {
const url = new URL(`https://raw.githubusercontent.com/GraphiteEditor/Graphite/master/demo-artwork/${demoArtwork}.graphite`);
const url = new URL(`/${demoArtwork}.graphite`, document.location.href);
const data = await fetch(url);
if (!data.ok) throw new Error();
const filename = url.pathname.split("/").pop() || "Untitled";
const content = await data.text();