Skip to content

Main content

Random CSS Keyframe Motion Generator

Generate integer-pixel random waypoints on a strictly ordered jittered time grid, piecewise-linear samples, measured path length, and portable CSS translate keyframes with a reduced-motion override; no browser rendering or physical-motion model.

Loading tool…

Description

Generate integer-pixel random waypoints on a strictly ordered jittered time grid, piecewise-linear samples, measured path length, and portable CSS translate keyframes with a reduced-motion override; no browser rendering or physical-motion model.

Procedural artwork expresses a visual idea through coordinates, repeated motifs, colors, or explicit placement constraints. A coordinate plan can be checked and reproduced before rendering, while physical material behavior and fabrication require separate information.

Generate integer-pixel random waypoints on a strictly ordered jittered time grid, piecewise-linear samples, measured path length, and portable CSS translate keyframes with a reduced-motion override; no browser rendering or physical-motion model.

When to use this tool

Use this generator to create reproducible css keyframe motion cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.

How to use the tool and how it works

  1. Supply waypointCount, minimumX, maximumX, minimumY, maximumY, durationSeconds, sampleCount in the field shapes below. Set seed when you need an explicit replay.
  2. Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
  3. Read keyframes, samples, pathLengthPixels, css. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.

Draw ordered keyframe times with fixed zero/one endpoints and integer pixel positions. Sample piecewise-linear positions, sum waypoint distances, and emit a fixed-duration linear CSS animation with a reduced-motion override.1

Input fieldMeaning and unitsAccepted input
waypointCountWaypoint CountRequired. Safe integer; minimum 2; maximum 64.
minimumXMinimum XRequired. Safe integer.
maximumXMaximum XRequired. Safe integer.
minimumYMinimum YRequired. Safe integer.
maximumYMaximum YRequired. Safe integer.
durationSecondsDuration SecondsRequired. Finite number; strictly above 0.
sampleCountSample CountRequired. Safe integer; minimum 2; maximum 1024.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
keyframesKeyframesRequired. Array of Object; no unknown keys.; minimum items 2; maximum items 64.
keyframes[].xXRequired. Finite number.
keyframes[].yYRequired. Finite number.
keyframes[].timeTimeRequired. Finite number; minimum 0; maximum 1.
samplesSamplesRequired. Array of Object; no unknown keys.; minimum items 2; maximum items 1024.
samples[].xXRequired. Finite number.
samples[].yYRequired. Finite number.
samples[].timeTimeRequired. Finite number; minimum 0; maximum 1.
pathLengthPixelsPath Length PixelsRequired. Finite number; minimum 0.
cssCssRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 32768.
randomnessReplay source and normalized 32-bit seed, or null seed for an advancing context source.Required. Object; no unknown keys.
randomness.seedOptional safe-integer replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. Text; one of "context", "seed".

An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.

json
{
  "input": {
    "waypointCount": 2,
    "minimumX": 0,
    "maximumX": 10,
    "minimumY": 0,
    "maximumY": 10,
    "durationSeconds": 2,
    "sampleCount": 3,
    "seed": 42
  },
  "output": {
    "keyframes": [
      {
        "time": 0,
        "x": 6,
        "y": 4
      },
      {
        "time": 1,
        "x": 9,
        "y": 7
      }
    ],
    "samples": [
      {
        "time": 0,
        "x": 6,
        "y": 4
      },
      {
        "time": 0.5,
        "x": 7.5,
        "y": 5.5
      },
      {
        "time": 1,
        "x": 9,
        "y": 7
      }
    ],
    "pathLengthPixels": 4.242640687119286,
    "css": "@keyframes toolio-motion {\n  0% { transform: translate(6px, 4px); }\n  100% { transform: translate(9px, 7px); }\n}\n.toolio-motion { animation: toolio-motion 2s linear 1 both; }\n@media (prefers-reduced-motion: reduce) { .toolio-motion { animation: none; } }",
    "randomness": {
      "seed": 42,
      "source": "seed"
    }
  }
}

Limitations and assumptions

  • pathLengthPixels follows the waypoint polyline, not the sample count. Reduced-motion CSS is included but does not constitute a complete motion-accessibility assessment. No browser animation is run.
  • A replay requires the same complete input and implementation. The stated sampling convention applies within its eligible space. A finite draw does not exhaust all possible outputs; repeats remain possible unless a distinct-selection rule is explicit.
  • The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.

Alternative or Complementary methods

For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.

References

  1. Tool behavior and example: Random CSS Keyframe Motion Generator — tool.io

Similar or alternative tools