animot-presenter 0.6.6 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/utils/path-morph.js
CHANGED
|
@@ -49,18 +49,31 @@ export function shapeToPath(type, w, h, borderRadius = 0) {
|
|
|
49
49
|
return `M0,0 L${w},0 L${w},${h} L0,${h} Z`;
|
|
50
50
|
return `M${r},0 L${w - r},0 Q${w},0 ${w},${r} L${w},${h - r} Q${w},${h} ${w - r},${h} L${r},${h} Q0,${h} 0,${h - r} L0,${r} Q0,0 ${r},0 Z`;
|
|
51
51
|
}
|
|
52
|
-
case 'circle':
|
|
52
|
+
case 'circle': {
|
|
53
|
+
// A `circle` shape renders as a TRUE circle (radius = min side / 2,
|
|
54
|
+
// centered) — see Shape.svelte. Match that here so booleans / morphs /
|
|
55
|
+
// masks of a circle in a non-square box stay round, not oval.
|
|
56
|
+
const cr = Math.min(w, h) / 2;
|
|
57
|
+
return ellipsePath(w / 2, h / 2, cr, cr);
|
|
58
|
+
}
|
|
53
59
|
case 'ellipse':
|
|
54
60
|
return ellipsePath(w / 2, h / 2, w / 2, h / 2);
|
|
55
61
|
case 'triangle':
|
|
56
62
|
return `M${w / 2},0 L${w},${h} L0,${h} Z`;
|
|
57
63
|
case 'hexagon': {
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
64
|
+
// Regular pointy-top hexagon (radius = min side / 2, centered) — matches
|
|
65
|
+
// Shape.svelte so booleans / morphs / masks line up with the render.
|
|
66
|
+
const hcx = w / 2, hcy = h / 2, hr = Math.min(w, h) / 2;
|
|
67
|
+
let hd = '';
|
|
68
|
+
for (let i = 0; i < 6; i++) {
|
|
69
|
+
const ang = -Math.PI / 2 + (i * Math.PI) / 3;
|
|
70
|
+
hd += (i === 0 ? 'M' : 'L') + (hcx + hr * Math.cos(ang)).toFixed(2) + ',' + (hcy + hr * Math.sin(ang)).toFixed(2) + ' ';
|
|
71
|
+
}
|
|
72
|
+
return hd + 'Z';
|
|
61
73
|
}
|
|
62
74
|
case 'star': {
|
|
63
|
-
|
|
75
|
+
// Inner radius 0.4×outer to match Shape.svelte (was 0.5).
|
|
76
|
+
const cx = w / 2, cy = h / 2, outer = Math.min(w, h) / 2, inner = outer * 0.4;
|
|
64
77
|
let d = '';
|
|
65
78
|
for (let i = 0; i < 10; i++) {
|
|
66
79
|
const rad = i % 2 === 0 ? outer : inner;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "animot-presenter",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "Embed animated presentations anywhere. Works with vanilla JS, React, Vue, Angular, Svelte, and any frontend framework. Morphing animations, code highlighting, charts, particles, and more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"svelte": "./dist/index.js",
|