Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

feat(cursor): add five original cursor themes

EtienneLescot97039a0640ab
diff --git a/design/cursors/README.md b/design/cursors/README.md
new file mode 100644
index 000000000..10addeaf6
--- /dev/null
+++ b/design/cursors/README.md
@@ -0,0 +1,25 @@
+# Original OpenScreen cursor themes
+
+These five themes replace the removed Sweezy packs. Their SVG shapes and palettes were
+drawn for OpenScreen. Image generation was used for visual exploration; no generated
+bitmap or third-party cursor file is shipped. The SVGs here are the editable masters.
+
+| Theme | Intent |
+| --- | --- |
+| Studio Ink | Quiet, high-contrast choice for product demos |
+| Prism Glow | Vivid color without losing the cursor silhouette |
+| Pop Coral | Warm, playful choice for casual recordings |
+| Pixel Candy | A small retro option for people who liked pixel packs |
+| Star Sprout | An original tiny character for people who liked mascot packs |
+
+Each theme has `arrow.svg` and `pointer.svg`. The matching transparent 128×128 PNGs
+are in `public/cursors/<theme>/`. Run `node scripts/generate-original-cursor-themes.mjs`
+after editing an SVG to regenerate its PNG. The script creates an SVG only if it does
+not exist, so edits to the masters are preserved.
+
+Hotspots are expressed in the SVG's 32×32 coordinate system in
+`src/lib/cursor/cursorThemes.ts`. Keep a hotspot on the arrow's tip or the hand's
+raised fingertip when changing a shape. Other cursor states use the built-in art.
+
+`contact-sheet.png` shows the sprites enlarged on a light background;
+`dark-32px.png` shows them at their 32-pixel reference size on a dark background.
diff --git a/design/cursors/contact-sheet.png b/design/cursors/contact-sheet.png
new file mode 100644
index 000000000..bd133a4f4
Binary files /dev/null and b/design/cursors/contact-sheet.png differ
diff --git a/design/cursors/dark-32px.png b/design/cursors/dark-32px.png
new file mode 100644
index 000000000..8f4284a91
Binary files /dev/null and b/design/cursors/dark-32px.png differ
diff --git a/design/cursors/pixel-candy/arrow.svg b/design/cursors/pixel-candy/arrow.svg
new file mode 100644
index 000000000..01fd8dfe5
--- /dev/null
+++ b/design/cursors/pixel-candy/arrow.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path d="M3 3H6V6H9V9H12V12H15V15H18V18H23V20H16V22H18V26H20V29H15V27H13V23H11V21H9V23H7V25H5V27H3Z" fill="#F48AC4" stroke="#241E35" stroke-width="2" stroke-linejoin="miter"/><path d="M6 9h2v10H6zM9 19h2v2H9z" fill="#FFF4E7"/><path d="M3 3H6V6H9V9H12V12H15V15H18V18H23V20H16V22H18V26H20V29H15V27H13V23H11V21H9V23H7V25H5V27H3Z" fill="none" stroke="#241E35" stroke-width="1" stroke-linejoin="miter"/></svg>
diff --git a/design/cursors/pixel-candy/pointer.svg b/design/cursors/pixel-candy/pointer.svg
new file mode 100644
index 000000000..1c224c2b7
--- /dev/null
+++ b/design/cursors/pixel-candy/pointer.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path d="M11 2H16V10H20V12H24V14H27V25H25V28H12V26H10V23H8V20H6V18H4V14H6V12H8V13H11Z" fill="#F48AC4" stroke="#241E35" stroke-width="2" stroke-linejoin="miter"/><path d="M13 5h2v9h-2zM19 15h2v4h-2zM23 17h2v3h-2z" fill="#FFF4E7"/><path d="M11 2H16V10H20V12H24V14H27V25H25V28H12V26H10V23H8V20H6V18H4V14H6V12H8V13H11Z" fill="none" stroke="#241E35" stroke-width="1" stroke-linejoin="miter"/></svg>
diff --git a/design/cursors/pop-coral/arrow.svg b/design/cursors/pop-coral/arrow.svg
new file mode 100644
index 000000000..caf4e437a
--- /dev/null
+++ b/design/cursors/pop-coral/arrow.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path d="M3 2.5 3 27.5 9.5 21.6 13.8 30 19.2 27.3 14.8 19 24.5 18.9Z" transform="translate(1.1 1.1)" fill="#FFD66C" stroke="#262351" stroke-width="2.1" stroke-linejoin="round"/><path d="M3 2.5 3 27.5 9.5 21.6 13.8 30 19.2 27.3 14.8 19 24.5 18.9Z" fill="#FF705E" stroke="#262351" stroke-width="2.5" stroke-linejoin="round"/><path d="M7 9v9.5" stroke="#FFE9C0" stroke-width="2" stroke-linecap="round"/></svg>
diff --git a/design/cursors/pop-coral/pointer.svg b/design/cursors/pop-coral/pointer.svg
new file mode 100644
index 000000000..d48dad06a
--- /dev/null
+++ b/design/cursors/pop-coral/pointer.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path d="M13.7 2.5C11.8 2.5 10.6 3.8 10.6 5.5V15.8L8.5 13.6C7.1 12.1 4.8 12.6 4 14.2c-.5 1-.4 2.2.3 3.3l5.8 9.1c1 1.6 2.5 2.4 4.3 2.4h8.1c3.1 0 5.1-2.2 5.1-5.1v-8.8c0-1.7-1.1-2.8-2.6-2.8-1.1 0-2 .6-2.4 1.5v-1.2c0-1.7-1.1-2.8-2.6-2.8-1.2 0-2.1.7-2.6 1.7V5.5c0-1.7-1.3-3-3-3Z" transform="translate(1.1 1.1)" fill="#FFD66C" stroke="#262351" stroke-width="2.1" stroke-linejoin="round"/><path d="M13.7 2.5C11.8 2.5 10.6 3.8 10.6 5.5V15.8L8.5 13.6C7.1 12.1 4.8 12.6 4 14.2c-.5 1-.4 2.2.3 3.3l5.8 9.1c1 1.6 2.5 2.4 4.3 2.4h8.1c3.1 0 5.1-2.2 5.1-5.1v-8.8c0-1.7-1.1-2.8-2.6-2.8-1.1 0-2 .6-2.4 1.5v-1.2c0-1.7-1.1-2.8-2.6-2.8-1.2 0-2.1.7-2.6 1.7V5.5c0-1.7-1.3-3-3-3Z" fill="#FF705E" stroke="#262351" stroke-width="2.5" stroke-linejoin="round"/><path d="M13.8 6.5v7" stroke="#FFE9C0" stroke-width="2" stroke-linecap="round"/></svg>
diff --git a/design/cursors/prism-glow/arrow.svg b/design/cursors/prism-glow/arrow.svg
new file mode 100644
index 000000000..abf63ef24
--- /dev/null
+++ b/design/cursors/prism-glow/arrow.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><defs><clipPath id="shape"><path d="M3 2.5 3 27.5 9.5 21.6 13.8 30 19.2 27.3 14.8 19 24.5 18.9Z"/></clipPath></defs><path d="M3 2.5 3 27.5 9.5 21.6 13.8 30 19.2 27.3 14.8 19 24.5 18.9Z" fill="#132C75"/><g clip-path="url(#shape)"><path d="M3 2.5 24.5 18.9 11 16Z" fill="#29E1D2"/><path d="M11 16 24.5 18.9 19.2 27.3 14.8 19Z" fill="#8F66F5"/><path d="M3 2.5 11 16 3 27.5Z" fill="#3269E9"/><path d="M3 2.5 17 17 9 14Z" fill="#A8FFF3" opacity=".85"/></g><path d="M3 2.5 3 27.5 9.5 21.6 13.8 30 19.2 27.3 14.8 19 24.5 18.9Z" fill="none" stroke="#091845" stroke-width="2.8" stroke-linejoin="round"/></svg>
diff --git a/design/cursors/prism-glow/pointer.svg b/design/cursors/prism-glow/pointer.svg
new file mode 100644
index 000000000..fdf35c864
--- /dev/null
+++ b/design/cursors/prism-glow/pointer.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><defs><clipPath id="shape"><path d="M13.7 2.5C11.8 2.5 10.6 3.8 10.6 5.5V15.8L8.5 13.6C7.1 12.1 4.8 12.6 4 14.2c-.5 1-.4 2.2.3 3.3l5.8 9.1c1 1.6 2.5 2.4 4.3 2.4h8.1c3.1 0 5.1-2.2 5.1-5.1v-8.8c0-1.7-1.1-2.8-2.6-2.8-1.1 0-2 .6-2.4 1.5v-1.2c0-1.7-1.1-2.8-2.6-2.8-1.2 0-2.1.7-2.6 1.7V5.5c0-1.7-1.3-3-3-3Z"/></clipPath></defs><path d="M13.7 2.5C11.8 2.5 10.6 3.8 10.6 5.5V15.8L8.5 13.6C7.1 12.1 4.8 12.6 4 14.2c-.5 1-.4 2.2.3 3.3l5.8 9.1c1 1.6 2.5 2.4 4.3 2.4h8.1c3.1 0 5.1-2.2 5.1-5.1v-8.8c0-1.7-1.1-2.8-2.6-2.8-1.1 0-2 .6-2.4 1.5v-1.2c0-1.7-1.1-2.8-2.6-2.8-1.2 0-2.1.7-2.6 1.7V5.5c0-1.7-1.3-3-3-3Z" fill="#132C75"/><g clip-path="url(#shape)"><path d="M10 3 19 10 12 19 4 14Z" fill="#2FE3D5"/><path d="M19 9 29 15 26 24 12 19Z" fill="#8563F0"/><path d="M4 14 12 19 26 24 24 30 12 30Z" fill="#2869DD"/><path d="M12 3 17 5 14 16 11 18Z" fill="#B5FFF4" opacity=".8"/></g><path d="M13.7 2.5C11.8 2.5 10.6 3.8 10.6 5.5V15.8L8.5 13.6C7.1 12.1 4.8 12.6 4 14.2c-.5 1-.4 2.2.3 3.3l5.8 9.1c1 1.6 2.5 2.4 4.3 2.4h8.1c3.1 0 5.1-2.2 5.1-5.1v-8.8c0-1.7-1.1-2.8-2.6-2.8-1.1 0-2 .6-2.4 1.5v-1.2c0-1.7-1.1-2.8-2.6-2.8-1.2 0-2.1.7-2.6 1.7V5.5c0-1.7-1.3-3-3-3Z" fill="none" stroke="#091845" stroke-width="2.8" stroke-linejoin="round"/></svg>
diff --git a/design/cursors/star-sprout/arrow.svg b/design/cursors/star-sprout/arrow.svg
new file mode 100644
index 000000000..45e438412
--- /dev/null
+++ b/design/cursors/star-sprout/arrow.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path d="M3 2.5 3 27.5 9.5 21.6 13.8 30 19.2 27.3 14.8 19 24.5 18.9Z" fill="#B8EFD5" stroke="#142344" stroke-width="2.5" stroke-linejoin="round"/><path d="M24.5 21.2q-2-1.3-1.6-3.2 1.9.3 2.1 2.4.6-1.8 2.4-1.7.2 1.9-2.5 2.5" fill="#68CFAE" stroke="#142344" stroke-width=".9" stroke-linejoin="round"/><path d="m25 21 1.25 2.2 2.5.4-1.8 1.8.4 2.5-2.35-1.2-2.25 1.2.4-2.5-1.8-1.8 2.5-.4Z" fill="#FFC66B" stroke="#142344" stroke-width="1.1" stroke-linejoin="round"/><circle cx="24.25" cy="24.5" r=".42" fill="#142344"/><circle cx="25.7" cy="24.5" r=".42" fill="#142344"/></svg>
diff --git a/design/cursors/star-sprout/pointer.svg b/design/cursors/star-sprout/pointer.svg
new file mode 100644
index 000000000..86db890c9
--- /dev/null
+++ b/design/cursors/star-sprout/pointer.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path d="M13.7 2.5C11.8 2.5 10.6 3.8 10.6 5.5V15.8L8.5 13.6C7.1 12.1 4.8 12.6 4 14.2c-.5 1-.4 2.2.3 3.3l5.8 9.1c1 1.6 2.5 2.4 4.3 2.4h8.1c3.1 0 5.1-2.2 5.1-5.1v-8.8c0-1.7-1.1-2.8-2.6-2.8-1.1 0-2 .6-2.4 1.5v-1.2c0-1.7-1.1-2.8-2.6-2.8-1.2 0-2.1.7-2.6 1.7V5.5c0-1.7-1.3-3-3-3Z" fill="#FFF8E8" stroke="#142344" stroke-width="2.5" stroke-linejoin="round"/><path d="M12 25.1q6 1.8 14.2 0V28q-5 2.1-13.4.5Z" fill="#B8EFD5" stroke="#142344" stroke-width="1.2"/><path d="M19.2 24.2q-1.8-1.1-1.5-2.5 1.4.1 1.8 1.7.5-1.6 2-1.4.1 1.5-2.3 2.2" fill="#68CFAE" stroke="#142344" stroke-width=".8"/><path d="m19.8 23.8 1 1.6 1.8.3-1.3 1.3.3 1.8-1.8-.9-1.7.9.3-1.8-1.3-1.3 1.8-.3Z" fill="#FFC66B" stroke="#142344" stroke-width=".8"/><circle cx="19.2" cy="26.1" r=".28" fill="#142344"/><circle cx="20.4" cy="26.1" r=".28" fill="#142344"/></svg>
diff --git a/design/cursors/studio-ink/arrow.svg b/design/cursors/studio-ink/arrow.svg
new file mode 100644
index 000000000..06ee1c7fe
--- /dev/null
+++ b/design/cursors/studio-ink/arrow.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path d="M3 2.5 3 27.5 9.5 21.6 13.8 30 19.2 27.3 14.8 19 24.5 18.9Z" fill="#252934" stroke="#FFFFFF" stroke-width="3.2" stroke-linejoin="round"/><path d="M3 2.5 3 27.5 9.5 21.6 13.8 30 19.2 27.3 14.8 19 24.5 18.9Z" fill="none" stroke="#171A23" stroke-width="1.4" stroke-linejoin="round"/><path d="M6.8 8.5v13l3.8-3.4" fill="none" stroke="#FFF" stroke-width="1.3" stroke-linecap="round" opacity=".9"/></svg>
diff --git a/design/cursors/studio-ink/pointer.svg b/design/cursors/studio-ink/pointer.svg
new file mode 100644
index 000000000..7eaaf566d
--- /dev/null
+++ b/design/cursors/studio-ink/pointer.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path d="M13.7 2.5C11.8 2.5 10.6 3.8 10.6 5.5V15.8L8.5 13.6C7.1 12.1 4.8 12.6 4 14.2c-.5 1-.4 2.2.3 3.3l5.8 9.1c1 1.6 2.5 2.4 4.3 2.4h8.1c3.1 0 5.1-2.2 5.1-5.1v-8.8c0-1.7-1.1-2.8-2.6-2.8-1.1 0-2 .6-2.4 1.5v-1.2c0-1.7-1.1-2.8-2.6-2.8-1.2 0-2.1.7-2.6 1.7V5.5c0-1.7-1.3-3-3-3Z" fill="#252934" stroke="#FFFFFF" stroke-width="3.2" stroke-linejoin="round"/><path d="M13.7 2.5C11.8 2.5 10.6 3.8 10.6 5.5V15.8L8.5 13.6C7.1 12.1 4.8 12.6 4 14.2c-.5 1-.4 2.2.3 3.3l5.8 9.1c1 1.6 2.5 2.4 4.3 2.4h8.1c3.1 0 5.1-2.2 5.1-5.1v-8.8c0-1.7-1.1-2.8-2.6-2.8-1.1 0-2 .6-2.4 1.5v-1.2c0-1.7-1.1-2.8-2.6-2.8-1.2 0-2.1.7-2.6 1.7V5.5c0-1.7-1.3-3-3-3Z" fill="none" stroke="#171A23" stroke-width="1.4" stroke-linejoin="round"/><path d="M13.2 6.4v8.8M19.3 13v3.2M23.7 15.9v2.2" fill="none" stroke="#FFF" stroke-width="1.1" stroke-linecap="round" opacity=".8"/></svg>
diff --git a/public/cursors/pixel-candy/arrow.png b/public/cursors/pixel-candy/arrow.png
new file mode 100644
index 000000000..89c3d68e5
Binary files /dev/null and b/public/cursors/pixel-candy/arrow.png differ
diff --git a/public/cursors/pixel-candy/pointer.png b/public/cursors/pixel-candy/pointer.png
new file mode 100644
index 000000000..daea986a6
Binary files /dev/null and b/public/cursors/pixel-candy/pointer.png differ
diff --git a/public/cursors/pop-coral/arrow.png b/public/cursors/pop-coral/arrow.png
new file mode 100644
index 000000000..3c16efc5e
Binary files /dev/null and b/public/cursors/pop-coral/arrow.png differ
diff --git a/public/cursors/pop-coral/pointer.png b/public/cursors/pop-coral/pointer.png
new file mode 100644
index 000000000..9822253ca
Binary files /dev/null and b/public/cursors/pop-coral/pointer.png differ
diff --git a/public/cursors/prism-glow/arrow.png b/public/cursors/prism-glow/arrow.png
new file mode 100644
index 000000000..eb35c9c0b
Binary files /dev/null and b/public/cursors/prism-glow/arrow.png differ
diff --git a/public/cursors/prism-glow/pointer.png b/public/cursors/prism-glow/pointer.png
new file mode 100644
index 000000000..524e2999a
Binary files /dev/null and b/public/cursors/prism-glow/pointer.png differ
diff --git a/public/cursors/star-sprout/arrow.png b/public/cursors/star-sprout/arrow.png
new file mode 100644
index 000000000..8dd5f2136
Binary files /dev/null and b/public/cursors/star-sprout/arrow.png differ
diff --git a/public/cursors/star-sprout/pointer.png b/public/cursors/star-sprout/pointer.png
new file mode 100644
index 000000000..2b48d75a8
Binary files /dev/null and b/public/cursors/star-sprout/pointer.png differ
diff --git a/public/cursors/studio-ink/arrow.png b/public/cursors/studio-ink/arrow.png
new file mode 100644
index 000000000..b93523a07
Binary files /dev/null and b/public/cursors/studio-ink/arrow.png differ
diff --git a/public/cursors/studio-ink/pointer.png b/public/cursors/studio-ink/pointer.png
new file mode 100644
index 000000000..d7b40fe1f
Binary files /dev/null and b/public/cursors/studio-ink/pointer.png differ
diff --git a/scripts/generate-original-cursor-themes.mjs b/scripts/generate-original-cursor-themes.mjs
new file mode 100644
index 000000000..e3e4902f3
--- /dev/null
+++ b/scripts/generate-original-cursor-themes.mjs
@@ -0,0 +1,125 @@
+// Original OpenScreen cursor artwork. Run with `node scripts/generate-original-cursor-themes.mjs`.
+// The initial SVGs in design/cursors are editable masters. This script never overwrites
+// them; it rasterizes their current contents to PNGs for the editor and compositor.
+
+import { mkdir, readFile, writeFile } from "node:fs/promises";
+import path from "node:path";
+import { fileURLToPath } from "node:url";
+import { chromium } from "playwright";
+
+const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
+const MASTER_DIR = path.join(ROOT, "design", "cursors");
+const PUBLIC_DIR = path.join(ROOT, "public", "cursors");
+const SIZE = 128;
+
+const arrow = "M3 2.5 3 27.5 9.5 21.6 13.8 30 19.2 27.3 14.8 19 24.5 18.9Z";
+const hand =
+ "M13.7 2.5C11.8 2.5 10.6 3.8 10.6 5.5V15.8L8.5 13.6C7.1 12.1 4.8 12.6 4 14.2c-.5 1-.4 2.2.3 3.3l5.8 9.1c1 1.6 2.5 2.4 4.3 2.4h8.1c3.1 0 5.1-2.2 5.1-5.1v-8.8c0-1.7-1.1-2.8-2.6-2.8-1.1 0-2 .6-2.4 1.5v-1.2c0-1.7-1.1-2.8-2.6-2.8-1.2 0-2.1.7-2.6 1.7V5.5c0-1.7-1.3-3-3-3Z";
+const pixelArrow =
+ "M3 3H6V6H9V9H12V12H15V15H18V18H23V20H16V22H18V26H20V29H15V27H13V23H11V21H9V23H7V25H5V27H3Z";
+const pixelHand = "M11 2H16V10H20V12H24V14H27V25H25V28H12V26H10V23H8V20H6V18H4V14H6V12H8V13H11Z";
+
+const themes = [
+ {
+ id: "studio-ink",
+ name: "Studio Ink",
+ art: (type) => {
+ const shape = type === "arrow" ? arrow : hand;
+ const accent =
+ type === "arrow"
+ ? '<path d="M6.8 8.5v13l3.8-3.4" fill="none" stroke="#FFF" stroke-width="1.3" stroke-linecap="round" opacity=".9"/>'
+ : '<path d="M13.2 6.4v8.8M19.3 13v3.2M23.7 15.9v2.2" fill="none" stroke="#FFF" stroke-width="1.1" stroke-linecap="round" opacity=".8"/>';
+ return `<path d="${shape}" fill="#252934" stroke="#FFFFFF" stroke-width="3.2" stroke-linejoin="round"/><path d="${shape}" fill="none" stroke="#171A23" stroke-width="1.4" stroke-linejoin="round"/>${accent}`;
+ },
+ },
+ {
+ id: "prism-glow",
+ name: "Prism Glow",
+ art: (type) => {
+ const shape = type === "arrow" ? arrow : hand;
+ const facets =
+ type === "arrow"
+ ? '<path d="M3 2.5 24.5 18.9 11 16Z" fill="#29E1D2"/><path d="M11 16 24.5 18.9 19.2 27.3 14.8 19Z" fill="#8F66F5"/><path d="M3 2.5 11 16 3 27.5Z" fill="#3269E9"/><path d="M3 2.5 17 17 9 14Z" fill="#A8FFF3" opacity=".85"/>'
+ : '<path d="M10 3 19 10 12 19 4 14Z" fill="#2FE3D5"/><path d="M19 9 29 15 26 24 12 19Z" fill="#8563F0"/><path d="M4 14 12 19 26 24 24 30 12 30Z" fill="#2869DD"/><path d="M12 3 17 5 14 16 11 18Z" fill="#B5FFF4" opacity=".8"/>';
+ return `<defs><clipPath id="shape"><path d="${shape}"/></clipPath></defs><path d="${shape}" fill="#132C75"/><g clip-path="url(#shape)">${facets}</g><path d="${shape}" fill="none" stroke="#091845" stroke-width="2.8" stroke-linejoin="round"/>`;
+ },
+ },
+ {
+ id: "pop-coral",
+ name: "Pop Coral",
+ art: (type) => {
+ const shape = type === "arrow" ? arrow : hand;
+ const gleam =
+ type === "arrow"
+ ? '<path d="M7 9v9.5" stroke="#FFE9C0" stroke-width="2" stroke-linecap="round"/>'
+ : '<path d="M13.8 6.5v7" stroke="#FFE9C0" stroke-width="2" stroke-linecap="round"/>';
+ return `<path d="${shape}" transform="translate(1.1 1.1)" fill="#FFD66C" stroke="#262351" stroke-width="2.1" stroke-linejoin="round"/><path d="${shape}" fill="#FF705E" stroke="#262351" stroke-width="2.5" stroke-linejoin="round"/>${gleam}`;
+ },
+ },
+ {
+ id: "pixel-candy",
+ name: "Pixel Candy",
+ art: (type) => {
+ const shape = type === "arrow" ? pixelArrow : pixelHand;
+ const details =
+ type === "arrow"
+ ? '<path d="M6 9h2v10H6zM9 19h2v2H9z" fill="#FFF4E7"/>'
+ : '<path d="M13 5h2v9h-2zM19 15h2v4h-2zM23 17h2v3h-2z" fill="#FFF4E7"/>';
+ return `<path d="${shape}" fill="#F48AC4" stroke="#241E35" stroke-width="2" stroke-linejoin="miter"/>${details}<path d="${shape}" fill="none" stroke="#241E35" stroke-width="1" stroke-linejoin="miter"/>`;
+ },
+ },
+ {
+ id: "star-sprout",
+ name: "Star Sprout",
+ art: (type) => {
+ if (type === "arrow") {
+ return `<path d="${arrow}" fill="#B8EFD5" stroke="#142344" stroke-width="2.5" stroke-linejoin="round"/><path d="M24.5 21.2q-2-1.3-1.6-3.2 1.9.3 2.1 2.4.6-1.8 2.4-1.7.2 1.9-2.5 2.5" fill="#68CFAE" stroke="#142344" stroke-width=".9" stroke-linejoin="round"/><path d="m25 21 1.25 2.2 2.5.4-1.8 1.8.4 2.5-2.35-1.2-2.25 1.2.4-2.5-1.8-1.8 2.5-.4Z" fill="#FFC66B" stroke="#142344" stroke-width="1.1" stroke-linejoin="round"/><circle cx="24.25" cy="24.5" r=".42" fill="#142344"/><circle cx="25.7" cy="24.5" r=".42" fill="#142344"/>`;
+ }
+ return `<path d="${hand}" fill="#FFF8E8" stroke="#142344" stroke-width="2.5" stroke-linejoin="round"/><path d="M12 25.1q6 1.8 14.2 0V28q-5 2.1-13.4.5Z" fill="#B8EFD5" stroke="#142344" stroke-width="1.2"/><path d="M19.2 24.2q-1.8-1.1-1.5-2.5 1.4.1 1.8 1.7.5-1.6 2-1.4.1 1.5-2.3 2.2" fill="#68CFAE" stroke="#142344" stroke-width=".8"/><path d="m19.8 23.8 1 1.6 1.8.3-1.3 1.3.3 1.8-1.8-.9-1.7.9.3-1.8-1.3-1.3 1.8-.3Z" fill="#FFC66B" stroke="#142344" stroke-width=".8"/><circle cx="19.2" cy="26.1" r=".28" fill="#142344"/><circle cx="20.4" cy="26.1" r=".28" fill="#142344"/>`;
+ },
+ },
+];
+
+function svgFor(theme, type) {
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none">${theme.art(type)}</svg>\n`;
+}
+
+const browser = await chromium.launch();
+const page = await browser.newPage();
+await page.goto("about:blank");
+
+for (const theme of themes) {
+ const master = path.join(MASTER_DIR, theme.id);
+ const output = path.join(PUBLIC_DIR, theme.id);
+ await mkdir(master, { recursive: true });
+ await mkdir(output, { recursive: true });
+ for (const type of ["arrow", "pointer"]) {
+ const masterPath = path.join(master, `${type}.svg`);
+ try {
+ await writeFile(masterPath, svgFor(theme, type), { flag: "wx" });
+ } catch (error) {
+ if (error.code !== "EEXIST") throw error;
+ }
+ const svg = await readFile(masterPath, "utf8");
+ const dataUrl = await page.evaluate(
+ async ({ source, size }) => {
+ const image = new Image();
+ image.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(source)}`;
+ await image.decode();
+ const canvas = document.createElement("canvas");
+ canvas.width = size;
+ canvas.height = size;
+ canvas.getContext("2d").drawImage(image, 0, 0, size, size);
+ return canvas.toDataURL("image/png");
+ },
+ { source: svg, size: SIZE },
+ );
+ await writeFile(
+ path.join(output, `${type}.png`),
+ Buffer.from(dataUrl.slice(dataUrl.indexOf(",") + 1), "base64"),
+ );
+ }
+}
+
+await browser.close();
+console.log(`Generated ${themes.length} original themes (${SIZE}px PNGs).`);
diff --git a/src/components/ai-edition/CursorPane.preview.test.tsx b/src/components/ai-edition/CursorPane.preview.test.tsx
index 4cc3a99a9..83d829ad3 100644
--- a/src/components/ai-edition/CursorPane.preview.test.tsx
+++ b/src/components/ai-edition/CursorPane.preview.test.tsx
@@ -37,15 +37,17 @@ afterEach(() => {
});
describe("CursorPane theme picker", () => {
- it("is hidden while the default art is the only choice", () => {
- // Fails on purpose once a pack ships: the picker then has something to offer.
- expect(CURSOR_THEMES).toHaveLength(0);
+ it("shows the original cursor themes beside the default", () => {
+ expect(CURSOR_THEMES).toHaveLength(5);
render(
<I18nProvider>
<CursorPane />
</I18nProvider>,
);
- expect(screen.queryByText("Cursor Style")).toBeNull();
- expect(screen.queryByRole("button", { name: "Default" })).toBeNull();
+ expect(screen.getByRole("button", { name: "Default" })).toBeTruthy();
+ for (const theme of CURSOR_THEMES) {
+ const button = screen.getByRole("button", { name: theme.name });
+ expect(button.querySelectorAll("img")).toHaveLength(2);
+ }
});
});
diff --git a/src/lib/cursor/cursorThemes.test.ts b/src/lib/cursor/cursorThemes.test.ts
index 7f5b4950d..07b072a60 100644
--- a/src/lib/cursor/cursorThemes.test.ts
+++ b/src/lib/cursor/cursorThemes.test.ts
@@ -1,9 +1,13 @@
+import { readFileSync } from "node:fs";
+import { join } from "node:path";
import { describe, expect, it } from "vitest";
import {
+ CURSOR_THEMES,
type CursorTheme,
DEFAULT_CURSOR_SPRITES,
DEFAULT_CURSOR_THEME_ID,
normalizeCursorThemeId,
+ resolveCursorSprites,
themePickerPreviewAssets,
} from "./cursorThemes";
@@ -39,6 +43,23 @@ describe("normalizeCursorThemeId", () => {
expect(normalizeCursorThemeId(undefined)).toBe(DEFAULT_CURSOR_THEME_ID);
expect(normalizeCursorThemeId(42)).toBe(DEFAULT_CURSOR_THEME_ID);
});
+
+ it.each(CURSOR_THEMES)("keeps the original $name theme", (theme) => {
+ expect(normalizeCursorThemeId(theme.id)).toBe(theme.id);
+ const sprites = resolveCursorSprites(theme.id);
+ expect(sprites.arrow.assetPath).toBe(theme.assets.arrow?.assetPath);
+ expect(sprites.pointer.assetPath).toBe(theme.assets.pointer?.assetPath);
+ expect(sprites.text).toBe(DEFAULT_CURSOR_SPRITES.text);
+ expect(sprites.arrow.hotspotX).toBeCloseTo((theme.assets.arrow?.hotspotX ?? 0) / 32);
+ expect(sprites.pointer.hotspotY).toBeCloseTo((theme.assets.pointer?.hotspotY ?? 0) / 32);
+ for (const asset of [theme.assets.arrow, theme.assets.pointer]) {
+ if (!asset) throw new Error(`${theme.id} needs both cursor states`);
+ const png = readFileSync(join(process.cwd(), "public", asset.assetPath));
+ expect(png.subarray(0, 8).toString("hex")).toBe("89504e470d0a1a0a");
+ expect(png.readUInt32BE(16)).toBe(128);
+ expect(png.readUInt32BE(20)).toBe(128);
+ }
+ });
});
describe("themePickerPreviewAssets", () => {
diff --git a/src/lib/cursor/cursorThemes.ts b/src/lib/cursor/cursorThemes.ts
index 1a0794715..141b9eef7 100644
--- a/src/lib/cursor/cursorThemes.ts
+++ b/src/lib/cursor/cursorThemes.ts
@@ -86,18 +86,118 @@ export const DEFAULT_CURSOR_SPRITES: Record<NativeCursorType, CursorSprite> = {
};
/**
- * Bundled cursor themes. Empty on purpose: every pack this list used to carry came from
- * sweezy-cursors.com, whose terms allow personal, non-commercial use and forbid
- * redistributing or repackaging the packs without written permission. Most of them also
- * drew characters owned by third parties. A pack comes back only under a licence that
- * allows redistribution inside an MIT app, recorded in THIRD-PARTY-NOTICES.md.
+ * Bundled cursor themes. These five packs are original OpenScreen artwork. Their editable
+ * SVGs live in design/cursors/ and are rasterized by scripts/generate-original-cursor-themes.mjs.
+ * The former Sweezy packs were removed
+ * because their terms forbid redistribution without written permission.
*
* To add one: drop arrow.png/pointer.png into public/cursors/<id>/ and add an entry here
* with hotspots normalized to the 32-logical reference (divide a 128px-pack hotspot by 4).
* No renderer changes needed. An id that leaves this list reads back as the default art
* through `normalizeCursorThemeId`, so a project saved with it still opens.
*/
-export const CURSOR_THEMES: readonly CursorTheme[] = [];
+export const CURSOR_THEMES: readonly CursorTheme[] = [
+ {
+ id: "studio-ink",
+ name: "Studio Ink",
+ assets: {
+ arrow: {
+ assetPath: "cursors/studio-ink/arrow.png",
+ width: 32,
+ height: 32,
+ hotspotX: 3,
+ hotspotY: 2.5,
+ },
+ pointer: {
+ assetPath: "cursors/studio-ink/pointer.png",
+ width: 32,
+ height: 32,
+ hotspotX: 13.7,
+ hotspotY: 2.5,
+ },
+ },
+ },
+ {
+ id: "prism-glow",
+ name: "Prism Glow",
+ assets: {
+ arrow: {
+ assetPath: "cursors/prism-glow/arrow.png",
+ width: 32,
+ height: 32,
+ hotspotX: 3,
+ hotspotY: 2.5,
+ },
+ pointer: {
+ assetPath: "cursors/prism-glow/pointer.png",
+ width: 32,
+ height: 32,
+ hotspotX: 13.7,
+ hotspotY: 2.5,
+ },
+ },
+ },
+ {
+ id: "pop-coral",
+ name: "Pop Coral",
+ assets: {
+ arrow: {
+ assetPath: "cursors/pop-coral/arrow.png",
+ width: 32,
+ height: 32,
+ hotspotX: 3,
+ hotspotY: 2.5,
+ },
+ pointer: {
+ assetPath: "cursors/pop-coral/pointer.png",
+ width: 32,
+ height: 32,
+ hotspotX: 13.7,
+ hotspotY: 2.5,
+ },
+ },
+ },
+ {
+ id: "pixel-candy",
+ name: "Pixel Candy",
+ assets: {
+ arrow: {
+ assetPath: "cursors/pixel-candy/arrow.png",
+ width: 32,
+ height: 32,
+ hotspotX: 3,
+ hotspotY: 3,
+ },
+ pointer: {
+ assetPath: "cursors/pixel-candy/pointer.png",
+ width: 32,
+ height: 32,
+ hotspotX: 13.5,
+ hotspotY: 2,
+ },
+ },
+ },
+ {
+ id: "star-sprout",
+ name: "Star Sprout",
+ assets: {
+ arrow: {
+ assetPath: "cursors/star-sprout/arrow.png",
+ width: 32,
+ height: 32,
+ hotspotX: 3,
+ hotspotY: 2.5,
+ },
+ pointer: {
+ assetPath: "cursors/star-sprout/pointer.png",
+ width: 32,
+ height: 32,
+ hotspotX: 13.7,
+ hotspotY: 2.5,
+ },
+ },
+ },
+];
/** All selectable theme ids, including the built-in default. */
export const CURSOR_THEME_IDS: ReadonlySet<string> = new Set([