MOTION PALETTE
← 検索結果に戻るモーション図鑑 / 3-18

Before/After Slider

比較スライダー

つまみをドラッグすると施工前/施工後などの2画像が境界線で入れ替わる

FIELD NOTES01 / A quiet retreat
OriginalWarm grade
静けさに、泊まる。NAGI · KYOTO

再生で動きを確認。もう一度見るときは「最初から再生」を押してください。

こんな場面に

写真の補正前後や、素材の違いを同じ構図で比較したいとき。

使うときの判断

意味の異なる2枚を重ねると、比較の軸が伝わりません。

IMPLEMENTATION

実装レシピ

`input[type=range]`の値で上層imgの`clip-path: inset(0 X% 0 0)`を更新。img-comparison-slider等のWeb Componentも可

実装難易度
実装の目安
CSSのみ / JS軽量
収録範囲
説明・指示書・MCP同梱の実装例

同梱の実装例は、組み込み先で表示・操作を確認してください。

記述の近い参考サイト

調査メモの関連語から抽出しています。採用技法の確認には元の調査記録と実際のサイトを参照してください。現在の表現は調査時点と異なる場合があります。

YOUR PROMPT

調整した値を確認する

実装指示書の全文を開く
Implement the following web visual TECHNIQUE as a small, self-contained demo (single HTML file, inline CSS/JS; GSAP via CDN is allowed if it fits the recipe). Invent your own placeholder content (original text/shapes/colors) — do NOT copy any existing site's content or branding.

## Technique: Before/After Slider (比較スライダー)

What happens: つまみをドラッグすると施工前/施工後などの2画像が境界線で入れ替わる

## Implementation recipe (normative)

`input[type=range]`の値で上層imgの`clip-path: inset(0 X% 0 0)`を更新。img-comparison-slider等のWeb Componentも可

## Timing values chosen by the user (normative — use these exact values)

- Easing: `cubic-bezier(0.22, 1, 0.36, 1)`
- Base duration: 3.00s
- Intensity 3/5: Use moderate amplitudes (16-40px movements or equivalent scale/rotation, confident but not showy).

## Quality bar

- Runs at 60fps; animate only transform/opacity/filter where possible.
- Make the initial state legible immediately. Preserve the full timing above, including deliberately slow transitions. Repeat only when the recipe calls for a loop; give finite effects a clear ending and replay action.
- Respect prefers-reduced-motion: show a legible resting state without autoplay. Keep every operation available through keyboard and touch; allow deliberate playback of the effect for inspection.
- Difficulty reference: 中. If the recipe mentions specific libraries or shader work, follow it rather than substituting a simpler approach.

コピーできない環境では、指示書を選択・保存する画面が開きます。