|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="ja"> |
| 3 | +<head> |
| 4 | +<meta charset="UTF-8"> |
| 5 | +<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | +<title>Easing Comparison</title> |
| 7 | +<style> |
| 8 | + * { margin: 0; padding: 0; box-sizing: border-box; } |
| 9 | + body { background: #fff; font-family: sans-serif; padding: 30px 0; } |
| 10 | + .row { display: flex; align-items: center; margin-bottom: 16px; } |
| 11 | + .label { width: 140px; font-size: 16px; font-weight: bold; color: #333; } |
| 12 | + .box { width: 50px; height: 50px; background: #0ae448; border-radius: 8px; } |
| 13 | +</style> |
| 14 | +</head> |
| 15 | +<body> |
| 16 | + <div class="row"> |
| 17 | + <span class="label">power1.out</span> |
| 18 | + <div class="box" id="b1"></div> |
| 19 | + </div> |
| 20 | + <div class="row"> |
| 21 | + <span class="label">power3.in</span> |
| 22 | + <div class="box" id="b2"></div> |
| 23 | + </div> |
| 24 | + <div class="row"> |
| 25 | + <span class="label">bounce.out</span> |
| 26 | + <div class="box" id="b3"></div> |
| 27 | + </div> |
| 28 | + <div class="row"> |
| 29 | + <span class="label">elastic.out</span> |
| 30 | + <div class="box" id="b4"></div> |
| 31 | + </div> |
| 32 | + <div class="row"> |
| 33 | + <span class="label">back.out</span> |
| 34 | + <div class="box" id="b5"></div> |
| 35 | + </div> |
| 36 | + <div class="row"> |
| 37 | + <span class="label">steps(5)</span> |
| 38 | + <div class="box" id="b6"></div> |
| 39 | + </div> |
| 40 | + |
| 41 | +<script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/gsap.min.js"></script> |
| 42 | +<script> |
| 43 | + gsap.to("#b1", { x: 300, duration: 2, ease: "power1.out", repeat: -1, repeatDelay: 1 }); |
| 44 | + gsap.to("#b2", { x: 300, duration: 2, ease: "power3.in", repeat: -1, repeatDelay: 1 }); |
| 45 | + gsap.to("#b3", { x: 300, duration: 2, ease: "bounce.out", repeat: -1, repeatDelay: 1 }); |
| 46 | + gsap.to("#b4", { x: 300, duration: 2, ease: "elastic.out", repeat: -1, repeatDelay: 1 }); |
| 47 | + gsap.to("#b5", { x: 300, duration: 2, ease: "back.out", repeat: -1, repeatDelay: 1 }); |
| 48 | + gsap.to("#b6", { x: 300, duration: 2, ease: "steps(5)", repeat: -1, repeatDelay: 1 }); |
| 49 | +</script> |
| 50 | +</body> |
| 51 | +</html> |
0 commit comments