3d-spinner 0.9.3 → 0.9.5
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/animations/charged-orb.js +4 -2
- package/dist/animations/ghost-train.d.ts +72 -0
- package/dist/animations/ghost-train.js +249 -0
- package/dist/animations/grid-assembly.d.ts +11 -8
- package/dist/animations/grid-assembly.js +44 -30
- package/dist/animations/rocket-launch.d.ts +58 -0
- package/dist/animations/rocket-launch.js +375 -0
- package/dist/animations/spin.d.ts +3 -1
- package/dist/animations/spin.js +6 -1
- package/dist/cjs/animations/charged-orb.cjs +170 -28
- package/dist/cjs/animations/grid-assembly.cjs +192 -172
- package/dist/cjs/animations/object-motion.cjs +156 -24
- package/dist/cjs/animations/particles.cjs +167 -26
- package/dist/cjs/animations/spin.cjs +169 -27
- package/dist/cjs/engines/little-3d-engine/little-3d-engine.cjs +215 -55
- package/dist/cjs/engines/little-3d-engine/loaders/obj.cjs +51 -13
- package/dist/cjs/engines/little-3d-engine/renderers/canvas2d-textured.cjs +56 -6
- package/dist/cjs/engines/little-3d-engine/renderers/webgl-textured.cjs +55 -6
- package/dist/cjs/engines/little-3d-engine/renderers/webgpu-textured.cjs +64 -11
- package/dist/cjs/prefabs/prefabs.cjs +817 -205
- package/dist/engines/little-3d-engine/core/geometry.d.ts +15 -2
- package/dist/engines/little-3d-engine/core/geometry.js +25 -3
- package/dist/engines/little-3d-engine/core/light.d.ts +28 -4
- package/dist/engines/little-3d-engine/core/light.js +48 -7
- package/dist/engines/little-3d-engine/core/mesh.d.ts +33 -0
- package/dist/engines/little-3d-engine/core/mesh.js +12 -0
- package/dist/engines/little-3d-engine/little-3d-engine.d.ts +2 -2
- package/dist/engines/little-3d-engine/little-3d-engine.js +1 -1
- package/dist/engines/little-3d-engine/loaders/obj.d.ts +8 -7
- package/dist/engines/little-3d-engine/loaders/obj.js +74 -20
- package/dist/engines/little-3d-engine/renderers/canvas2d.js +23 -1
- package/dist/engines/little-3d-engine/renderers/webgl.js +34 -5
- package/dist/engines/little-3d-engine/renderers/webgpu.js +43 -10
- package/dist/engines/little-3d-engine/shapes/complex/plane.d.ts +8 -3
- package/dist/engines/little-3d-engine/shapes/complex/plane.js +10 -4
- package/dist/engines/little-3d-engine/shapes/primitives/cube.d.ts +3 -2
- package/dist/engines/little-3d-engine/shapes/primitives/cube.js +4 -2
- package/dist/engines/little-3d-engine/shapes/primitives/octahedron.d.ts +3 -2
- package/dist/engines/little-3d-engine/shapes/primitives/octahedron.js +4 -2
- package/dist/engines/little-3d-engine/shapes/primitives/pyramid.d.ts +3 -2
- package/dist/engines/little-3d-engine/shapes/primitives/pyramid.js +4 -2
- package/dist/engines/little-3d-engine/shapes/primitives/quad.d.ts +3 -2
- package/dist/engines/little-3d-engine/shapes/primitives/quad.js +4 -2
- package/dist/engines/little-3d-engine/shapes/primitives/spheres/cube-sphere.d.ts +3 -2
- package/dist/engines/little-3d-engine/shapes/primitives/spheres/cube-sphere.js +4 -2
- package/dist/engines/little-3d-engine/shapes/primitives/spheres/icosphere.d.ts +3 -2
- package/dist/engines/little-3d-engine/shapes/primitives/spheres/icosphere.js +4 -2
- package/dist/engines/little-3d-engine/shapes/primitives/spheres/octa-sphere.d.ts +3 -2
- package/dist/engines/little-3d-engine/shapes/primitives/spheres/octa-sphere.js +4 -2
- package/dist/engines/little-3d-engine/shapes/primitives/spheres/uv-sphere.d.ts +3 -2
- package/dist/engines/little-3d-engine/shapes/primitives/spheres/uv-sphere.js +4 -2
- package/dist/engines/little-3d-engine/shapes/primitives/tetrahedron.d.ts +3 -2
- package/dist/engines/little-3d-engine/shapes/primitives/tetrahedron.js +4 -2
- package/dist/engines/little-3d-engine/textures/dynamic/star.d.ts +14 -2
- package/dist/engines/little-3d-engine/textures/dynamic/star.js +26 -11
- package/dist/prefabs/ghost-train.d.ts +5 -4
- package/dist/prefabs/ghost-train.js +17 -24
- package/dist/prefabs/rocket-launch.d.ts +7 -5
- package/dist/prefabs/rocket-launch.js +10 -53
- package/dist/umd/spinner.global.js +877 -167
- package/dist/umd/spinner.global.min.js +58 -17
- package/package.json +2 -2
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ProgressSpinnerOptions } from "../index.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ProgressPrefabOptions } from "./types.js";
|
|
3
3
|
/**
|
|
4
|
-
* A progress story
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* A progress story on a launch pad: every 5% of progress a small rocket slides
|
|
5
|
+
* in cartoon-style from the right and lines up under the progress text, idling
|
|
6
|
+
* on a thin wisp of smoke. At 100% the whole row blasts off in a loose stagger
|
|
7
|
+
* on columns of fire; partway up, three of them suddenly veer 30-50 degrees and
|
|
8
|
+
* streak away.
|
|
7
9
|
*/
|
|
8
|
-
export declare function rocketLaunch(options?:
|
|
10
|
+
export declare function rocketLaunch(options?: ProgressPrefabOptions): ProgressSpinnerOptions;
|
|
@@ -1,59 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ObjectMotionAnimation } from "../animations/object-motion.js";
|
|
3
|
-
import { ParticlesAnimation } from "../animations/particles.js";
|
|
4
|
-
import { pyramid, shineTexture } from "../engines/little-3d-engine/little-3d-engine.js";
|
|
5
|
-
import { easeInCubic } from "../engines/little-tween-engine/core/tweens.js";
|
|
6
|
-
import { circleMotion } from "../motion/circle.js";
|
|
1
|
+
import { RocketLaunchAnimation } from "../animations/rocket-launch.js";
|
|
7
2
|
import { progressSpinner } from "./spinner.js";
|
|
8
|
-
// C1 launch: the handoff velocity coasts to a stop while the vertical climb
|
|
9
|
-
// accelerates, so the nose rotates smoothly from the patrol tangent to straight up.
|
|
10
|
-
const launchUp = ({ delta, position, velocity, durationMs }) => {
|
|
11
|
-
const coast = durationMs * delta * (1 - 0.5 * delta);
|
|
12
|
-
const climb = 5.5 * easeInCubic(delta);
|
|
13
|
-
return {
|
|
14
|
-
position: {
|
|
15
|
-
x: position.x + (velocity?.x ?? 0) * coast,
|
|
16
|
-
y: position.y + (velocity?.y ?? 0) * coast + climb,
|
|
17
|
-
z: position.z + (velocity?.z ?? 0) * coast,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
3
|
/**
|
|
22
|
-
* A progress story
|
|
23
|
-
*
|
|
24
|
-
*
|
|
4
|
+
* A progress story on a launch pad: every 5% of progress a small rocket slides
|
|
5
|
+
* in cartoon-style from the right and lines up under the progress text, idling
|
|
6
|
+
* on a thin wisp of smoke. At 100% the whole row blasts off in a loose stagger
|
|
7
|
+
* on columns of fire; partway up, three of them suddenly veer 30-50 degrees and
|
|
8
|
+
* streak away.
|
|
25
9
|
*/
|
|
26
10
|
export function rocketLaunch(options = {}) {
|
|
27
|
-
|
|
28
|
-
?? circleMotion({ radius: 0.55, periodMs: 7000, tilt: 0.15 });
|
|
29
|
-
const particles = options.particles ?? {};
|
|
30
|
-
const object = new ObjectMotionAnimation({
|
|
31
|
-
mesh: () => pyramid(1, ["#e2e8f0", "#f8fafc", "#cbd5e1", "#94a3b8", "#e2e8f0"]),
|
|
32
|
-
motion,
|
|
33
|
-
size: 0.44,
|
|
34
|
-
facing: "+y",
|
|
35
|
-
outro: { transition: launchUp, durationMs: 1300 },
|
|
11
|
+
return progressSpinner(new RocketLaunchAnimation({
|
|
36
12
|
backend: options.backend,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
const exhaust = new ParticlesAnimation({
|
|
41
|
-
rate: 46,
|
|
42
|
-
lifeMs: 1100,
|
|
43
|
-
size: 0.18,
|
|
44
|
-
speed: 0.5,
|
|
45
|
-
direction: { x: 0, y: -1, z: 0 },
|
|
46
|
-
spread: 0.3,
|
|
47
|
-
gravity: { x: 0, y: -0.6, z: 0 },
|
|
48
|
-
colors: ["#fde047", "#fb923c", "#ef4444", "#fef3c7"],
|
|
49
|
-
texture: particles.texture ?? shineTexture(),
|
|
50
|
-
emitter: object.trailEmitter(),
|
|
51
|
-
outroMs: object.outroDurationMs,
|
|
52
|
-
seed: 9,
|
|
53
|
-
backend: options.backend,
|
|
54
|
-
...particles,
|
|
55
|
-
label: options.label ?? particles.label,
|
|
56
|
-
fadeLabel: options.fadeLabel ?? particles.fadeLabel,
|
|
57
|
-
});
|
|
58
|
-
return progressSpinner(new CompositeAnimation([exhaust, object]), options);
|
|
13
|
+
label: options.label,
|
|
14
|
+
fadeLabel: options.fadeLabel,
|
|
15
|
+
}), options);
|
|
59
16
|
}
|