Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
feat(cursor): ship raster themes and 3D modeling direction
EtienneLescot2f1a7316349b
diff --git a/design/cursors/3d-concept.png b/design/cursors/3d-concept.pngnew file mode 100644index 000000000..e495f9f39Binary files /dev/null and b/design/cursors/3d-concept.png differdiff --git a/design/cursors/3d-direction.md b/design/cursors/3d-direction.mdnew file mode 100644index 000000000..a05b3a4c7--- /dev/null+++ b/design/cursors/3d-direction.md@@ -0,0 +1,26 @@+# Direction for modelled cursor themes++`3d-concept.png` is a visual reference, not a render from OpenScreen.+The current compositor's mode 15 rounds an extruded 2D silhouette. It does+not make a convex palm, separate fingers, or a sculpted arrow body. Do not+present a bevel adjustment as the finished 3D treatment.++The production 3D version should have authored geometry for each cursor+theme and state, anchored to the same arrow tip or raised fingertip as its+flat PNG. The PNG supplies its colour and surface pattern; geometry supplies+the volume. Pop Coral's decorative offset layer and rays belong to its flat+art, not its 3D body. The prepared single-surface PNGs can be used as its+3D colour reference.++| Theme | Volume direction |+| --- | --- |+| Studio Ink | Solid sculpted arrow; convex palm and distinct rounded fingers |+| Prism Glow | Sharp crystal facets and angular finger segments |+| Pop Coral | Soft rubber body with generous rounded volume |+| Pixel Candy | Stepped voxel silhouette with restrained edge rounding |+| Star Sprout | Soft ceramic body; star and leaves as separate raised details |++The model needs a true changing surface normal across the face, visible+depth in a three-quarter view, correct contact shadows, and a stable hotspot+during yaw, pitch, click and size changes. A static PNG of a 3D render is+insufficient: the compositor's camera and lighting must see the geometry.diff --git a/design/cursors/README.md b/design/cursors/README.mdindex 10addeaf6..a63bb5f19 100644--- a/design/cursors/README.md+++ b/design/cursors/README.md@@ -1,8 +1,8 @@# 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.+These five themes replace the removed Sweezy packs. The artwork was created for+OpenScreen as transparent raster images. The PNGs in this directory are the+original high-resolution masters; there is no SVG conversion step.| Theme | Intent || --- | --- |@@ -12,14 +12,19 @@ bitmap or third-party cursor file is shipped. The SVGs here are the editable mas| 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.+Each `source.png` contains an arrow on the left and a hand on the right. Run+`node scripts/generate-original-cursor-themes.mjs` to crop, remove low-alpha+fringe pixels, and resize them into transparent 128 × 128 PNGs under+`public/cursors/<theme>/`. The script prints the normalized tip hotspots;+copy them into `src/lib/cursor/cursorThemes.ts` after changing a master.-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.+Pop Coral has an additional `source-3d.png` without its decorative offset+layer or floating rays. Its `arrow-3d.png` and `pointer-3d.png` are prepared+surface art for a future 3D model, not a finished model. The current compositor+still limits its simple 3D extrusion to the built-in default theme. Cursor+states not supplied by a theme 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.+The separate 3D modeling direction and concept image are in `3d-direction.md`+and `3d-concept.png`.diff --git a/design/cursors/contact-sheet.png b/design/cursors/contact-sheet.pngindex bd133a4f4..860315a9f 100644Binary files a/design/cursors/contact-sheet.png and b/design/cursors/contact-sheet.png differdiff --git a/design/cursors/dark-32px.png b/design/cursors/dark-32px.pngindex 8f4284a91..e44b6f0d5 100644Binary files a/design/cursors/dark-32px.png and b/design/cursors/dark-32px.png differdiff --git a/design/cursors/pixel-candy/arrow.svg b/design/cursors/pixel-candy/arrow.svgdeleted file mode 100644index 01fd8dfe5..000000000--- a/design/cursors/pixel-candy/arrow.svg+++ /dev/null@@ -1 +0,0 @@-<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.svgdeleted file mode 100644index 1c224c2b7..000000000--- a/design/cursors/pixel-candy/pointer.svg+++ /dev/null@@ -1 +0,0 @@-<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/pixel-candy/source.png b/design/cursors/pixel-candy/source.pngnew file mode 100644index 000000000..79b5c859dBinary files /dev/null and b/design/cursors/pixel-candy/source.png differdiff --git a/design/cursors/pop-coral/arrow.svg b/design/cursors/pop-coral/arrow.svgdeleted file mode 100644index caf4e437a..000000000--- a/design/cursors/pop-coral/arrow.svg+++ /dev/null@@ -1 +0,0 @@-<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.svgdeleted file mode 100644index d48dad06a..000000000--- a/design/cursors/pop-coral/pointer.svg+++ /dev/null@@ -1 +0,0 @@-<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/pop-coral/source-3d.png b/design/cursors/pop-coral/source-3d.pngnew file mode 100644index 000000000..509aa7dc7Binary files /dev/null and b/design/cursors/pop-coral/source-3d.png differdiff --git a/design/cursors/pop-coral/source.png b/design/cursors/pop-coral/source.pngnew file mode 100644index 000000000..74a642e90Binary files /dev/null and b/design/cursors/pop-coral/source.png differdiff --git a/design/cursors/prism-glow/arrow.svg b/design/cursors/prism-glow/arrow.svgdeleted file mode 100644index abf63ef24..000000000--- a/design/cursors/prism-glow/arrow.svg+++ /dev/null@@ -1 +0,0 @@-<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.svgdeleted file mode 100644index fdf35c864..000000000--- a/design/cursors/prism-glow/pointer.svg+++ /dev/null@@ -1 +0,0 @@-<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/prism-glow/source.png b/design/cursors/prism-glow/source.pngnew file mode 100644index 000000000..e604db40bBinary files /dev/null and b/design/cursors/prism-glow/source.png differdiff --git a/design/cursors/star-sprout/arrow.svg b/design/cursors/star-sprout/arrow.svgdeleted file mode 100644index 45e438412..000000000--- a/design/cursors/star-sprout/arrow.svg+++ /dev/null@@ -1 +0,0 @@-<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.svgdeleted file mode 100644index 86db890c9..000000000--- a/design/cursors/star-sprout/pointer.svg+++ /dev/null@@ -1 +0,0 @@-<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/star-sprout/source.png b/design/cursors/star-sprout/source.pngnew file mode 100644index 000000000..930675346Binary files /dev/null and b/design/cursors/star-sprout/source.png differdiff --git a/design/cursors/studio-ink/arrow.svg b/design/cursors/studio-ink/arrow.svgdeleted file mode 100644index 06ee1c7fe..000000000--- a/design/cursors/studio-ink/arrow.svg+++ /dev/null@@ -1 +0,0 @@-<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.svgdeleted file mode 100644index 7eaaf566d..000000000--- a/design/cursors/studio-ink/pointer.svg+++ /dev/null@@ -1 +0,0 @@-<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/design/cursors/studio-ink/source.png b/design/cursors/studio-ink/source.pngnew file mode 100644index 000000000..dc5b8a39bBinary files /dev/null and b/design/cursors/studio-ink/source.png differdiff --git a/public/cursors/pixel-candy/arrow.png b/public/cursors/pixel-candy/arrow.pngindex 89c3d68e5..1efe79656 100644Binary files a/public/cursors/pixel-candy/arrow.png and b/public/cursors/pixel-candy/arrow.png differdiff --git a/public/cursors/pixel-candy/pointer.png b/public/cursors/pixel-candy/pointer.pngindex daea986a6..13e181de9 100644Binary files a/public/cursors/pixel-candy/pointer.png and b/public/cursors/pixel-candy/pointer.png differdiff --git a/public/cursors/pop-coral/arrow-3d.png b/public/cursors/pop-coral/arrow-3d.pngnew file mode 100644index 000000000..517581d25Binary files /dev/null and b/public/cursors/pop-coral/arrow-3d.png differdiff --git a/public/cursors/pop-coral/arrow.png b/public/cursors/pop-coral/arrow.pngindex 3c16efc5e..0032bb550 100644Binary files a/public/cursors/pop-coral/arrow.png and b/public/cursors/pop-coral/arrow.png differdiff --git a/public/cursors/pop-coral/pointer-3d.png b/public/cursors/pop-coral/pointer-3d.pngnew file mode 100644index 000000000..cd1eca32dBinary files /dev/null and b/public/cursors/pop-coral/pointer-3d.png differdiff --git a/public/cursors/pop-coral/pointer.png b/public/cursors/pop-coral/pointer.pngindex 9822253ca..572f551c6 100644Binary files a/public/cursors/pop-coral/pointer.png and b/public/cursors/pop-coral/pointer.png differdiff --git a/public/cursors/prism-glow/arrow.png b/public/cursors/prism-glow/arrow.pngindex eb35c9c0b..f0b352a35 100644Binary files a/public/cursors/prism-glow/arrow.png and b/public/cursors/prism-glow/arrow.png differdiff --git a/public/cursors/prism-glow/pointer.png b/public/cursors/prism-glow/pointer.pngindex 524e2999a..9be3c514d 100644Binary files a/public/cursors/prism-glow/pointer.png and b/public/cursors/prism-glow/pointer.png differdiff --git a/public/cursors/star-sprout/arrow.png b/public/cursors/star-sprout/arrow.pngindex 8dd5f2136..f460fba7d 100644Binary files a/public/cursors/star-sprout/arrow.png and b/public/cursors/star-sprout/arrow.png differdiff --git a/public/cursors/star-sprout/pointer.png b/public/cursors/star-sprout/pointer.pngindex 2b48d75a8..4d7ff0aba 100644Binary files a/public/cursors/star-sprout/pointer.png and b/public/cursors/star-sprout/pointer.png differdiff --git a/public/cursors/studio-ink/arrow.png b/public/cursors/studio-ink/arrow.pngindex b93523a07..77f95c09c 100644Binary files a/public/cursors/studio-ink/arrow.png and b/public/cursors/studio-ink/arrow.png differdiff --git a/public/cursors/studio-ink/pointer.png b/public/cursors/studio-ink/pointer.pngindex d7b40fe1f..7ee633dad 100644Binary files a/public/cursors/studio-ink/pointer.png and b/public/cursors/studio-ink/pointer.png differdiff --git a/scripts/generate-original-cursor-themes.mjs b/scripts/generate-original-cursor-themes.mjsindex e3e4902f3..4fb3b5f80 100644--- a/scripts/generate-original-cursor-themes.mjs+++ b/scripts/generate-original-cursor-themes.mjs@@ -1,6 +1,6 @@-// 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.+// Prepare transparent cursor PNGs from the original raster artwork in design/cursors.+// Run with `node scripts/generate-original-cursor-themes.mjs`.+// Each source PNG contains the arrow on the left and the hand on the right.import { mkdir, readFile, writeFile } from "node:fs/promises";import path from "node:path";@@ -8,118 +8,106 @@ 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 SOURCE_DIR = path.join(ROOT, "design", "cursors");const PUBLIC_DIR = path.join(ROOT, "public", "cursors");const SIZE = 128;+const INNER_SIZE = 112;-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";-+// Fingertip and arrow tip coordinates in the 1774 × 887 source PNGs.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"/>`;- },- },+ { id: "studio-ink", hotspots: { arrow: [158, 48], pointer: [1258, 50] } },+ { id: "prism-glow", hotspots: { arrow: [208, 42], pointer: [1220, 50] } },+ { id: "pop-coral", hotspots: { arrow: [265, 58], pointer: [1245, 65] } },+ { id: "pixel-candy", hotspots: { arrow: [273, 76], pointer: [1218, 78] } },+ { id: "star-sprout", hotspots: { arrow: [210, 65], pointer: [1218, 65] } },];-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;+try {+ const page = await browser.newPage();+ await page.goto("about:blank");+ for (const theme of themes) {+ const output = path.join(PUBLIC_DIR, theme.id);+ await mkdir(output, { recursive: true });+ for (const variant of theme.id === "pop-coral" ? ["", "-3d"] : [""]) {+ const source = await readFile(path.join(SOURCE_DIR, theme.id, `source${variant}.png`));+ for (const type of ["arrow", "pointer"]) {+ const result = await page.evaluate(+ async ({ png, type, size, innerSize, hotspot }) => {+ const image = new Image();+ image.src = `data:image/png;base64,${png}`;+ await image.decode();+ const halfWidth = image.width / 2;+ const sourceX = type === "arrow" ? 0 : halfWidth;+ const sourceCanvas = document.createElement("canvas");+ sourceCanvas.width = halfWidth;+ sourceCanvas.height = image.height;+ const sourceContext = sourceCanvas.getContext("2d", { willReadFrequently: true });+ sourceContext.drawImage(image, -sourceX, 0);+ const pixels = sourceContext.getImageData(0, 0, halfWidth, image.height);+ let minX = halfWidth;+ let minY = image.height;+ let maxX = 0;+ let maxY = 0;+ for (let y = 0; y < image.height; y++) {+ for (let x = 0; x < halfWidth; x++) {+ const alphaIndex = (y * halfWidth + x) * 4 + 3;+ if (pixels.data[alphaIndex] < 28) {+ pixels.data[alphaIndex] = 0;+ continue;+ }+ minX = Math.min(minX, x);+ minY = Math.min(minY, y);+ maxX = Math.max(maxX, x);+ maxY = Math.max(maxY, y);+ }+ }+ if (minX > maxX || minY > maxY) throw new Error("Empty cursor artwork");+ sourceContext.putImageData(pixels, 0, 0);+ const width = maxX - minX + 1;+ const height = maxY - minY + 1;+ const scale = innerSize / Math.max(width, height);+ const targetWidth = width * scale;+ const targetHeight = height * scale;+ const targetX = (size - targetWidth) / 2;+ const targetY = (size - targetHeight) / 2;+ const canvas = document.createElement("canvas");+ canvas.width = canvas.height = size;+ const context = canvas.getContext("2d");+ context.imageSmoothingQuality = "high";+ context.drawImage(+ sourceCanvas,+ minX,+ minY,+ width,+ height,+ targetX,+ targetY,+ targetWidth,+ targetHeight,+ );+ return {+ png: canvas.toDataURL("image/png").split(",")[1],+ hotspotX: (targetX + (hotspot[0] - sourceX - minX) * scale) / size,+ hotspotY: (targetY + (hotspot[1] - minY) * scale) / size,+ };+ },+ {+ png: source.toString("base64"),+ type,+ size: SIZE,+ innerSize: INNER_SIZE,+ hotspot: theme.hotspots[type],+ },+ );+ const filename = `${type}${variant}.png`;+ await writeFile(path.join(output, filename), Buffer.from(result.png, "base64"));+ console.log(+ `${theme.id}/${filename}: hotspot ${result.hotspotX.toFixed(4)}, ${result.hotspotY.toFixed(4)}`,+ );+ }}- 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"),- );}+} finally {+ await browser.close();}--await browser.close();-console.log(`Generated ${themes.length} original themes (${SIZE}px PNGs).`);diff --git a/src/lib/cursor/cursorThemes.ts b/src/lib/cursor/cursorThemes.tsindex 141b9eef7..8ab6e554b 100644--- a/src/lib/cursor/cursorThemes.ts+++ b/src/lib/cursor/cursorThemes.ts@@ -86,8 +86,8 @@ export const DEFAULT_CURSOR_SPRITES: Record<NativeCursorType, CursorSprite> = {};/**- * 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.+ * Bundled cursor themes. These five packs are original OpenScreen artwork. Their raster+ * masters live in design/cursors/ and are prepared by scripts/generate-original-cursor-themes.mjs.* The former Sweezy packs were removed* because their terms forbid redistribution without written permission.*@@ -105,15 +105,15 @@ export const CURSOR_THEMES: readonly CursorTheme[] = [assetPath: "cursors/studio-ink/arrow.png",width: 32,height: 32,- hotspotX: 3,- hotspotY: 2.5,+ hotspotX: 6.2304,+ hotspotY: 2.0992,},pointer: {assetPath: "cursors/studio-ink/pointer.png",width: 32,height: 32,- hotspotX: 13.7,- hotspotY: 2.5,+ hotspotX: 12.848,+ hotspotY: 2.0704,},},},@@ -125,15 +125,15 @@ export const CURSOR_THEMES: readonly CursorTheme[] = [assetPath: "cursors/prism-glow/arrow.png",width: 32,height: 32,- hotspotX: 3,- hotspotY: 2.5,+ hotspotX: 6.3456,+ hotspotY: 2.0672,},pointer: {assetPath: "cursors/prism-glow/pointer.png",width: 32,height: 32,- hotspotX: 13.7,- hotspotY: 2.5,+ hotspotX: 11.968,+ hotspotY: 2.0352,},},},@@ -145,15 +145,15 @@ export const CURSOR_THEMES: readonly CursorTheme[] = [assetPath: "cursors/pop-coral/arrow.png",width: 32,height: 32,- hotspotX: 3,- hotspotY: 2.5,+ hotspotX: 10.4768,+ hotspotY: 2.1792,},pointer: {assetPath: "cursors/pop-coral/pointer.png",width: 32,height: 32,- hotspotX: 13.7,- hotspotY: 2.5,+ hotspotX: 12.3456,+ hotspotY: 2,},},},@@ -165,15 +165,15 @@ export const CURSOR_THEMES: readonly CursorTheme[] = [assetPath: "cursors/pixel-candy/arrow.png",width: 32,height: 32,- hotspotX: 3,- hotspotY: 3,+ hotspotX: 7.3664,+ hotspotY: 2,},pointer: {assetPath: "cursors/pixel-candy/pointer.png",width: 32,height: 32,- hotspotX: 13.5,- hotspotY: 2,+ hotspotX: 13.376,+ hotspotY: 1.9264,},},},@@ -185,15 +185,15 @@ export const CURSOR_THEMES: readonly CursorTheme[] = [assetPath: "cursors/star-sprout/arrow.png",width: 32,height: 32,- hotspotX: 3,- hotspotY: 2.5,+ hotspotX: 4.7232,+ hotspotY: 2.1152,},pointer: {assetPath: "cursors/star-sprout/pointer.png",width: 32,height: 32,- hotspotX: 13.7,- hotspotY: 2.5,+ hotspotX: 13.1712,+ hotspotY: 2.0384,},},},