af-motion 0.0.0-stage → 1.0.0
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/CHANGELOG.md +33 -0
- package/LICENSE +201 -0
- package/README.md +203 -3
- package/RELEASE_NOTES.md +115 -0
- package/bin/af-motion.js +16 -0
- package/bin/mcp-server.js +21 -0
- package/dist/3d/adapter.d.ts +29 -0
- package/dist/3d/assets/cache.d.ts +71 -0
- package/dist/3d/assets/index.d.ts +10 -0
- package/dist/3d/assets/inspection.d.ts +19 -0
- package/dist/3d/assets/loaders.d.ts +30 -0
- package/dist/3d/assets/manager.d.ts +69 -0
- package/dist/3d/assets/scene-integration.d.ts +23 -0
- package/dist/3d/assets/types.d.ts +80 -0
- package/dist/3d/assets/validation.d.ts +12 -0
- package/dist/3d/camera/index.d.ts +7 -0
- package/dist/3d/camera/presets.d.ts +8 -0
- package/dist/3d/camera/transitions.d.ts +19 -0
- package/dist/3d/camera/types.d.ts +37 -0
- package/dist/3d/camera/validation.d.ts +9 -0
- package/dist/3d/capabilities.d.ts +11 -0
- package/dist/3d/composition/fallback.d.ts +20 -0
- package/dist/3d/composition/generation.d.ts +24 -0
- package/dist/3d/composition/index.d.ts +12 -0
- package/dist/3d/composition/quality.d.ts +35 -0
- package/dist/3d/composition/recipes.d.ts +34 -0
- package/dist/3d/composition/types.d.ts +88 -0
- package/dist/3d/composition/unified.d.ts +18 -0
- package/dist/3d/environment/index.d.ts +6 -0
- package/dist/3d/environment/presets.d.ts +8 -0
- package/dist/3d/environment/types.d.ts +36 -0
- package/dist/3d/environment/validation.d.ts +9 -0
- package/dist/3d/geometry/cache.d.ts +37 -0
- package/dist/3d/geometry/generators.d.ts +24 -0
- package/dist/3d/geometry/hash.d.ts +10 -0
- package/dist/3d/geometry/index.d.ts +9 -0
- package/dist/3d/geometry/three-adapter.d.ts +15 -0
- package/dist/3d/geometry/types.d.ts +120 -0
- package/dist/3d/geometry/validation.d.ts +6 -0
- package/dist/3d/index.d.ts +32 -0
- package/dist/3d/interaction/camera-controls.d.ts +58 -0
- package/dist/3d/interaction/index.d.ts +8 -0
- package/dist/3d/interaction/manager.d.ts +61 -0
- package/dist/3d/interaction/presets.d.ts +9 -0
- package/dist/3d/interaction/raycaster.d.ts +20 -0
- package/dist/3d/interaction/types.d.ts +78 -0
- package/dist/3d/lighting/index.d.ts +6 -0
- package/dist/3d/lighting/presets.d.ts +8 -0
- package/dist/3d/lighting/types.d.ts +31 -0
- package/dist/3d/lighting/validation.d.ts +17 -0
- package/dist/3d/materials/bridge.d.ts +11 -0
- package/dist/3d/materials/index.d.ts +7 -0
- package/dist/3d/materials/presets.d.ts +9 -0
- package/dist/3d/materials/types.d.ts +43 -0
- package/dist/3d/materials/validation.d.ts +9 -0
- package/dist/3d/morphing/animator.d.ts +19 -0
- package/dist/3d/morphing/correspondence.d.ts +32 -0
- package/dist/3d/morphing/geometry.d.ts +28 -0
- package/dist/3d/morphing/index.d.ts +16 -0
- package/dist/3d/morphing/interpolation.d.ts +45 -0
- package/dist/3d/morphing/morph.d.ts +18 -0
- package/dist/3d/morphing/presets.d.ts +31 -0
- package/dist/3d/morphing/react.d.ts +29 -0
- package/dist/3d/morphing/topology.d.ts +34 -0
- package/dist/3d/morphing/types.d.ts +138 -0
- package/dist/3d/morphing/validation.d.ts +19 -0
- package/dist/3d/optimization/analysis.d.ts +14 -0
- package/dist/3d/optimization/colliders.d.ts +16 -0
- package/dist/3d/optimization/geometry.d.ts +22 -0
- package/dist/3d/optimization/hierarchy.d.ts +14 -0
- package/dist/3d/optimization/index.d.ts +33 -0
- package/dist/3d/optimization/lod.d.ts +13 -0
- package/dist/3d/optimization/materials.d.ts +12 -0
- package/dist/3d/optimization/recommendations.d.ts +13 -0
- package/dist/3d/optimization/skeleton.d.ts +20 -0
- package/dist/3d/optimization/types.d.ts +252 -0
- package/dist/3d/physics/benchmark.d.ts +76 -0
- package/dist/3d/physics/body/inertia.d.ts +61 -0
- package/dist/3d/physics/collision/ccd.d.ts +26 -0
- package/dist/3d/physics/collision/narrowphase.d.ts +15 -0
- package/dist/3d/physics/collision/shapes.d.ts +45 -0
- package/dist/3d/physics/constraints/advanced.d.ts +40 -0
- package/dist/3d/physics/constraints/solver.d.ts +34 -0
- package/dist/3d/physics/constraints/types.d.ts +106 -0
- package/dist/3d/physics/events.d.ts +34 -0
- package/dist/3d/physics/index.d.ts +29 -0
- package/dist/3d/physics/material.d.ts +27 -0
- package/dist/3d/physics/math.d.ts +79 -0
- package/dist/3d/physics/soft/cloth.d.ts +12 -0
- package/dist/3d/physics/soft/collision.d.ts +12 -0
- package/dist/3d/physics/soft/gpu.d.ts +19 -0
- package/dist/3d/physics/soft/pbd.d.ts +20 -0
- package/dist/3d/physics/soft/rope.d.ts +16 -0
- package/dist/3d/physics/soft/soft-body.d.ts +12 -0
- package/dist/3d/physics/soft/types.d.ts +212 -0
- package/dist/3d/physics/solver/integrators.d.ts +25 -0
- package/dist/3d/physics/solver/types.d.ts +28 -0
- package/dist/3d/physics/spatial/spatial-hash.d.ts +51 -0
- package/dist/3d/physics/types.d.ts +579 -0
- package/dist/3d/physics/world.d.ts +106 -0
- package/dist/3d/r3f.d.ts +34 -0
- package/dist/3d/scene.d.ts +8 -0
- package/dist/3d/schema.d.ts +739 -0
- package/dist/3d/schemas/ai-integration.d.ts +201 -0
- package/dist/3d/schemas/correction.d.ts +11 -0
- package/dist/3d/schemas/index.d.ts +12 -0
- package/dist/3d/schemas/schemas.d.ts +361 -0
- package/dist/3d/schemas/serialization.d.ts +22 -0
- package/dist/3d/schemas/types.d.ts +199 -0
- package/dist/3d/schemas/validation.d.ts +33 -0
- package/dist/3d/scroll/controller.d.ts +32 -0
- package/dist/3d/scroll/index.d.ts +6 -0
- package/dist/3d/scroll/presets.d.ts +9 -0
- package/dist/3d/scroll/types.d.ts +53 -0
- package/dist/3d/terrain/biomes.d.ts +18 -0
- package/dist/3d/terrain/chunks.d.ts +20 -0
- package/dist/3d/terrain/erosion.d.ts +15 -0
- package/dist/3d/terrain/heightmap.d.ts +27 -0
- package/dist/3d/terrain/index.d.ts +18 -0
- package/dist/3d/terrain/materials.d.ts +20 -0
- package/dist/3d/terrain/noise.d.ts +25 -0
- package/dist/3d/terrain/physics.d.ts +34 -0
- package/dist/3d/terrain/terrain.d.ts +12 -0
- package/dist/3d/terrain/types.d.ts +235 -0
- package/dist/3d/terrain/vegetation.d.ts +14 -0
- package/dist/3d/types.d.ts +176 -0
- package/dist/3d/world/hydrology.d.ts +12 -0
- package/dist/3d/world/index.d.ts +15 -0
- package/dist/3d/world/lighting.d.ts +16 -0
- package/dist/3d/world/pipeline.d.ts +20 -0
- package/dist/3d/world/population.d.ts +12 -0
- package/dist/3d/world/presets.d.ts +11 -0
- package/dist/3d/world/streaming.d.ts +13 -0
- package/dist/3d/world/types.d.ts +272 -0
- package/dist/3d/world/world.d.ts +64 -0
- package/dist/backgrounds/advanced-gradient.d.ts +32 -0
- package/dist/backgrounds/atmospheric-backgrounds.d.ts +79 -0
- package/dist/backgrounds/aurora.d.ts +24 -0
- package/dist/backgrounds/cosmic-background.d.ts +31 -0
- package/dist/backgrounds/energy-effects.d.ts +78 -0
- package/dist/backgrounds/floating-orbs.d.ts +26 -0
- package/dist/backgrounds/fluid-backgrounds.d.ts +72 -0
- package/dist/backgrounds/geometric-backgrounds.d.ts +78 -0
- package/dist/backgrounds/gradient.d.ts +20 -0
- package/dist/backgrounds/grid.d.ts +22 -0
- package/dist/backgrounds/internal/canvas-lifecycle.d.ts +29 -0
- package/dist/backgrounds/noise.d.ts +20 -0
- package/dist/backgrounds/particle-background.d.ts +37 -0
- package/dist/backgrounds/particle-field.d.ts +22 -0
- package/dist/backgrounds/spotlight.d.ts +20 -0
- package/dist/backgrounds/wave.d.ts +22 -0
- package/dist/catalogue.d.ts +227 -0
- package/dist/catalogue.js +4 -0
- package/dist/chunks/catalogue-ZmbeEdRo.js +59850 -0
- package/dist/chunks/core-animation-CeiI_TEe.js +1394 -0
- package/dist/chunks/motion-choreography-DC6LWvDk.js +4089 -0
- package/dist/chunks/pointer-capture-lrnKAl2I.js +158 -0
- package/dist/chunks/safe-json-D5j34GEB.js +62 -0
- package/dist/chunks/scroll-velocity-BNUHaS0-.js +904 -0
- package/dist/cli/commands/doctor.d.ts +9 -0
- package/dist/cli/commands/example.d.ts +9 -0
- package/dist/cli/commands/info.d.ts +8 -0
- package/dist/cli/commands/init.d.ts +9 -0
- package/dist/cli/commands/presets.d.ts +10 -0
- package/dist/cli/commands/validate.d.ts +9 -0
- package/dist/cli/index.d.ts +22 -0
- package/dist/cli/types.d.ts +115 -0
- package/dist/cli/utils/safety.d.ts +11 -0
- package/dist/cli/utils/templates.d.ts +16 -0
- package/dist/cli/utils/terminal.d.ts +29 -0
- package/dist/cli.js +825 -0
- package/dist/core/adaptive-motion.d.ts +100 -0
- package/dist/core/adaptive-quality/controller.d.ts +61 -0
- package/dist/core/adaptive-quality/index.d.ts +13 -0
- package/dist/core/adaptive-quality/metrics.d.ts +33 -0
- package/dist/core/adaptive-quality/policies.d.ts +40 -0
- package/dist/core/adaptive-quality/profile.d.ts +58 -0
- package/dist/core/adaptive-quality/react.d.ts +57 -0
- package/dist/core/adaptive-quality/recommendation.d.ts +12 -0
- package/dist/core/adaptive-quality/resolution.d.ts +22 -0
- package/dist/core/adaptive-quality/types.d.ts +362 -0
- package/dist/core/advanced-motion/adapters.d.ts +20 -0
- package/dist/core/advanced-motion/controller.d.ts +52 -0
- package/dist/core/advanced-motion/index.d.ts +12 -0
- package/dist/core/advanced-motion/recipes.d.ts +16 -0
- package/dist/core/advanced-motion/timeline.d.ts +35 -0
- package/dist/core/advanced-motion/types.d.ts +174 -0
- package/dist/core/advanced-motion/validation.d.ts +11 -0
- package/dist/core/agent-workflows/agent-registry.d.ts +21 -0
- package/dist/core/agent-workflows/agents/accessibility-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/composition-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/design-to-motion-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/index.d.ts +13 -0
- package/dist/core/agent-workflows/agents/motion-intelligence-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/performance-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/scene-generation-agent.d.ts +9 -0
- package/dist/core/agent-workflows/collaboration-planner.d.ts +38 -0
- package/dist/core/agent-workflows/collaboration-workflows.d.ts +83 -0
- package/dist/core/agent-workflows/communication.d.ts +29 -0
- package/dist/core/agent-workflows/conflict-resolver.d.ts +25 -0
- package/dist/core/agent-workflows/context.d.ts +36 -0
- package/dist/core/agent-workflows/execution-engine.d.ts +30 -0
- package/dist/core/agent-workflows/index.d.ts +20 -0
- package/dist/core/agent-workflows/orchestration-types.d.ts +144 -0
- package/dist/core/agent-workflows/orchestrator.d.ts +29 -0
- package/dist/core/agent-workflows/react.d.ts +71 -0
- package/dist/core/agent-workflows/shared-context.d.ts +36 -0
- package/dist/core/agent-workflows/task-planner.d.ts +42 -0
- package/dist/core/agent-workflows/templates.d.ts +14 -0
- package/dist/core/agent-workflows/tool-registry.d.ts +24 -0
- package/dist/core/agent-workflows/types.d.ts +167 -0
- package/dist/core/ai-ecosystem/capability-registry.d.ts +23 -0
- package/dist/core/ai-ecosystem/index.d.ts +13 -0
- package/dist/core/ai-ecosystem/pipeline.d.ts +19 -0
- package/dist/core/ai-ecosystem/provider.d.ts +19 -0
- package/dist/core/ai-ecosystem/types.d.ts +69 -0
- package/dist/core/ai-motion-intelligence/engine.d.ts +51 -0
- package/dist/core/ai-motion-intelligence/explanation-engine.d.ts +8 -0
- package/dist/core/ai-motion-intelligence/index.d.ts +15 -0
- package/dist/core/ai-motion-intelligence/intent-classifier.d.ts +14 -0
- package/dist/core/ai-motion-intelligence/knowledge-base.d.ts +12 -0
- package/dist/core/ai-motion-intelligence/provider.d.ts +31 -0
- package/dist/core/ai-motion-intelligence/quality-evaluator.d.ts +9 -0
- package/dist/core/ai-motion-intelligence/react.d.ts +14 -0
- package/dist/core/ai-motion-intelligence/recommendation-engine.d.ts +16 -0
- package/dist/core/ai-motion-intelligence/types.d.ts +134 -0
- package/dist/core/ai-motion-registry.d.ts +201 -0
- package/dist/core/animate.d.ts +57 -0
- package/dist/core/animation-intelligence/engine.d.ts +42 -0
- package/dist/core/animation-intelligence/index.d.ts +11 -0
- package/dist/core/animation-intelligence/intent.d.ts +15 -0
- package/dist/core/animation-intelligence/schema.d.ts +42 -0
- package/dist/core/animation-intelligence/scoring.d.ts +15 -0
- package/dist/core/animation-intelligence/types.d.ts +91 -0
- package/dist/core/animation-parallel.d.ts +37 -0
- package/dist/core/animation-presets.d.ts +56 -0
- package/dist/core/animation-sequence.d.ts +37 -0
- package/dist/core/animation-timeline.d.ts +46 -0
- package/dist/core/animation.d.ts +48 -0
- package/dist/core/built-in-palettes.d.ts +331 -0
- package/dist/core/choreography-intelligence/bridge.d.ts +43 -0
- package/dist/core/choreography-intelligence/generator.d.ts +11 -0
- package/dist/core/choreography-intelligence/index.d.ts +11 -0
- package/dist/core/choreography-intelligence/intent.d.ts +11 -0
- package/dist/core/choreography-intelligence/schema.d.ts +76 -0
- package/dist/core/choreography-intelligence/types.d.ts +87 -0
- package/dist/core/composition.d.ts +170 -0
- package/dist/core/configuration-corrector.d.ts +85 -0
- package/dist/core/design-intelligence.d.ts +199 -0
- package/dist/core/design-system.d.ts +206 -0
- package/dist/core/design-to-motion/design-analyzer.d.ts +13 -0
- package/dist/core/design-to-motion/engine.d.ts +34 -0
- package/dist/core/design-to-motion/generator.d.ts +16 -0
- package/dist/core/design-to-motion/index.d.ts +15 -0
- package/dist/core/design-to-motion/input-parser.d.ts +17 -0
- package/dist/core/design-to-motion/motion-planner.d.ts +11 -0
- package/dist/core/design-to-motion/presets.d.ts +11 -0
- package/dist/core/design-to-motion/react.d.ts +13 -0
- package/dist/core/design-to-motion/types.d.ts +221 -0
- package/dist/core/design-to-motion/validator.d.ts +13 -0
- package/dist/core/device-capabilities/classification.d.ts +25 -0
- package/dist/core/device-capabilities/detection.d.ts +27 -0
- package/dist/core/device-capabilities/graphics.d.ts +22 -0
- package/dist/core/device-capabilities/hardware.d.ts +27 -0
- package/dist/core/device-capabilities/index.d.ts +14 -0
- package/dist/core/device-capabilities/monitor.d.ts +19 -0
- package/dist/core/device-capabilities/react.d.ts +24 -0
- package/dist/core/device-capabilities/runtime.d.ts +11 -0
- package/dist/core/device-capabilities/scoring.d.ts +18 -0
- package/dist/core/device-capabilities/types.d.ts +171 -0
- package/dist/core/effect-composer.d.ts +41 -0
- package/dist/core/generation-pipeline.d.ts +135 -0
- package/dist/core/inertia.d.ts +30 -0
- package/dist/core/interactions/cursor-controller.d.ts +9 -0
- package/dist/core/interactions/custom-gestures.d.ts +28 -0
- package/dist/core/interactions/device-capabilities.d.ts +12 -0
- package/dist/core/interactions/drag-controller.d.ts +60 -0
- package/dist/core/interactions/errors.d.ts +13 -0
- package/dist/core/interactions/gesture-classifier.d.ts +43 -0
- package/dist/core/interactions/gesture-intelligence-controller.d.ts +9 -0
- package/dist/core/interactions/gesture-recognizers.d.ts +160 -0
- package/dist/core/interactions/gesture-sequence.d.ts +9 -0
- package/dist/core/interactions/index.d.ts +27 -0
- package/dist/core/interactions/input-normalizer.d.ts +8 -0
- package/dist/core/interactions/interaction-manager.d.ts +43 -0
- package/dist/core/interactions/keyboard-manager.d.ts +16 -0
- package/dist/core/interactions/magnetic-controller.d.ts +9 -0
- package/dist/core/interactions/magnetic-group.d.ts +11 -0
- package/dist/core/interactions/multitouch-controller.d.ts +62 -0
- package/dist/core/interactions/pointer-controller.d.ts +34 -0
- package/dist/core/interactions/pointer-tracker.d.ts +32 -0
- package/dist/core/interactions/prioritizer.d.ts +17 -0
- package/dist/core/interactions/touch-controller.d.ts +35 -0
- package/dist/core/interactions/types.d.ts +710 -0
- package/dist/core/layout/controller.d.ts +56 -0
- package/dist/core/layout/flip.d.ts +21 -0
- package/dist/core/layout/group.d.ts +46 -0
- package/dist/core/layout/index.d.ts +12 -0
- package/dist/core/layout/measure.d.ts +30 -0
- package/dist/core/layout/presets.d.ts +24 -0
- package/dist/core/layout/types.d.ts +189 -0
- package/dist/core/microinteractions/generator.d.ts +11 -0
- package/dist/core/microinteractions/index.d.ts +11 -0
- package/dist/core/microinteractions/intent.d.ts +11 -0
- package/dist/core/microinteractions/runtime.d.ts +25 -0
- package/dist/core/microinteractions/schema.d.ts +82 -0
- package/dist/core/microinteractions/types.d.ts +79 -0
- package/dist/core/motion-choreography.d.ts +163 -0
- package/dist/core/motion-dna.d.ts +129 -0
- package/dist/core/motion-path/animator.d.ts +13 -0
- package/dist/core/motion-path/engine.d.ts +27 -0
- package/dist/core/motion-path/follower.d.ts +8 -0
- package/dist/core/motion-path/index.d.ts +15 -0
- package/dist/core/motion-path/lut.d.ts +33 -0
- package/dist/core/motion-path/parser.d.ts +26 -0
- package/dist/core/motion-path/segments.d.ts +16 -0
- package/dist/core/motion-path/types.d.ts +178 -0
- package/dist/core/motion-path/vector3.d.ts +49 -0
- package/dist/core/motion-recipe.d.ts +171 -0
- package/dist/core/motion-states.d.ts +43 -0
- package/dist/core/motion-validation/consistency.d.ts +11 -0
- package/dist/core/motion-validation/index.d.ts +11 -0
- package/dist/core/motion-validation/optimizer.d.ts +11 -0
- package/dist/core/motion-validation/schema.d.ts +81 -0
- package/dist/core/motion-validation/types.d.ts +53 -0
- package/dist/core/motion-validation/validator.d.ts +11 -0
- package/dist/core/motion.d.ts +7 -0
- package/dist/core/natural-motion.d.ts +110 -0
- package/dist/core/palette-colors.d.ts +16 -0
- package/dist/core/palette-styles.d.ts +12 -0
- package/dist/core/palettes.d.ts +59 -0
- package/dist/core/performance-intelligence/conflicts.d.ts +21 -0
- package/dist/core/performance-intelligence/context.d.ts +48 -0
- package/dist/core/performance-intelligence/coordinator.d.ts +84 -0
- package/dist/core/performance-intelligence/decisions.d.ts +17 -0
- package/dist/core/performance-intelligence/history.d.ts +44 -0
- package/dist/core/performance-intelligence/index.d.ts +15 -0
- package/dist/core/performance-intelligence/policies.d.ts +59 -0
- package/dist/core/performance-intelligence/react.d.ts +78 -0
- package/dist/core/performance-intelligence/report.d.ts +16 -0
- package/dist/core/performance-intelligence/scoring.d.ts +16 -0
- package/dist/core/performance-intelligence/types.d.ts +203 -0
- package/dist/core/performance-optimizer/bottlenecks.d.ts +9 -0
- package/dist/core/performance-optimizer/index.d.ts +13 -0
- package/dist/core/performance-optimizer/optimizer.d.ts +43 -0
- package/dist/core/performance-optimizer/profiler.d.ts +38 -0
- package/dist/core/performance-optimizer/react.d.ts +55 -0
- package/dist/core/performance-optimizer/strategies.d.ts +22 -0
- package/dist/core/performance-optimizer/types.d.ts +227 -0
- package/dist/core/performance-optimizer/workers.d.ts +27 -0
- package/dist/core/physics/collision-constraints.d.ts +15 -0
- package/dist/core/physics/collision-detection.d.ts +93 -0
- package/dist/core/physics/collision-response.d.ts +24 -0
- package/dist/core/physics/collision-types.d.ts +381 -0
- package/dist/core/physics/collision-world.d.ts +11 -0
- package/dist/core/physics/composition-behaviors.d.ts +97 -0
- package/dist/core/physics/composition-choreography.d.ts +14 -0
- package/dist/core/physics/composition-engine.d.ts +25 -0
- package/dist/core/physics/composition-recipes.d.ts +46 -0
- package/dist/core/physics/composition-types.d.ts +265 -0
- package/dist/core/physics/composition-validation.d.ts +33 -0
- package/dist/core/physics/index.d.ts +37 -0
- package/dist/core/physics/inertia-animation.d.ts +11 -0
- package/dist/core/physics/inertia-math.d.ts +56 -0
- package/dist/core/physics/inertia-presets.d.ts +25 -0
- package/dist/core/physics/inertia-simulation.d.ts +11 -0
- package/dist/core/physics/inertia-types.d.ts +355 -0
- package/dist/core/physics/inertia-validation.d.ts +22 -0
- package/dist/core/physics/math.d.ts +99 -0
- package/dist/core/physics/presets.d.ts +28 -0
- package/dist/core/physics/simulation.d.ts +11 -0
- package/dist/core/physics/spring-animation.d.ts +11 -0
- package/dist/core/physics/spring-math.d.ts +47 -0
- package/dist/core/physics/spring-presets.d.ts +29 -0
- package/dist/core/physics/spring-simulation.d.ts +11 -0
- package/dist/core/physics/spring-types.d.ts +350 -0
- package/dist/core/physics/spring-validation.d.ts +22 -0
- package/dist/core/physics/stepper.d.ts +24 -0
- package/dist/core/physics/types.d.ts +280 -0
- package/dist/core/physics/validation.d.ts +62 -0
- package/dist/core/pointer-capture.d.ts +7 -0
- package/dist/core/reference-analysis/index.d.ts +10 -0
- package/dist/core/reference-analysis/interpreter.d.ts +12 -0
- package/dist/core/reference-analysis/planner.d.ts +15 -0
- package/dist/core/reference-analysis/specification.d.ts +14 -0
- package/dist/core/reference-analysis/types.d.ts +244 -0
- package/dist/core/resource-intelligence/cache.d.ts +43 -0
- package/dist/core/resource-intelligence/gpu.d.ts +19 -0
- package/dist/core/resource-intelligence/index.d.ts +16 -0
- package/dist/core/resource-intelligence/leaks.d.ts +13 -0
- package/dist/core/resource-intelligence/memory.d.ts +27 -0
- package/dist/core/resource-intelligence/pooling.d.ts +32 -0
- package/dist/core/resource-intelligence/pressure.d.ts +32 -0
- package/dist/core/resource-intelligence/react.d.ts +63 -0
- package/dist/core/resource-intelligence/registry.d.ts +33 -0
- package/dist/core/resource-intelligence/reports.d.ts +14 -0
- package/dist/core/resource-intelligence/types.d.ts +232 -0
- package/dist/core/scene-generation/engine.d.ts +31 -0
- package/dist/core/scene-generation/generator.d.ts +14 -0
- package/dist/core/scene-generation/index.d.ts +14 -0
- package/dist/core/scene-generation/input-parser.d.ts +24 -0
- package/dist/core/scene-generation/presets.d.ts +10 -0
- package/dist/core/scene-generation/react.d.ts +13 -0
- package/dist/core/scene-generation/scene-analyzer.d.ts +9 -0
- package/dist/core/scene-generation/scene-planner.d.ts +12 -0
- package/dist/core/scene-generation/types.d.ts +236 -0
- package/dist/core/scene-generation/validator.d.ts +18 -0
- package/dist/core/schema.d.ts +185 -0
- package/dist/core/scroll-intelligence/generator.d.ts +11 -0
- package/dist/core/scroll-intelligence/index.d.ts +11 -0
- package/dist/core/scroll-intelligence/intent.d.ts +11 -0
- package/dist/core/scroll-intelligence/runtime.d.ts +21 -0
- package/dist/core/scroll-intelligence/schema.d.ts +78 -0
- package/dist/core/scroll-intelligence/types.d.ts +85 -0
- package/dist/core/spring.d.ts +38 -0
- package/dist/core/svg-morph/animator.d.ts +10 -0
- package/dist/core/svg-morph/arc-to-cubic.d.ts +11 -0
- package/dist/core/svg-morph/index.d.ts +10 -0
- package/dist/core/svg-morph/interpolate.d.ts +23 -0
- package/dist/core/svg-morph/normalize.d.ts +34 -0
- package/dist/core/svg-morph/parser.d.ts +13 -0
- package/dist/core/svg-morph/shapes.d.ts +32 -0
- package/dist/core/svg-morph/types.d.ts +144 -0
- package/dist/core/transform.d.ts +27 -0
- package/dist/core/transitions/controller.d.ts +45 -0
- package/dist/core/transitions/engine.d.ts +26 -0
- package/dist/core/transitions/group-transition.d.ts +30 -0
- package/dist/core/transitions/index.d.ts +15 -0
- package/dist/core/transitions/presets.d.ts +16 -0
- package/dist/core/transitions/schema.d.ts +71 -0
- package/dist/core/transitions/shared-element-transition.d.ts +88 -0
- package/dist/core/transitions/shared-element.d.ts +84 -0
- package/dist/core/transitions/types.d.ts +185 -0
- package/dist/core/transitions/view-transition.d.ts +25 -0
- package/dist/core/typography/engine.d.ts +19 -0
- package/dist/core/typography/index.d.ts +15 -0
- package/dist/core/typography/path-motion.d.ts +24 -0
- package/dist/core/typography/presets.d.ts +14 -0
- package/dist/core/typography/properties.d.ts +19 -0
- package/dist/core/typography/segmenter.d.ts +32 -0
- package/dist/core/typography/stagger.d.ts +15 -0
- package/dist/core/typography/transitions.d.ts +11 -0
- package/dist/core/typography/types.d.ts +154 -0
- package/dist/core/utils/safe-json.d.ts +50 -0
- package/dist/core/visual-style-registry.d.ts +659 -0
- package/dist/easing/easings.d.ts +44 -0
- package/dist/effects/border-beam.d.ts +28 -0
- package/dist/effects/count-up.d.ts +30 -0
- package/dist/effects/cursor-trail.d.ts +23 -0
- package/dist/effects/drag.d.ts +41 -0
- package/dist/effects/draw-svg.d.ts +19 -0
- package/dist/effects/follow-pointer.d.ts +19 -0
- package/dist/effects/glow.d.ts +25 -0
- package/dist/effects/gradient-text.d.ts +22 -0
- package/dist/effects/hover-motion.d.ts +32 -0
- package/dist/effects/in-view.d.ts +14 -0
- package/dist/effects/magnetic.d.ts +40 -0
- package/dist/effects/morph-svg.d.ts +15 -0
- package/dist/effects/parallax.d.ts +42 -0
- package/dist/effects/pinch.d.ts +27 -0
- package/dist/effects/reveal.d.ts +33 -0
- package/dist/effects/ripple.d.ts +21 -0
- package/dist/effects/scroll-animate.d.ts +23 -0
- package/dist/effects/scroll-direction.d.ts +19 -0
- package/dist/effects/scroll-progress.d.ts +29 -0
- package/dist/effects/scroll-trigger.d.ts +22 -0
- package/dist/effects/scroll-velocity.d.ts +29 -0
- package/dist/effects/shine.d.ts +23 -0
- package/dist/effects/split-text.d.ts +17 -0
- package/dist/effects/spotlight.d.ts +24 -0
- package/dist/effects/stagger.d.ts +46 -0
- package/dist/effects/swipe.d.ts +27 -0
- package/dist/effects/text-highlight.d.ts +25 -0
- package/dist/effects/text-mask.d.ts +25 -0
- package/dist/effects/text-reveal.d.ts +28 -0
- package/dist/effects/text-scramble.d.ts +18 -0
- package/dist/effects/tilt.d.ts +42 -0
- package/dist/effects/typewriter.d.ts +26 -0
- package/dist/graphics/capabilities.d.ts +12 -0
- package/dist/graphics/composition/engine.d.ts +14 -0
- package/dist/graphics/composition/fallback.d.ts +13 -0
- package/dist/graphics/composition/index.d.ts +10 -0
- package/dist/graphics/composition/ordering.d.ts +29 -0
- package/dist/graphics/composition/quality.d.ts +24 -0
- package/dist/graphics/composition/schema.d.ts +156 -0
- package/dist/graphics/composition/types.d.ts +81 -0
- package/dist/graphics/composition/unified.d.ts +23 -0
- package/dist/graphics/effects/advanced/engine.d.ts +9 -0
- package/dist/graphics/effects/advanced/index.d.ts +1 -0
- package/dist/graphics/effects/composer.d.ts +9 -0
- package/dist/graphics/effects/distortion/engine.d.ts +9 -0
- package/dist/graphics/effects/distortion/index.d.ts +1 -0
- package/dist/graphics/effects/fluid/engine.d.ts +9 -0
- package/dist/graphics/effects/fluid/index.d.ts +1 -0
- package/dist/graphics/effects/index.d.ts +10 -0
- package/dist/graphics/effects/particles/engine.d.ts +9 -0
- package/dist/graphics/effects/particles/index.d.ts +2 -0
- package/dist/graphics/effects/particles/pool.d.ts +17 -0
- package/dist/graphics/effects/schema.d.ts +312 -0
- package/dist/graphics/effects/types.d.ts +85 -0
- package/dist/graphics/engine.d.ts +5 -0
- package/dist/graphics/environment/clouds.d.ts +28 -0
- package/dist/graphics/environment/environment.d.ts +50 -0
- package/dist/graphics/environment/fire-smoke.d.ts +32 -0
- package/dist/graphics/environment/fog.d.ts +28 -0
- package/dist/graphics/environment/index.d.ts +18 -0
- package/dist/graphics/environment/lightning.d.ts +33 -0
- package/dist/graphics/environment/rain.d.ts +33 -0
- package/dist/graphics/environment/snow.d.ts +30 -0
- package/dist/graphics/environment/types.d.ts +184 -0
- package/dist/graphics/environment/weather.d.ts +19 -0
- package/dist/graphics/environment/wind.d.ts +23 -0
- package/dist/graphics/fluid/flow-field.d.ts +74 -0
- package/dist/graphics/fluid/grid.d.ts +43 -0
- package/dist/graphics/fluid/index.d.ts +13 -0
- package/dist/graphics/fluid/interactions.d.ts +39 -0
- package/dist/graphics/fluid/rendering.d.ts +32 -0
- package/dist/graphics/fluid/simulation.d.ts +50 -0
- package/dist/graphics/fluid/solver.d.ts +19 -0
- package/dist/graphics/fluid/types.d.ts +186 -0
- package/dist/graphics/gpu-simulation/backends/backend.d.ts +24 -0
- package/dist/graphics/gpu-simulation/backends/cpu.d.ts +21 -0
- package/dist/graphics/gpu-simulation/backends/selection.d.ts +15 -0
- package/dist/graphics/gpu-simulation/backends/webgl2.d.ts +28 -0
- package/dist/graphics/gpu-simulation/backends/webgpu.d.ts +23 -0
- package/dist/graphics/gpu-simulation/capabilities.d.ts +14 -0
- package/dist/graphics/gpu-simulation/device.d.ts +17 -0
- package/dist/graphics/gpu-simulation/engine.d.ts +8 -0
- package/dist/graphics/gpu-simulation/index.d.ts +22 -0
- package/dist/graphics/gpu-simulation/ping-pong.d.ts +23 -0
- package/dist/graphics/gpu-simulation/pipeline.d.ts +18 -0
- package/dist/graphics/gpu-simulation/resource-manager.d.ts +8 -0
- package/dist/graphics/gpu-simulation/shaders.d.ts +50 -0
- package/dist/graphics/gpu-simulation/types.d.ts +288 -0
- package/dist/graphics/index.d.ts +23 -0
- package/dist/graphics/materials/glass.d.ts +22 -0
- package/dist/graphics/materials/index.d.ts +9 -0
- package/dist/graphics/materials/lighting.d.ts +22 -0
- package/dist/graphics/materials/presets.d.ts +28 -0
- package/dist/graphics/materials/schema.d.ts +574 -0
- package/dist/graphics/materials/surface.d.ts +13 -0
- package/dist/graphics/materials/types.d.ts +150 -0
- package/dist/graphics/particle-fields/composition.d.ts +32 -0
- package/dist/graphics/particle-fields/forces.d.ts +103 -0
- package/dist/graphics/particle-fields/index.d.ts +12 -0
- package/dist/graphics/particle-fields/interaction.d.ts +32 -0
- package/dist/graphics/particle-fields/spatial-index.d.ts +20 -0
- package/dist/graphics/particle-fields/system.d.ts +52 -0
- package/dist/graphics/particle-fields/types.d.ts +138 -0
- package/dist/graphics/particles/behaviors.d.ts +11 -0
- package/dist/graphics/particles/controller.d.ts +82 -0
- package/dist/graphics/particles/data-layout.d.ts +51 -0
- package/dist/graphics/particles/emitters.d.ts +24 -0
- package/dist/graphics/particles/index.d.ts +15 -0
- package/dist/graphics/particles/random.d.ts +25 -0
- package/dist/graphics/particles/rendering.d.ts +16 -0
- package/dist/graphics/particles/simulation.d.ts +23 -0
- package/dist/graphics/particles/types.d.ts +282 -0
- package/dist/graphics/renderer.d.ts +66 -0
- package/dist/graphics/resource-manager.d.ts +6 -0
- package/dist/graphics/schema.d.ts +177 -0
- package/dist/graphics/simulation/adapters.d.ts +36 -0
- package/dist/graphics/simulation/coordinator.d.ts +64 -0
- package/dist/graphics/simulation/index.d.ts +11 -0
- package/dist/graphics/simulation/optimizer.d.ts +101 -0
- package/dist/graphics/simulation/resource-manager.d.ts +40 -0
- package/dist/graphics/simulation/types.d.ts +126 -0
- package/dist/graphics/textures/cache.d.ts +29 -0
- package/dist/graphics/textures/canvas-utils.d.ts +31 -0
- package/dist/graphics/textures/engine.d.ts +34 -0
- package/dist/graphics/textures/generators.d.ts +29 -0
- package/dist/graphics/textures/index.d.ts +11 -0
- package/dist/graphics/textures/material-integration.d.ts +20 -0
- package/dist/graphics/textures/prng.d.ts +27 -0
- package/dist/graphics/textures/schema.d.ts +219 -0
- package/dist/graphics/textures/types.d.ts +80 -0
- package/dist/graphics/types.d.ts +152 -0
- package/dist/graphics/viewport.d.ts +32 -0
- package/dist/index.d.ts +132 -0
- package/dist/index.js +4921 -0
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/prompts.d.ts +9 -0
- package/dist/mcp/resources.d.ts +9 -0
- package/dist/mcp/server.d.ts +29 -0
- package/dist/mcp/tools.d.ts +9 -0
- package/dist/mcp/transport.d.ts +33 -0
- package/dist/mcp/types.d.ts +96 -0
- package/dist/presets.d.ts +176 -0
- package/dist/presets.js +3 -0
- package/dist/react.d.ts +5358 -0
- package/dist/react.js +7557 -0
- package/package.json +112 -6
|
@@ -0,0 +1,904 @@
|
|
|
1
|
+
import { R as e, n as t, o as n, r, s as i, t as a, z as o } from "./core-animation-CeiI_TEe.js";
|
|
2
|
+
// src/core/animation-timeline.ts
|
|
3
|
+
var s = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
function c() {
|
|
5
|
+
let e = /* @__PURE__ */ Error("Animation timeline was cancelled");
|
|
6
|
+
return e.name = "AbortError", e;
|
|
7
|
+
}
|
|
8
|
+
function l(e) {
|
|
9
|
+
if (typeof e != "string" || !/^[A-Za-z_][A-Za-z0-9_-]*$/.test(e)) throw TypeError(`Invalid timeline label "${String(e)}"; use letters, numbers, "_" or "-"`);
|
|
10
|
+
}
|
|
11
|
+
function u(e) {
|
|
12
|
+
if (e !== void 0 && (typeof e != "number" || !Number.isFinite(e))) throw RangeError(`Timeline position offset must be a finite number, received ${String(e)}`);
|
|
13
|
+
}
|
|
14
|
+
function d(e) {
|
|
15
|
+
if (typeof e == "number") {
|
|
16
|
+
if (!Number.isFinite(e) || e < 0) throw RangeError(`Timeline step position must be a finite number >= 0, received ${String(e)}`);
|
|
17
|
+
} else if (typeof e == "string") l(e);
|
|
18
|
+
else if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Timeline step position must be a number, label, or relative position");
|
|
19
|
+
else if ("label" in e) l(e.label), u(e.offset);
|
|
20
|
+
else if ("previous" in e) {
|
|
21
|
+
if (e.previous !== "start" && e.previous !== "end") throw TypeError("Relative timeline position \"previous\" must be \"start\" or \"end\"");
|
|
22
|
+
u(e.offset);
|
|
23
|
+
} else throw TypeError("Timeline step position must specify a label or previous step");
|
|
24
|
+
}
|
|
25
|
+
function f(e) {
|
|
26
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Animation timeline step must be an object");
|
|
27
|
+
if (d(e.at), e.options !== void 0 && (e.options === null || typeof e.options != "object")) throw TypeError("Timeline step options must be an object");
|
|
28
|
+
}
|
|
29
|
+
function p(e) {
|
|
30
|
+
let t = Object.fromEntries(Object.entries(e.properties).map(([e, t]) => [e, [t[0], t[1]]]));
|
|
31
|
+
return {
|
|
32
|
+
target: e.target,
|
|
33
|
+
properties: t,
|
|
34
|
+
at: typeof e.at == "object" ? { ...e.at } : e.at,
|
|
35
|
+
...e.options ? { options: { ...e.options } } : {}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function m(e) {
|
|
39
|
+
if (e.child) return e.child.duration;
|
|
40
|
+
let t = e.step?.options, n = t?.duration ?? 1e3;
|
|
41
|
+
return (t?.delay ?? 0) + n / (t?.playbackRate ?? 1);
|
|
42
|
+
}
|
|
43
|
+
function h(e, t, n) {
|
|
44
|
+
let r;
|
|
45
|
+
if (typeof e == "number") r = e;
|
|
46
|
+
else if (typeof e == "string") {
|
|
47
|
+
let n = t.get(e);
|
|
48
|
+
if (n === void 0) throw ReferenceError(`Unresolved timeline label "${e}"`);
|
|
49
|
+
r = n;
|
|
50
|
+
} else if ("label" in e) {
|
|
51
|
+
let n = t.get(e.label);
|
|
52
|
+
if (n === void 0) throw ReferenceError(`Unresolved timeline label "${e.label}"`);
|
|
53
|
+
r = n + (e.offset ?? 0);
|
|
54
|
+
} else {
|
|
55
|
+
if (!n) throw RangeError("The first timeline entry cannot be positioned relative to a previous entry");
|
|
56
|
+
r = (e.previous === "start" ? n.startAt : n.startAt + m(n)) + (e.offset ?? 0);
|
|
57
|
+
}
|
|
58
|
+
if (!Number.isFinite(r) || r < 0) throw RangeError(`Resolved timeline position must be finite and >= 0, received ${String(r)}`);
|
|
59
|
+
return r;
|
|
60
|
+
}
|
|
61
|
+
function g(e, t, n = /* @__PURE__ */ new Set()) {
|
|
62
|
+
return e === t || !n.has(e) && (n.add(e), e.entries.some((e) => e.child !== void 0 && g(e.child, t, n)));
|
|
63
|
+
}
|
|
64
|
+
function _() {
|
|
65
|
+
let e = [], t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = () => void 0, o = () => void 0, u, _ = !1, v = !1, y = !1, b = !1, x = 0, S = 0, C = 0, w = 0, T = 1, E = 0, D = 0, O = () => {
|
|
66
|
+
u = new Promise((e, t) => {
|
|
67
|
+
i = e, o = t;
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
O();
|
|
71
|
+
let k = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), A = () => x + (b ? 0 : Math.max(0, k() - S) * T), j = () => {
|
|
72
|
+
for (let t of e) t.timer !== null && (clearTimeout(t.timer), t.timer = null);
|
|
73
|
+
}, M, N, P = (e, t = !0, i = !0) => {
|
|
74
|
+
if (e.control) {
|
|
75
|
+
e.suppressCancel = i, n.delete(e.control);
|
|
76
|
+
let t = e.control;
|
|
77
|
+
e.control = null, t.cancel();
|
|
78
|
+
}
|
|
79
|
+
e.child && t && (e.child.played || e.child.settled) ? (r.delete(e.child.controls), e.child.resetNested()) : e.child && !t && e.child.played && !e.child.settled && (r.delete(e.child.controls), e.child.controls.cancel()), e.started = !1, e.done && (e.done = !1, C--);
|
|
80
|
+
}, F = (t = !1) => {
|
|
81
|
+
let i = [];
|
|
82
|
+
for (let n of e) try {
|
|
83
|
+
n.control || n.child?.played && !n.child.settled ? P(n, t, t) : n.child && t && n.child.settled && n.child.resetNested();
|
|
84
|
+
} catch (e) {
|
|
85
|
+
i.push(e);
|
|
86
|
+
}
|
|
87
|
+
if (n.clear(), r.clear(), i.length > 0) throw AggregateError(i, "Animation timeline cleanup failed");
|
|
88
|
+
}, I = (e, t = E) => {
|
|
89
|
+
if (!(_ || t !== E)) {
|
|
90
|
+
_ = !0, N.settled = !0, j();
|
|
91
|
+
try {
|
|
92
|
+
F(!1), o(e);
|
|
93
|
+
} catch (t) {
|
|
94
|
+
o(AggregateError([e, t], "Animation timeline failed during cleanup"));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}, L = (t) => {
|
|
98
|
+
_ || t.done || (t.done = !0, C++, C === e.length && (_ = !0, N.settled = !0, i()));
|
|
99
|
+
}, R = (e, t = 0, i = !1) => {
|
|
100
|
+
if (e.timer = null, _ || v || b && !i || e.started) return;
|
|
101
|
+
e.started = !0;
|
|
102
|
+
let o = E;
|
|
103
|
+
if (e.child) {
|
|
104
|
+
let n = e.child.controls;
|
|
105
|
+
e.child.settled && e.child.resetNested(), n.setPlaybackRate(T), r.add(n);
|
|
106
|
+
let i = e.child.generation;
|
|
107
|
+
n.finished.then(() => {
|
|
108
|
+
r.delete(n), o === E && i === e.child?.generation && L(e);
|
|
109
|
+
}, (t) => {
|
|
110
|
+
r.delete(n), i === e.child?.generation && I(t, o);
|
|
111
|
+
});
|
|
112
|
+
try {
|
|
113
|
+
t > 0 && n.seek(t), e.child.startNested(), b && n.pause();
|
|
114
|
+
} catch (e) {
|
|
115
|
+
I(e, o);
|
|
116
|
+
}
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
let s = e.step;
|
|
120
|
+
if (!s) {
|
|
121
|
+
I(/* @__PURE__ */ Error("Timeline entry has no animation step"), o);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
let c = s.options?.delay ?? 0, l = s.options?.duration ?? 1e3, u = s.options?.playbackRate ?? 1, d = Math.max(0, t - c), f = l === 0 ? +(t >= c) : Math.min(1, d * u / l), p = {
|
|
125
|
+
...s.options,
|
|
126
|
+
delay: Math.max(0, c - t) / T,
|
|
127
|
+
playbackRate: u * T,
|
|
128
|
+
onStart: () => {
|
|
129
|
+
try {
|
|
130
|
+
s.options?.onStart?.();
|
|
131
|
+
} catch (e) {
|
|
132
|
+
throw I(e, o), e;
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
onUpdate: (e) => {
|
|
136
|
+
try {
|
|
137
|
+
s.options?.onUpdate?.(e);
|
|
138
|
+
} catch (e) {
|
|
139
|
+
throw I(e, o), e;
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
onComplete: () => {
|
|
143
|
+
try {
|
|
144
|
+
if (s.options?.onComplete?.(), o !== E) return;
|
|
145
|
+
e.control && n.delete(e.control), L(e);
|
|
146
|
+
} catch (e) {
|
|
147
|
+
throw I(e, o), e;
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
onCancel: () => {
|
|
151
|
+
e.suppressCancel || s.options?.onCancel?.(), e.suppressCancel = !1;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
try {
|
|
155
|
+
e.control = a(s.target, s.properties, p), (f > 0 || l === 0 && t >= c) && e.control.seek(f), n.add(e.control), b && e.control.pause();
|
|
156
|
+
} catch (e) {
|
|
157
|
+
I(e, o);
|
|
158
|
+
}
|
|
159
|
+
}, z = () => {
|
|
160
|
+
if (!y || b || _) return;
|
|
161
|
+
let t = A();
|
|
162
|
+
for (let n of e) {
|
|
163
|
+
if (n.started || n.timer !== null) continue;
|
|
164
|
+
let e = Math.max(0, n.startAt - t);
|
|
165
|
+
n.timer = setTimeout(() => R(n, Math.max(0, A() - n.startAt)), e / T);
|
|
166
|
+
}
|
|
167
|
+
}, B = () => {
|
|
168
|
+
w = 0;
|
|
169
|
+
for (let n = 0; n < e.length; n++) {
|
|
170
|
+
let r = e[n];
|
|
171
|
+
r && (r.child && r.child.resolvePositions(), r.startAt = h(r.position, t, e[n - 1]), w = Math.max(w, r.startAt + m(r)));
|
|
172
|
+
}
|
|
173
|
+
return w;
|
|
174
|
+
}, V = (t) => {
|
|
175
|
+
let n = o;
|
|
176
|
+
E++, j(), F(!0), _ = !1, v = !1, y = !1, b = !1, C = 0, x = 0, D = 0;
|
|
177
|
+
for (let t of e) t.started = !1, t.done = !1, t.control = null, t.suppressCancel = !1;
|
|
178
|
+
O(), N.played = !1, N.settled = !1, N.cancelled = !1, N.generation = E, t && n(c());
|
|
179
|
+
}, H = (t) => {
|
|
180
|
+
if (!t && N.parent) throw Error("A nested timeline can only be played by its parent");
|
|
181
|
+
if (!(y || _ || v)) {
|
|
182
|
+
if (y = !0, N.played = !0, e.length === 0) _ = !0, N.settled = !0, i();
|
|
183
|
+
else {
|
|
184
|
+
try {
|
|
185
|
+
N.resolvePositions();
|
|
186
|
+
} catch (e) {
|
|
187
|
+
I(e);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
x = D, S = k(), z();
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
return M = {
|
|
195
|
+
get finished() {
|
|
196
|
+
return u;
|
|
197
|
+
},
|
|
198
|
+
add: (t) => {
|
|
199
|
+
if (y || _ || v || N.parent) throw Error("Cannot add steps after timeline playback has started or nesting");
|
|
200
|
+
return f(t), e.push({
|
|
201
|
+
position: typeof t.at == "object" ? { ...t.at } : t.at,
|
|
202
|
+
step: p(t),
|
|
203
|
+
startAt: 0,
|
|
204
|
+
timer: null,
|
|
205
|
+
started: !1,
|
|
206
|
+
done: !1,
|
|
207
|
+
control: null,
|
|
208
|
+
suppressCancel: !1
|
|
209
|
+
}), M;
|
|
210
|
+
},
|
|
211
|
+
addTimeline: (t, n) => {
|
|
212
|
+
if (y || _ || v) throw Error("Cannot add timelines after timeline playback has started");
|
|
213
|
+
d(n);
|
|
214
|
+
let r = s.get(t);
|
|
215
|
+
if (!r) throw TypeError("Nested timeline must be created by createTimeline()");
|
|
216
|
+
if (r === N || g(r, N)) throw TypeError("Circular timeline nesting is not allowed");
|
|
217
|
+
if (N.parent) throw Error("Cannot add timelines after timeline playback has started or nesting");
|
|
218
|
+
if (r.played || r.settled || r.cancelled || r.parent) throw TypeError("A timeline can only be nested once, before playback starts");
|
|
219
|
+
return r.parent = N, e.push({
|
|
220
|
+
position: typeof n == "object" ? { ...n } : n,
|
|
221
|
+
child: r,
|
|
222
|
+
startAt: 0,
|
|
223
|
+
timer: null,
|
|
224
|
+
started: !1,
|
|
225
|
+
done: !1,
|
|
226
|
+
control: null,
|
|
227
|
+
suppressCancel: !1
|
|
228
|
+
}), M;
|
|
229
|
+
},
|
|
230
|
+
addLabel: (e, n) => {
|
|
231
|
+
if (y || _ || v || N.parent) throw Error("Cannot add labels after timeline playback has started or nesting");
|
|
232
|
+
if (l(e), typeof n != "number" || !Number.isFinite(n) || n < 0) throw RangeError(`Timeline label position must be a finite number >= 0, received ${String(n)}`);
|
|
233
|
+
if (t.has(e)) throw TypeError(`Timeline label "${e}" is already defined`);
|
|
234
|
+
return t.set(e, n), M;
|
|
235
|
+
},
|
|
236
|
+
play: () => H(!1),
|
|
237
|
+
pause: () => {
|
|
238
|
+
if (!(!y || _ || b)) {
|
|
239
|
+
x = A(), b = !0, j();
|
|
240
|
+
for (let e of n) e.pause();
|
|
241
|
+
for (let e of r) e.pause();
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
resume: () => {
|
|
245
|
+
if (b && !_) {
|
|
246
|
+
b = !1, S = k();
|
|
247
|
+
for (let e of n) e.resume();
|
|
248
|
+
for (let e of r) e.resume();
|
|
249
|
+
z();
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
seek: (t) => {
|
|
253
|
+
if (typeof t != "number" || !Number.isFinite(t) || t < 0) throw RangeError(`Timeline seek time must be a finite number >= 0, received ${String(t)}`);
|
|
254
|
+
if (_) throw Error("Cannot seek a completed timeline; call restart() first");
|
|
255
|
+
if (v) throw Error("Cannot seek a cancelled timeline; call restart() first");
|
|
256
|
+
if (D = t, !y) {
|
|
257
|
+
x = t;
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
let i = b;
|
|
261
|
+
b || M.pause(), x = t, S = k();
|
|
262
|
+
for (let r of e) {
|
|
263
|
+
r.timer !== null && (clearTimeout(r.timer), r.timer = null);
|
|
264
|
+
let e = t - r.startAt;
|
|
265
|
+
if (r.child) {
|
|
266
|
+
e < 0 ? P(r) : (r.started = !1, r.done && (r.done = !1, C--), r.child.settled && r.child.resetNested(), r.child.controls.seek(e), R(r, e, !0));
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
let i = r.step;
|
|
270
|
+
if (!i || e < 0) {
|
|
271
|
+
P(r);
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
let a = i.options?.delay ?? 0;
|
|
275
|
+
if (e < a && r.control && P(r), r.done && (r.done = !1, C--), r.control && e >= a) {
|
|
276
|
+
let t = i.options?.duration ?? 1e3, o = i.options?.playbackRate ?? 1, s = t === 0 ? 1 : Math.min(1, (e - a) * o / t);
|
|
277
|
+
r.control.seek(s), s < 1 && n.add(r.control);
|
|
278
|
+
} else r.started = !1, R(r, e, !0);
|
|
279
|
+
}
|
|
280
|
+
if (!i) {
|
|
281
|
+
b = !1, S = k();
|
|
282
|
+
for (let e of n) e.resume();
|
|
283
|
+
for (let e of r) e.resume();
|
|
284
|
+
z();
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
restart: () => {
|
|
288
|
+
if (N.parent) throw Error("A nested timeline can only be restarted by its parent");
|
|
289
|
+
V(!0), H(!1);
|
|
290
|
+
},
|
|
291
|
+
setPlaybackRate: (t) => {
|
|
292
|
+
if (typeof t != "number" || !Number.isFinite(t) || t <= 0) throw RangeError(`playbackRate must be a finite number > 0, received ${String(t)}`);
|
|
293
|
+
y && !b && (x = A(), S = k()), T = t;
|
|
294
|
+
for (let t of e) t.control && !t.done && t.control.setPlaybackRate((t.step?.options?.playbackRate ?? 1) * T), t.child && t.started && t.child.controls.setPlaybackRate(T);
|
|
295
|
+
y && !b && (j(), z());
|
|
296
|
+
},
|
|
297
|
+
getPlaybackRate: () => T,
|
|
298
|
+
cancel: () => {
|
|
299
|
+
_ || v || (v = !0, N.cancelled = !0, j(), I(c()));
|
|
300
|
+
}
|
|
301
|
+
}, N = {
|
|
302
|
+
controls: M,
|
|
303
|
+
entries: e,
|
|
304
|
+
labels: t,
|
|
305
|
+
parent: null,
|
|
306
|
+
played: !1,
|
|
307
|
+
settled: !1,
|
|
308
|
+
cancelled: !1,
|
|
309
|
+
generation: E,
|
|
310
|
+
duration: w,
|
|
311
|
+
resolvePositions: () => {
|
|
312
|
+
let e = B();
|
|
313
|
+
return N.duration = e, e;
|
|
314
|
+
},
|
|
315
|
+
startNested: () => H(!0),
|
|
316
|
+
pause: () => M.pause(),
|
|
317
|
+
resume: () => M.resume(),
|
|
318
|
+
cancel: () => M.cancel(),
|
|
319
|
+
resetNested: () => V(!0),
|
|
320
|
+
setPlaybackRate: (e) => M.setPlaybackRate(e)
|
|
321
|
+
}, s.set(M, N), M;
|
|
322
|
+
}
|
|
323
|
+
// src/effects/reveal.ts
|
|
324
|
+
var v = {
|
|
325
|
+
opacity: [0, 1],
|
|
326
|
+
transform: ["translateY(24px)", "translateY(0px)"]
|
|
327
|
+
}, y = 600, b = .15;
|
|
328
|
+
function x(e) {
|
|
329
|
+
if ((Array.isArray(e) ? e : [e]).some((e) => typeof e != "number" || !Number.isFinite(e) || e < 0 || e > 1)) throw RangeError(`threshold must be a number (or numbers) between 0 and 1, received ${String(e)}`);
|
|
330
|
+
}
|
|
331
|
+
function S(e, n = {}) {
|
|
332
|
+
if (typeof IntersectionObserver > "u") throw Error("reveal() requires IntersectionObserver, which is not available in this environment");
|
|
333
|
+
let { properties: i = v, duration: o = y, delay: s, easing: c, threshold: l = b, rootMargin: u = "0px", once: d = !0 } = n, f = {
|
|
334
|
+
duration: o,
|
|
335
|
+
...s === void 0 ? {} : { delay: s },
|
|
336
|
+
...c === void 0 ? {} : { easing: c }
|
|
337
|
+
};
|
|
338
|
+
x(l);
|
|
339
|
+
let p = t(e), m = typeof i == "object" && i ? Object.keys(i).map(r) : [], h = /* @__PURE__ */ new Map();
|
|
340
|
+
for (let e of p) h.set(e, m.map((t) => [t, e.style.getPropertyValue(t)]));
|
|
341
|
+
let g = (e) => {
|
|
342
|
+
for (let [t, n] of h.get(e) ?? []) n === "" ? e.style.removeProperty(t) : e.style.setProperty(t, n);
|
|
343
|
+
}, _ = () => {
|
|
344
|
+
for (let e of p) g(e);
|
|
345
|
+
};
|
|
346
|
+
try {
|
|
347
|
+
a(e, i, f).cancel();
|
|
348
|
+
} catch (e) {
|
|
349
|
+
throw _(), e;
|
|
350
|
+
}
|
|
351
|
+
if (p.length === 0) return { destroy: () => void 0 };
|
|
352
|
+
let S = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Set(), T = !1, E = (e) => {
|
|
353
|
+
S.get(e)?.cancel();
|
|
354
|
+
let t = a(e, i, {
|
|
355
|
+
...f,
|
|
356
|
+
onComplete: () => {
|
|
357
|
+
S.get(e) === t && S.delete(e);
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
S.set(e, t);
|
|
361
|
+
}, D;
|
|
362
|
+
try {
|
|
363
|
+
D = new IntersectionObserver((e) => {
|
|
364
|
+
if (!T) for (let t of e) {
|
|
365
|
+
let e = t.target;
|
|
366
|
+
t.isIntersecting ? C.has(e) || d && w.has(e) || (C.add(e), w.add(e), d && D.unobserve(e), E(e)) : C.delete(e);
|
|
367
|
+
}
|
|
368
|
+
}, {
|
|
369
|
+
threshold: l,
|
|
370
|
+
rootMargin: u
|
|
371
|
+
});
|
|
372
|
+
} catch (e) {
|
|
373
|
+
throw _(), e;
|
|
374
|
+
}
|
|
375
|
+
for (let e of p) D.observe(e);
|
|
376
|
+
return { destroy: () => {
|
|
377
|
+
if (!T) {
|
|
378
|
+
T = !0, D.disconnect();
|
|
379
|
+
for (let e of S.values()) e.cancel();
|
|
380
|
+
S.clear();
|
|
381
|
+
for (let e of p) w.has(e) || g(e);
|
|
382
|
+
C.clear(), w.clear();
|
|
383
|
+
}
|
|
384
|
+
} };
|
|
385
|
+
}
|
|
386
|
+
// src/effects/parallax.ts
|
|
387
|
+
var C = .3, w = 100, T = (e) => e;
|
|
388
|
+
function E(e) {
|
|
389
|
+
return Math.round(e * 100) / 100;
|
|
390
|
+
}
|
|
391
|
+
function D(r, a = {}) {
|
|
392
|
+
let { speed: s = C, axis: c = "y", maxOffset: l = w, easing: u = T } = a;
|
|
393
|
+
if (typeof s != "number" || !Number.isFinite(s)) throw RangeError(`speed must be a finite number, received ${String(s)}`);
|
|
394
|
+
if (typeof l != "number" || !Number.isFinite(l) || l < 0) throw RangeError(`maxOffset must be a finite number >= 0, received ${String(l)}`);
|
|
395
|
+
if (c !== "x" && c !== "y") throw TypeError(`axis must be "x" or "y", received ${String(c)}`);
|
|
396
|
+
if (typeof u != "function") throw TypeError("easing must be a function");
|
|
397
|
+
if (typeof window > "u" || typeof requestAnimationFrame != "function") throw Error("parallax() requires window and requestAnimationFrame, which are not available in this environment");
|
|
398
|
+
let d = t(r);
|
|
399
|
+
if (d.length === 0) return { destroy: () => void 0 };
|
|
400
|
+
let f = /* @__PURE__ */ new Map();
|
|
401
|
+
for (let e of d) f.set(e, {
|
|
402
|
+
pageCenter: 0,
|
|
403
|
+
written: !1,
|
|
404
|
+
offset: 0
|
|
405
|
+
});
|
|
406
|
+
let p = null, m = !0, h = !1, g = (e) => c === "y" ? `translate(0px, ${e.offset}px)` : `translate(${e.offset}px, 0px)`, _ = (e, t) => {
|
|
407
|
+
t.written && (n(e, t), t.written = !1, t.offset = 0);
|
|
408
|
+
}, v = () => {
|
|
409
|
+
let e = [];
|
|
410
|
+
for (let [t, n] of f) n.written && (i(t, n, ""), e.push([t, n]));
|
|
411
|
+
let t = window.scrollX ?? 0, n = window.scrollY ?? 0;
|
|
412
|
+
for (let [e, r] of f) {
|
|
413
|
+
let i = e.getBoundingClientRect();
|
|
414
|
+
r.pageCenter = c === "y" ? i.top + i.height / 2 + n : i.left + i.width / 2 + t;
|
|
415
|
+
}
|
|
416
|
+
for (let [t, n] of e) i(t, n, g(n));
|
|
417
|
+
m = !1;
|
|
418
|
+
}, y = (e, t, n) => {
|
|
419
|
+
if (l === 0) return 0;
|
|
420
|
+
let r = -(e.pageCenter - t - n / 2) * s, i = Math.min(Math.abs(r) / l, 1), a = u(i);
|
|
421
|
+
return Number.isFinite(a) ? E(Math.sign(r) * a * l) + 0 : e.offset;
|
|
422
|
+
}, b = () => {
|
|
423
|
+
if (h) return;
|
|
424
|
+
if (o()) {
|
|
425
|
+
for (let [e, t] of f) _(e, t);
|
|
426
|
+
m = !0;
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
m && v();
|
|
430
|
+
let e = c === "y" ? window.scrollY ?? 0 : window.scrollX ?? 0, t = (c === "y" ? window.innerHeight : window.innerWidth) || 0;
|
|
431
|
+
for (let [n, r] of f) {
|
|
432
|
+
let a = y(r, e, t);
|
|
433
|
+
a !== r.offset && (r.written = !0, r.offset = a, i(n, r, g(r)));
|
|
434
|
+
}
|
|
435
|
+
}, x = () => {
|
|
436
|
+
h || p !== null || (p = requestAnimationFrame(() => {
|
|
437
|
+
p = null, b();
|
|
438
|
+
}));
|
|
439
|
+
}, S = () => x(), D = () => {
|
|
440
|
+
m = !0, x();
|
|
441
|
+
};
|
|
442
|
+
window.addEventListener("scroll", S, { passive: !0 }), window.addEventListener("resize", D, { passive: !0 });
|
|
443
|
+
let O = e(() => {
|
|
444
|
+
m = !0, b();
|
|
445
|
+
});
|
|
446
|
+
return b(), { destroy: () => {
|
|
447
|
+
if (!h) {
|
|
448
|
+
h = !0, window.removeEventListener("scroll", S), window.removeEventListener("resize", D), O(), p !== null && (cancelAnimationFrame(p), p = null);
|
|
449
|
+
for (let [e, t] of f) _(e, t);
|
|
450
|
+
f.clear();
|
|
451
|
+
}
|
|
452
|
+
} };
|
|
453
|
+
}
|
|
454
|
+
// src/effects/text-scramble.ts
|
|
455
|
+
var O = 1e3, k = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", A = 30;
|
|
456
|
+
function j(e) {
|
|
457
|
+
return e[Math.floor(Math.random() * e.length)] ?? e[0] ?? "";
|
|
458
|
+
}
|
|
459
|
+
function M(e, t, n) {
|
|
460
|
+
let r = 0;
|
|
461
|
+
for (let { node: i, original: a } of e.nodes) i.data = a.map((e, i) => r + i < t || /^\s+$/u.test(e) ? e : j(n)).join(""), r += a.length;
|
|
462
|
+
}
|
|
463
|
+
function N(e) {
|
|
464
|
+
let t = [], n = (e) => {
|
|
465
|
+
for (let r of Array.from(e.childNodes)) {
|
|
466
|
+
if (r.nodeType === 3) {
|
|
467
|
+
t.push(r);
|
|
468
|
+
continue;
|
|
469
|
+
}
|
|
470
|
+
if (r.nodeType !== 1) continue;
|
|
471
|
+
let e = r.tagName.toLowerCase();
|
|
472
|
+
e !== "script" && e !== "style" && n(r);
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
return n(e), t;
|
|
476
|
+
}
|
|
477
|
+
function P(n, r = {}) {
|
|
478
|
+
let { duration: i = O, characters: a = k, speed: s = A } = r;
|
|
479
|
+
if (typeof i != "number" || !Number.isFinite(i) || i < 0) throw RangeError(`duration must be a finite number >= 0, received ${String(i)}`);
|
|
480
|
+
if (typeof a != "string" || Array.from(a).length === 0) throw TypeError("characters must be a non-empty string");
|
|
481
|
+
if (typeof s != "number" || !Number.isFinite(s) || s <= 0) throw RangeError(`speed must be a finite number > 0, received ${String(s)}`);
|
|
482
|
+
let c = t(n);
|
|
483
|
+
if (c.length === 0) return { destroy: () => void 0 };
|
|
484
|
+
let l = c.map((e) => ({ nodes: N(e).map((e) => ({
|
|
485
|
+
node: e,
|
|
486
|
+
original: Array.from(e.data)
|
|
487
|
+
})) })), u = Array.from(a), d = !1, f = null, p = null, m = null, h = () => {
|
|
488
|
+
for (let e of l) for (let { node: t, original: n } of e.nodes) t.data = n.join("");
|
|
489
|
+
}, g = () => {
|
|
490
|
+
f !== null && (cancelAnimationFrame(f), f = null);
|
|
491
|
+
};
|
|
492
|
+
if (o() || i === 0) return h(), { destroy: () => void 0 };
|
|
493
|
+
if (typeof requestAnimationFrame != "function" || typeof cancelAnimationFrame != "function") throw Error("textScramble() requires requestAnimationFrame and cancelAnimationFrame");
|
|
494
|
+
for (let e of l) M(e, 0, u);
|
|
495
|
+
let _ = (e) => {
|
|
496
|
+
if (f = null, d) return;
|
|
497
|
+
p === null && (p = e, m = e);
|
|
498
|
+
let t = Math.max(0, e - p), n = Math.min(t / i, 1);
|
|
499
|
+
if (t - (m ?? e) >= s || n === 1) {
|
|
500
|
+
for (let e of l) {
|
|
501
|
+
let t = e.nodes.reduce((e, { original: t }) => e + t.length, 0);
|
|
502
|
+
M(e, Math.floor(n * t), u);
|
|
503
|
+
}
|
|
504
|
+
m = e;
|
|
505
|
+
}
|
|
506
|
+
n === 1 ? (h(), y()) : f = requestAnimationFrame(_);
|
|
507
|
+
}, v = () => {
|
|
508
|
+
!d && f === null && (f = requestAnimationFrame(_));
|
|
509
|
+
}, y = () => void 0;
|
|
510
|
+
return y = e((e) => {
|
|
511
|
+
e && !d && (g(), h(), d = !0, y());
|
|
512
|
+
}), v(), { destroy: () => {
|
|
513
|
+
d || (d = !0, g(), y(), h());
|
|
514
|
+
} };
|
|
515
|
+
}
|
|
516
|
+
// src/effects/typewriter.ts
|
|
517
|
+
var F = 70, I = 35, L = 1200, R = "|";
|
|
518
|
+
function z(n, r) {
|
|
519
|
+
if (!r || typeof r != "object") throw TypeError("typewriter() options must be an object");
|
|
520
|
+
let { phrases: i, typeSpeed: a = F, deleteSpeed: s = I, pause: c = L, loop: l = !0, cursor: u = R } = r;
|
|
521
|
+
if (!Array.isArray(i) || i.length === 0) throw TypeError("phrases must contain at least one non-empty string");
|
|
522
|
+
if (i.some((e) => typeof e != "string" || Array.from(e).length === 0)) throw TypeError("each phrase must be a non-empty string");
|
|
523
|
+
if (typeof a != "number" || !Number.isFinite(a) || a <= 0) throw RangeError(`typeSpeed must be a finite number > 0, received ${String(a)}`);
|
|
524
|
+
if (typeof s != "number" || !Number.isFinite(s) || s <= 0) throw RangeError(`deleteSpeed must be a finite number > 0, received ${String(s)}`);
|
|
525
|
+
if (typeof c != "number" || !Number.isFinite(c) || c < 0) throw RangeError(`pause must be a finite number >= 0, received ${String(c)}`);
|
|
526
|
+
if (typeof l != "boolean") throw TypeError(`loop must be a boolean, received ${String(l)}`);
|
|
527
|
+
if (typeof u != "string") throw TypeError(`cursor must be a string, received ${String(u)}`);
|
|
528
|
+
if (r.onComplete !== void 0 && typeof r.onComplete != "function") throw TypeError("onComplete must be a function");
|
|
529
|
+
let d = t(n);
|
|
530
|
+
if (d.length === 0) return { destroy: () => void 0 };
|
|
531
|
+
let f = d.map((e) => ({
|
|
532
|
+
element: e,
|
|
533
|
+
original: e.textContent ?? ""
|
|
534
|
+
})), p = i.map((e) => Array.from(e)), m = o(), h = !1, g = "typing", _ = 0, v = 0, y = null, b = () => void 0, x = () => {
|
|
535
|
+
let e = p[_];
|
|
536
|
+
if (!e) return;
|
|
537
|
+
let t = e.slice(0, v).join("") + u;
|
|
538
|
+
for (let e of f) e.element.textContent = t;
|
|
539
|
+
}, S = () => {
|
|
540
|
+
_ = p.length - 1, v = p[_]?.length ?? 0, g = "complete", x();
|
|
541
|
+
}, C = () => {
|
|
542
|
+
y !== null && (clearTimeout(y), y = null);
|
|
543
|
+
}, w = (e, t) => {
|
|
544
|
+
C(), y = setTimeout(() => {
|
|
545
|
+
y = null, h || e();
|
|
546
|
+
}, t);
|
|
547
|
+
}, T = () => {
|
|
548
|
+
if (g === "typing") {
|
|
549
|
+
let e = p[_];
|
|
550
|
+
if (!e) return;
|
|
551
|
+
if (v < e.length) {
|
|
552
|
+
v++, x(), w(T, a);
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
if (!l && _ === p.length - 1) {
|
|
556
|
+
g = "complete", r.onComplete?.();
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
g = "waiting", w(T, c);
|
|
560
|
+
} else if (g === "waiting") g = "deleting", w(T, s);
|
|
561
|
+
else if (g === "deleting") {
|
|
562
|
+
if (v > 0 && (v--, x()), v > 0) {
|
|
563
|
+
w(T, s);
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
_ = (_ + 1) % p.length, g = "typing", w(T, a);
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
return m ? (S(), r.onComplete?.(), { destroy: () => {
|
|
570
|
+
if (!h) {
|
|
571
|
+
h = !0;
|
|
572
|
+
for (let e of f) e.element.textContent = e.original;
|
|
573
|
+
}
|
|
574
|
+
} }) : (x(), w(T, a), b = e((e) => {
|
|
575
|
+
e && !h && (C(), S(), b(), r.onComplete?.());
|
|
576
|
+
}), { destroy: () => {
|
|
577
|
+
if (!h) {
|
|
578
|
+
h = !0, C(), b();
|
|
579
|
+
for (let e of f) e.element.textContent = e.original;
|
|
580
|
+
}
|
|
581
|
+
} });
|
|
582
|
+
}
|
|
583
|
+
// src/effects/gradient-text.ts
|
|
584
|
+
var B = ["#7c3aed", "#06b6d4"], V = 90, H = 4e3, ee = [
|
|
585
|
+
"background-image",
|
|
586
|
+
"background-clip",
|
|
587
|
+
"-webkit-background-clip",
|
|
588
|
+
"color",
|
|
589
|
+
"-webkit-text-fill-color",
|
|
590
|
+
"background-size",
|
|
591
|
+
"background-position"
|
|
592
|
+
];
|
|
593
|
+
function te(e) {
|
|
594
|
+
if (!Array.isArray(e) || e.length < 2) throw TypeError("colors must be an array containing at least two CSS colors");
|
|
595
|
+
for (let t of e) {
|
|
596
|
+
if (typeof t != "string" || t.trim() === "") throw TypeError("colors must contain non-empty CSS color strings");
|
|
597
|
+
if (typeof CSS < "u" && typeof CSS.supports == "function" && !CSS.supports("color", t)) throw TypeError(`Invalid CSS color "${t}"`);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
function ne(e) {
|
|
601
|
+
return ee.map((t) => ({
|
|
602
|
+
property: t,
|
|
603
|
+
value: e.style.getPropertyValue(t),
|
|
604
|
+
priority: e.style.getPropertyPriority(t)
|
|
605
|
+
}));
|
|
606
|
+
}
|
|
607
|
+
function U(e) {
|
|
608
|
+
e.animation?.cancel(), e.animation = null;
|
|
609
|
+
for (let { property: t, value: n, priority: r } of e.styles) n === "" ? e.element.style.removeProperty(t) : e.element.style.setProperty(t, n, r);
|
|
610
|
+
}
|
|
611
|
+
function W(e, t, n) {
|
|
612
|
+
let { style: r } = e.element;
|
|
613
|
+
r.setProperty("background-image", t), r.setProperty("background-clip", "text"), r.setProperty("-webkit-background-clip", "text"), r.setProperty("color", "transparent"), r.setProperty("-webkit-text-fill-color", "transparent"), r.setProperty("background-size", n ? "200% 100%" : "100% 100%"), r.setProperty("background-position", "0% 50%");
|
|
614
|
+
}
|
|
615
|
+
function G(n, r = {}) {
|
|
616
|
+
let { colors: i = B, angle: a = V, duration: s = H, animated: c = !1, loop: l = !0 } = r;
|
|
617
|
+
if (te(i), typeof a != "number" || !Number.isFinite(a)) throw RangeError(`angle must be a finite number, received ${String(a)}`);
|
|
618
|
+
if (typeof s != "number" || !Number.isFinite(s) || s <= 0) throw RangeError(`duration must be a finite number > 0, received ${String(s)}`);
|
|
619
|
+
if (typeof c != "boolean") throw TypeError("animated must be a boolean");
|
|
620
|
+
if (typeof l != "boolean") throw TypeError("loop must be a boolean");
|
|
621
|
+
let u = t(n);
|
|
622
|
+
if (u.length === 0) return { destroy: () => void 0 };
|
|
623
|
+
let d = o();
|
|
624
|
+
if (c && !d && u.some((e) => typeof e.animate != "function")) throw Error("gradientText() requires the Web Animations API when animated motion is enabled");
|
|
625
|
+
let f = `linear-gradient(${a}deg, ${i.join(", ")})`, p = u.map((e) => ({
|
|
626
|
+
element: e,
|
|
627
|
+
styles: ne(e),
|
|
628
|
+
animation: null
|
|
629
|
+
})), m = !1, h = () => {
|
|
630
|
+
for (let e of p) !c || d || m || e.animation || (e.animation = e.element.animate([{ backgroundPosition: "0% 50%" }, { backgroundPosition: "100% 50%" }], {
|
|
631
|
+
duration: s,
|
|
632
|
+
iterations: l ? Infinity : 1,
|
|
633
|
+
fill: l ? "none" : "forwards",
|
|
634
|
+
easing: "linear"
|
|
635
|
+
}));
|
|
636
|
+
};
|
|
637
|
+
try {
|
|
638
|
+
for (let e of p) W(e, f, c && !d);
|
|
639
|
+
h();
|
|
640
|
+
} catch (e) {
|
|
641
|
+
for (let e of p) U(e);
|
|
642
|
+
throw e;
|
|
643
|
+
}
|
|
644
|
+
let g = e((e) => {
|
|
645
|
+
if (!m && c) {
|
|
646
|
+
if (e) for (let e of p) e.animation?.cancel(), e.animation = null, e.element.style.setProperty("background-size", "100% 100%"), e.element.style.setProperty("background-position", "50% 50%");
|
|
647
|
+
else {
|
|
648
|
+
for (let e of p) e.element.style.setProperty("background-size", "200% 100%"), e.element.style.setProperty("background-position", "0% 50%");
|
|
649
|
+
h();
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
return { destroy: () => {
|
|
654
|
+
if (!m) {
|
|
655
|
+
m = !0, g();
|
|
656
|
+
for (let e of p) U(e);
|
|
657
|
+
}
|
|
658
|
+
} };
|
|
659
|
+
}
|
|
660
|
+
// src/effects/scroll-progress.ts
|
|
661
|
+
var K = "top", q = "#8b5cf6", J = 3, Y = .15;
|
|
662
|
+
function X(e) {
|
|
663
|
+
if (typeof e != "string" || e.trim() === "") throw TypeError("color must be a non-empty CSS color string");
|
|
664
|
+
if (typeof CSS < "u" && typeof CSS.supports == "function" && !CSS.supports("color", e)) throw TypeError(`Invalid CSS color "${e}"`);
|
|
665
|
+
}
|
|
666
|
+
function re(e, t) {
|
|
667
|
+
if (typeof t != "number" || !Number.isFinite(t) || t <= 0) throw RangeError(`${e} must be a finite number > 0, received ${String(t)}`);
|
|
668
|
+
}
|
|
669
|
+
function Z(e) {
|
|
670
|
+
if (typeof e != "number" || !Number.isFinite(e) || e < 0 || e > 2) throw RangeError(`smoothing must be a finite number between 0 and 2, received ${String(e)}`);
|
|
671
|
+
}
|
|
672
|
+
function ie() {
|
|
673
|
+
let e = document.documentElement, t = document.body, n = typeof window.scrollY == "number" ? window.scrollY : e.scrollTop || t?.scrollTop || 0, r = Math.max(e.scrollHeight, t?.scrollHeight ?? 0), i = window.innerHeight || e.clientHeight;
|
|
674
|
+
return {
|
|
675
|
+
position: n,
|
|
676
|
+
maximum: Math.max(0, r - i)
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
function ae(e) {
|
|
680
|
+
return {
|
|
681
|
+
position: e.scrollTop,
|
|
682
|
+
maximum: Math.max(0, e.scrollHeight - e.clientHeight)
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
function oe(n = {}) {
|
|
686
|
+
let { position: r = K, color: i = q, height: a = J, smoothing: s, easing: c, target: l, onUpdate: u } = n, d = s ?? c ?? Y;
|
|
687
|
+
if (u !== void 0 && typeof u != "function") throw TypeError("onUpdate must be a function");
|
|
688
|
+
if (r !== "top" && r !== "bottom") throw TypeError(`position must be "top" or "bottom", received ${String(r)}`);
|
|
689
|
+
X(i), re("height", a), s !== void 0 && Z(s), c !== void 0 && Z(c);
|
|
690
|
+
let f = null;
|
|
691
|
+
if (l !== void 0) {
|
|
692
|
+
let e = t(l);
|
|
693
|
+
if (e.length > 1) throw RangeError("scrollProgress() target must resolve to exactly one element");
|
|
694
|
+
if (f = e[0] ?? null, !f) return {
|
|
695
|
+
getProgress: () => 0,
|
|
696
|
+
destroy: () => void 0
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
if (typeof document > "u" || typeof document.createElement != "function") throw Error("scrollProgress() requires document.createElement, which is not available in this environment");
|
|
700
|
+
if (typeof requestAnimationFrame != "function" || typeof cancelAnimationFrame != "function") throw Error("scrollProgress() requires requestAnimationFrame and cancelAnimationFrame");
|
|
701
|
+
if (typeof window > "u" && !f) throw Error("scrollProgress() requires window when tracking page scroll");
|
|
702
|
+
let p = document.createElement("div");
|
|
703
|
+
p.setAttribute("aria-hidden", "true"), p.style.setProperty("position", "fixed"), p.style.setProperty(r, "0"), p.style.setProperty("left", "0"), p.style.setProperty("right", "0"), p.style.setProperty("height", `${a}px`), p.style.setProperty("z-index", "2147483647"), p.style.setProperty("pointer-events", "none"), p.style.setProperty("transform", "scaleX(0)"), p.style.setProperty("transform-origin", "left center"), p.style.setProperty("background-color", i);
|
|
704
|
+
let m = o(), h = () => {
|
|
705
|
+
p.style.setProperty("transition", m || d === 0 ? "none" : `transform ${d}s ease-out`);
|
|
706
|
+
};
|
|
707
|
+
h();
|
|
708
|
+
let g = document.body ?? document.documentElement;
|
|
709
|
+
if (!g) throw Error("scrollProgress() requires a document body or document element");
|
|
710
|
+
let _ = !1, v = null, y = 0, b = 0, x = !1, S = () => {
|
|
711
|
+
let e = f ? ae(f) : ie();
|
|
712
|
+
return e.maximum === 0 ? 0 : Math.min(Math.max(e.position / e.maximum, 0), 1);
|
|
713
|
+
}, C = (e) => {
|
|
714
|
+
_ || p.style.setProperty("transform", `scaleX(${e})`);
|
|
715
|
+
}, w = (e) => {
|
|
716
|
+
y = e, !(x && e === b) && (b = e, x = !0, C(e), u?.(e));
|
|
717
|
+
}, T = () => {
|
|
718
|
+
_ || (v !== null && (cancelAnimationFrame(v), v = null), w(S()));
|
|
719
|
+
}, E = () => {
|
|
720
|
+
_ || (m ? T() : (y = S(), v === null && (v = requestAnimationFrame(() => {
|
|
721
|
+
v = null, w(y);
|
|
722
|
+
}))));
|
|
723
|
+
};
|
|
724
|
+
g.appendChild(p);
|
|
725
|
+
let D = f ?? window;
|
|
726
|
+
D.addEventListener("scroll", E, { passive: !0 });
|
|
727
|
+
let O = null;
|
|
728
|
+
if (!f) window.addEventListener("resize", E, { passive: !0 });
|
|
729
|
+
else if (typeof ResizeObserver < "u") {
|
|
730
|
+
O = new ResizeObserver(E), O.observe(f);
|
|
731
|
+
for (let e of Array.from(f.children ?? [])) O.observe(e);
|
|
732
|
+
}
|
|
733
|
+
let k = e((e) => {
|
|
734
|
+
_ || e === m || (m = e, h(), T());
|
|
735
|
+
});
|
|
736
|
+
try {
|
|
737
|
+
T();
|
|
738
|
+
} catch (e) {
|
|
739
|
+
throw k(), O?.disconnect(), D.removeEventListener("scroll", E), f || window.removeEventListener("resize", E), p.parentElement === g && g.removeChild(p), e;
|
|
740
|
+
}
|
|
741
|
+
return {
|
|
742
|
+
getProgress: () => y,
|
|
743
|
+
destroy: () => {
|
|
744
|
+
_ || (_ = !0, k(), v !== null && cancelAnimationFrame(v), v = null, O?.disconnect(), D.removeEventListener("scroll", E), f || window.removeEventListener("resize", E), p.parentElement === g && g.removeChild(p));
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
// src/effects/scroll-trigger.ts
|
|
749
|
+
function Q(e) {
|
|
750
|
+
if ((Array.isArray(e) ? e : [e]).some((e) => typeof e != "number" || !Number.isFinite(e) || e < 0 || e > 1)) throw RangeError("threshold must be a number (or non-empty list of numbers) between 0 and 1");
|
|
751
|
+
}
|
|
752
|
+
function $(e, n = {}) {
|
|
753
|
+
if (typeof n != "object" || !n || Array.isArray(n)) throw TypeError("scrollTrigger() options must be an object");
|
|
754
|
+
let { onEnter: r, onLeave: i, rootMargin: a = "0px", threshold: o = 0, once: s = !0 } = n;
|
|
755
|
+
if (r !== void 0 && typeof r != "function") throw TypeError("onEnter must be a function");
|
|
756
|
+
if (i !== void 0 && typeof i != "function") throw TypeError("onLeave must be a function");
|
|
757
|
+
if (r === void 0 && i === void 0) throw TypeError("scrollTrigger() requires onEnter or onLeave");
|
|
758
|
+
if (Q(o), typeof a != "string" || a.trim() === "") throw TypeError("rootMargin must be a non-empty string");
|
|
759
|
+
if (typeof s != "boolean") throw TypeError("once must be a boolean");
|
|
760
|
+
if (typeof IntersectionObserver > "u") throw Error("scrollTrigger() requires IntersectionObserver, which is not available in this environment");
|
|
761
|
+
let c = t(e);
|
|
762
|
+
if (c.length === 0) return { destroy: () => void 0 };
|
|
763
|
+
let l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = !1, f;
|
|
764
|
+
try {
|
|
765
|
+
f = new IntersectionObserver((e) => {
|
|
766
|
+
if (!d) for (let t of e) {
|
|
767
|
+
let e = t.target;
|
|
768
|
+
if (u.has(e)) {
|
|
769
|
+
if (t.isIntersecting) {
|
|
770
|
+
if (l.has(e)) continue;
|
|
771
|
+
l.add(e);
|
|
772
|
+
try {
|
|
773
|
+
r?.(e, t);
|
|
774
|
+
} finally {
|
|
775
|
+
s && i === void 0 && (f.unobserve(e), u.delete(e));
|
|
776
|
+
}
|
|
777
|
+
} else if (l.delete(e)) try {
|
|
778
|
+
i?.(e, t);
|
|
779
|
+
} finally {
|
|
780
|
+
s && (f.unobserve(e), u.delete(e));
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
}, {
|
|
785
|
+
rootMargin: a,
|
|
786
|
+
threshold: o
|
|
787
|
+
});
|
|
788
|
+
} catch (e) {
|
|
789
|
+
throw Error("scrollTrigger() could not create an IntersectionObserver", { cause: e });
|
|
790
|
+
}
|
|
791
|
+
for (let e of c) try {
|
|
792
|
+
f.observe(e), u.add(e);
|
|
793
|
+
} catch (e) {
|
|
794
|
+
throw f.disconnect(), e;
|
|
795
|
+
}
|
|
796
|
+
return { destroy: () => {
|
|
797
|
+
d || (d = !0, f.disconnect(), u.clear(), l.clear());
|
|
798
|
+
} };
|
|
799
|
+
}
|
|
800
|
+
// src/effects/in-view.ts
|
|
801
|
+
function se(e, t, n = {}) {
|
|
802
|
+
if (typeof t != "function") throw TypeError("inView() callback must be a function");
|
|
803
|
+
let r = /* @__PURE__ */ new Map(), i = !1, a = $(e, {
|
|
804
|
+
...n,
|
|
805
|
+
onEnter: (e, n) => {
|
|
806
|
+
if (i) return;
|
|
807
|
+
let a = r.get(e);
|
|
808
|
+
if (a) {
|
|
809
|
+
r.delete(e);
|
|
810
|
+
try {
|
|
811
|
+
a();
|
|
812
|
+
} catch {}
|
|
813
|
+
}
|
|
814
|
+
let o = t(e, n);
|
|
815
|
+
typeof o == "function" && r.set(e, o);
|
|
816
|
+
},
|
|
817
|
+
onLeave: (e) => {
|
|
818
|
+
let t = r.get(e);
|
|
819
|
+
r.delete(e), t?.();
|
|
820
|
+
}
|
|
821
|
+
});
|
|
822
|
+
return { destroy: () => {
|
|
823
|
+
if (i) return;
|
|
824
|
+
i = !0, a.destroy();
|
|
825
|
+
let e = [...r.values()];
|
|
826
|
+
r.clear();
|
|
827
|
+
let t;
|
|
828
|
+
for (let n of e) try {
|
|
829
|
+
n();
|
|
830
|
+
} catch (e) {
|
|
831
|
+
t ||= e;
|
|
832
|
+
}
|
|
833
|
+
if (t) throw t;
|
|
834
|
+
} };
|
|
835
|
+
}
|
|
836
|
+
// src/effects/scroll-velocity.ts
|
|
837
|
+
var ce = .2, le = 1e4, ue = .5;
|
|
838
|
+
function de(e) {
|
|
839
|
+
if (typeof e != "number" || !Number.isFinite(e) || e < 0 || e > 1) throw RangeError(`smoothing must be a finite number between 0 and 1, received ${String(e)}`);
|
|
840
|
+
}
|
|
841
|
+
function fe() {
|
|
842
|
+
let e = document.documentElement, t = document.body, n = window.scrollY ?? window.pageYOffset ?? e.scrollTop ?? t?.scrollTop ?? 0, r = Math.max(e.scrollHeight, t?.scrollHeight ?? 0), i = window.innerHeight || e.clientHeight;
|
|
843
|
+
return {
|
|
844
|
+
position: n,
|
|
845
|
+
maximum: Math.max(0, r - i)
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
function pe(e) {
|
|
849
|
+
return {
|
|
850
|
+
position: e.scrollTop,
|
|
851
|
+
maximum: Math.max(0, e.scrollHeight - e.clientHeight)
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
function me(e) {
|
|
855
|
+
return !Number.isFinite(e.position) || !Number.isFinite(e.maximum) || e.maximum <= 0 ? 0 : Math.min(Math.max(e.position / e.maximum, 0), 1);
|
|
856
|
+
}
|
|
857
|
+
function he(n) {
|
|
858
|
+
if (typeof n != "object" || !n) throw TypeError("options must be an object");
|
|
859
|
+
let { smoothing: r = ce, target: i, onUpdate: a } = n;
|
|
860
|
+
if (de(r), typeof a != "function") throw TypeError("onUpdate must be a function");
|
|
861
|
+
let s = null, c;
|
|
862
|
+
if (i === void 0) {
|
|
863
|
+
if (typeof window > "u") throw Error("scrollVelocity() requires window when no target is provided");
|
|
864
|
+
c = window;
|
|
865
|
+
} else if (typeof Window < "u" && i instanceof Window) c = i;
|
|
866
|
+
else {
|
|
867
|
+
let e = t(i);
|
|
868
|
+
if (e.length > 1) throw RangeError("scrollVelocity() target must resolve to exactly one element");
|
|
869
|
+
if (s = e[0] ?? null, !s) return { destroy: () => void 0 };
|
|
870
|
+
c = typeof window > "u" ? {} : window;
|
|
871
|
+
}
|
|
872
|
+
if (!s && (typeof document > "u" || !document.documentElement)) throw Error("scrollVelocity() requires document scrolling metrics");
|
|
873
|
+
if (typeof requestAnimationFrame != "function" || typeof cancelAnimationFrame != "function") throw Error("scrollVelocity() requires requestAnimationFrame and cancelAnimationFrame");
|
|
874
|
+
let l = o(), u = !1, d = null, f = null, p = null, m = 0, h = () => s ? pe(s) : fe(), g = (e) => {
|
|
875
|
+
if (d = null, u) return;
|
|
876
|
+
let t = h(), n = {
|
|
877
|
+
position: Number.isFinite(t.position) ? t.position : f ?? 0,
|
|
878
|
+
maximum: Number.isFinite(t.maximum) ? Math.max(0, t.maximum) : 0
|
|
879
|
+
}, i = f === null || n.position === f ? "idle" : n.position > f ? "down" : "up", o = 0;
|
|
880
|
+
f !== null && p !== null && Number.isFinite(e) && e > p && (o = (n.position - f) / (e - p) * 1e3, o = Math.min(Math.max(o, -1e4), le));
|
|
881
|
+
let s = r;
|
|
882
|
+
m = o * (1 - s) + m * s, (Math.abs(m) < ue || i === "idle" && s >= 1) && (m = 0), f = n.position, Number.isFinite(e) && (p === null || e > p) && (p = e), a({
|
|
883
|
+
velocity: l ? 0 : m,
|
|
884
|
+
direction: i,
|
|
885
|
+
position: n.position,
|
|
886
|
+
progress: me(n)
|
|
887
|
+
}), m !== 0 && !l && _();
|
|
888
|
+
}, _ = () => {
|
|
889
|
+
u || d !== null || (d = requestAnimationFrame(g));
|
|
890
|
+
}, v = s ?? c;
|
|
891
|
+
v.addEventListener("scroll", _, { passive: !0 });
|
|
892
|
+
let y = e((e) => {
|
|
893
|
+
u || e === l || (l = e, e && (m = 0), _());
|
|
894
|
+
});
|
|
895
|
+
try {
|
|
896
|
+
g(typeof performance < "u" ? performance.now() : 0);
|
|
897
|
+
} catch (e) {
|
|
898
|
+
throw u = !0, y(), d !== null && cancelAnimationFrame(d), d = null, v.removeEventListener("scroll", _), e;
|
|
899
|
+
}
|
|
900
|
+
return { destroy: () => {
|
|
901
|
+
u || (u = !0, y(), d !== null && cancelAnimationFrame(d), d = null, v.removeEventListener("scroll", _));
|
|
902
|
+
} };
|
|
903
|
+
}
|
|
904
|
+
export { G as a, D as c, oe as i, S as l, se as n, z as o, $ as r, P as s, he as t, _ as u };
|