HomeBezier Curve Editor

Bezier Curve Editor

Online Bezier curve editor with draggable control points, easing presets, animation previews, and one-click CSS/JavaScript timing code generation.

Precise Values

Curve Editor

P1:(0.25, 0.10)
P2:(0.25, 1.00)

Easing Presets

Active Preset:Ease

Animation Preview

Translation
Scale
Rotation
R
Opacity

Timing Comparison

Current
Linear
Ease
Ease In
Ease Out
Back

CSS Code

/* CSS 动画 */
.animated-element {
  animation: slide-in 2s ease infinite;
}

@keyframes slide-in {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* 或在 transition 中使用 */
.transition-element {
  transition: transform 0.3s ease;
}

JavaScript Code

// JavaScript 动画
const element = document.querySelector('.animated-element')
const duration = 2000

function easeBezier(t, p1x, p1y, p2x, p2y) {
  const cx = 3 * p1x
  const bx = 3 * (p2x - p1x) - cx
  const ax = 1 - cx - bx

  const cy = 3 * p1y
  const by = 3 * (p2y - p1y) - cy
  const ay = 1 - cy - by

  function sampleCurveX(x) {
    return ((ax * x + bx) * x + cx) * x
  }

  function sampleCurveY(x) {
    return ((ay * x + by) * x + cy) * x
  }

  function solveCurveX(x) {
    let t2 = x
    for (let i = 0; i < 8; i += 1) {
      const x2 = sampleCurveX(t2) - x
      if (Math.abs(x2) < 0.001) break
      const d2 = (3 * ax * t2 + 2 * bx) * t2 + cx
      if (Math.abs(d2) < 0.000001) break
      t2 -= x2 / d2
    }
    return t2
  }

  return sampleCurveY(solveCurveX(t))
}

function animate() {
  const startTime = performance.now()

  function frame(currentTime) {
    const elapsed = currentTime - startTime
    const progress = Math.min(elapsed / duration, 1)
    const easedProgress = easeBezier(progress, 0.25, 0.1, 0.25, 1)

    element.style.transform = 'translateX(' + (easedProgress * 200) + 'px)'

    if (progress < 1) {
      requestAnimationFrame(frame)
    }
  }

  requestAnimationFrame(frame)
}

animate()


Documentation

About Bezier Curve Editor

This tool visually edits CSS cubic-bezier() easing functions with draggable control points, presets, and animation previews.

Key Features

  • Visual Editing: Drag control points and update curve in real time.
  • Precise Input: Enter exact P1/P2 coordinate values.
  • Preset Library: Apply common easing presets quickly.
  • Animation Preview: Test translation, scale, rotation, and opacity behaviors.
  • Curve Comparison: Compare current curve against standard easings.

Steps

  1. Drag points or enter coordinate values.
  2. Observe curve and preview updates.
  3. Compare with presets and fine-tune.
  4. Copy final cubic-bezier(x1,y1,x2,y2) to your styles.

Use Cases

  • Standardizing motion tokens in design systems.
  • Refining interaction animations in UI.
  • Turning visual tuning into reusable timing parameters.

FAQ

Why does motion feel unnatural?

Control points may be too aggressive. Start near an ease preset and adjust gradually.

Can I use the result outside CSS?

Yes, anywhere the animation engine accepts cubic-bezier parameters.