How b3ll/motion works
Motion is a Swift animation engine for gesture-driven interfaces. A caller configures and starts a spring, decay, or basic animation; the animation advances over frames, updates its value through a callback, and can be interrupted or completed. The runtime uses SIMD-compatible values and an environment-specific animator/driver. Documented extensions include SwiftUI support, Core Animation keyframe emission, rubber-banding, and curve graphing. The graph also includes the indexed movie-maker example; unsampled links are omitted where the excerpts do not establish ownership.
Main entry points: SpringAnimation.swift Spring Animation · DecayAnimation.swift Decay Animation · ValueAnimation.swift Value Animation · Animator.swift Animator
Components 21
Animation Models
- Spring Animation
Sources/Motion/Animations/SpringAnimation.swift - Decay Animation
Sources/Motion/Animations/DecayAnimation.swift - Basic Animation
Sources/Motion/Animations/BasicAnimation.swift - Value Animation
Sources/Motion/Animations/ValueAnimation.swift - Animation Group
Sources/Motion/Animations/AnimationGroup.swift
Frame Runtime
- Animator
Sources/Motion/Utilities/Animator.swift - Frame Driver
Sources/Motion/Utilities/AnimationDriver.swift - Animation Environment
Sources/Motion/Protocols/AnimationEnvironment.swift - Environment Proxy
Sources/Motion/Utilities/AnimationEnvironmentProxy.swift
Math and Values
- SIMD Values
Sources/Motion/Protocols/SIMDRepresentable.swift - Approximate Equality
Sources/Motion/Protocols/EquatableEnough.swift - Spring Function
Sources/Motion/Animations/Functions/SpringFunction.swift - Decay Function
Sources/Motion/Animations/Functions/DecayFunction.swift - Easing Functions
Sources/Motion/Animations/Functions/EasingFunctions.swift
Animation Extensions
- Keyframe Emission
Sources/Motion/Utilities/CAKeyframeAnimationEmittable.swift - Rubber-Banding
Sources/Motion/Utilities/RubberBanding.swift - Animation Graphs
Sources/Graphing/ValueAnimationGraph.swift - Curve Graphing
Sources/Graphing/EasingFunctionGraph.swift
Movie Maker Example
- Movie Controller
Resources/MotionMovieMaker/MotionMovieMaker/ViewController.swift - Bouncy View
Resources/MotionMovieMaker/MotionMovieMaker/BouncyView.swift
Other components
- App or Gesture
Connections 26
- App or Gesture → Spring Animation: configures and starts
README.md - App or Gesture → Decay Animation: configures and starts
README.md - App or Gesture → Basic Animation: configures and starts
README.md - Spring Animation → Value Animation: inherits from
Sources/Motion/Animations/SpringAnimation.swift - Decay Animation → Value Animation: inherits from
Sources/Motion/Animations/DecayAnimation.swift - Basic Animation → Value Animation: inherits from
Sources/Motion/Animations/BasicAnimation.swift - Value Animation → Animator: registers with
Sources/Motion/Animations/ValueAnimation.swift - Animator → Frame Driver: drives frames
Sources/Motion/Utilities/Animator.swift - Animator → Animation Environment: uses environment
Sources/Motion/Utilities/Animator.swift - Frame Driver → Animation Environment: reads display settings
Sources/Motion/Utilities/AnimationDriver.swift - Animation Environment → Animator: provides animator
Sources/Motion/Protocols/AnimationEnvironment.swift - Environment Proxy → Animation Environment: implements
Sources/Motion/Utilities/AnimationEnvironmentProxy.swift - Value Animation → SIMD Values: converts values
Sources/Motion/Animations/ValueAnimation.swift - SIMD Values → Approximate Equality: uses comparisons
Sources/Motion/Protocols/SIMDRepresentable.swift - Spring Animation → Spring Function: uses spring model
Sources/Motion/Animations/SpringAnimation.swift - Decay Animation → Decay Function: uses decay model
Sources/Motion/Animations/DecayAnimation.swift - Spring Animation → Keyframe Emission: emits keyframes
Sources/Motion/Utilities/CAKeyframeAnimationEmittable.swift - Decay Animation → Keyframe Emission: emits keyframes
Sources/Motion/Utilities/CAKeyframeAnimationEmittable.swift - Basic Animation → Keyframe Emission: emits keyframes
Sources/Motion/Utilities/CAKeyframeAnimationEmittable.swift - Animation Graphs → Spring Animation: ticks animation
Sources/Graphing/ValueAnimationGraph.swift - Animation Graphs → Decay Animation: ticks animation
Sources/Graphing/ValueAnimationGraph.swift - Movie Controller → Spring Animation: configures and ticks
Resources/MotionMovieMaker/MotionMovieMaker/ViewController.swift - Movie Controller → Bouncy View: adds to view
Resources/MotionMovieMaker/MotionMovieMaker/ViewController.swift - App or Gesture → Rubber-Banding: may apply
README.md - App or Gesture → Easing Functions: may configure
README.md - App or Gesture → Curve Graphing: may inspect curves
README.md