Frontory

Open code, practice, and notes →

Download source with English comments · for reading

Motion · 18 Inertia and Elasticity

Series contents · Technology map

Stage: Gestures and Equivalent Interaction · Editable example · Storage ID: motion-step-18

Goals and learning outcomes

Prerequisites

Prepare the results of the Drag and Constraints exercises from Unit 17, “Drag Coordinates and Bounds”.

Key concepts and explanations

Momentum

Inertia can continue after a drag ends. The drop completion time differs from the time movement stops.

Elastic

elastic controls how far an element can be pulled beyond its bounds. Do not confuse this allowance with data coordinates.

Practice setup

First check the execution scope guidance on the example screen. The following describes the environment needed to extend the assignment in a separate project. The existing motion-01·02·03 examples are limited examples based on Motion JS animate. For React layout, AnimatePresence, and hooks exercises, install motion in a separate local React project and import from motion/react. Do not assume JSX runs directly in the editor; preserve CSP and isolation.

The linked example is a starting point. It does not implement every task below. Complete work beyond its supported scope in a separate project.

Practice tasks

  1. In src/day-18.tsx of a separate exercise project, combine dragMomentum and dragElastic and record the end coordinates. Use the existing Unit 1·14·28 examples only as starting points.
  2. Input condition: Short drags in the same direction. Baseline: true. Run under the baseline condition, then record observations and errors in notes/day-18.md.
  3. Variable to change: momentum; new value: false. Run again with the same input path. Deliverable to save: A table of positions at pointer release and after settling. Hypothesis to test: Additional movement after release decreases. Compare it with the actual results and record whether they agree and the causes of any differences.

Variables to observe

VariableBaselineChangeExpected change / hypothesis
momentumtruefalseAdditional movement after release decreases.

Predictions in this table are not measured results. Change one condition at a time and record why the actual result differs.

Completion criteria

Self-check

  1. Which processing stage does Momentum affect in this exercise? Input case: Short drags in the same direction.
  2. Variable to change: momentum. Hypothesis to test: Additional movement after release decreases. Did the actual results agree with the hypothesis? Explain your evidence in terms of Elastic.

Official references

Linked example and execution scope

Example source · Runtime environments and limits

Interactive Inertia and Elasticity experiment with cleanup of the resources used.

Source code and records are not overwritten automatically. Resetting an existing example also preserves your notes.

Next learning

Previous: Drag Coordinates and Bounds · Next: Reordering with Buttons

Open code, practice, and notes →