Skip to main content
rule CX Codex

sine-wave-loop — Claude Code rule: what it does, how to install

sine-wave-loop — a GSAP rule that gives a settled scene element light jitter, or one bounded breathing loop, driven by Math.sin once its entry animation ends.

AGPL-3.0 ★ 78,316 updated 2026-10-24

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/sine-wave-loop.md
Open on GitHub

What sine-wave-loop does

The rule teaches the agent to keep a held element from looking frozen in an HTML and GSAP scene. One long tween moves a phase value from 0 to 2π, and each onUpdate turns it into a small Math.sin offset for scale or translateY. Since sin(0) is 0, the idle begins exactly where the entry animation stopped, so nothing jumps.

The file holds a scene template with a headline and an accent dot that pulses out of phase with it, built on GSAP loaded from CDN as [email protected]. Variants layer a second, faster frequency on top or fade the amplitude to zero over the last 20% of the idle, which the rule recommends once idle runs past 6 s. Values like SCALE_AMP and IDLE_DUR are placeholders you fill in.

The rule itself says to reach for it last. Reveal lines as the voiceover gets to them first, then try light jitter. A full breathing loop is meant for a single hero element, so don't let the agent put it on every headline.

What it helps with

  • Keep a settled headline from looking frozen with light jitter
  • Move from an entry animation into idle with no visible jump
  • Pulse an accent dot out of phase with the headline
  • Fade idle motion to rest before a scene transition
  • Fit a set number of sine cycles into a given idle length

Example prompts for the agent

  • Apply the sine-wave-loop rule: add subtle jitter to the headline after its entry animation.
  • Use sine-wave-loop to give the hero one bounded breathing loop, with the amplitude fading out over the last 20% of idle.
  • Make the accent dot pulse out of phase with the headline, following the sine-wave-loop rule.

How to install sine-wave-loop

Manually: put the files in place

.claude/rules/sine-wave-loop.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about sine-wave-loop

How do I install sine-wave-loop in Claude Code?

Save the rule file as .claude/rules/sine-wave-loop.md.

What does sine-wave-loop do?

It drives small Math.sin offsets from a GSAP tween, so a held element in a scene keeps a trace of motion after its entry animation.

Why does the rule say to use it last?

It treats scaling text up and down as a cheap trick. It prefers revealing elements in time with the voiceover, then light jitter, and keeps the full breathing loop for one hero element.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set101

The whole set →
camera-cursor-tracking The camera-cursor-tracking rule keeps a growing text element in view with a two-stage virtual camera. Use it for search fields, animated URLs, and similar scenes. CX Codex +1 ★ 78,316repo stars seedance-2-5 Skill for generating 4–30 second video clips with ByteDance Seedance 2.5 via fal.ai, Volcengine Ark, Runway, or ComfyUI. CX Codex +1 ★ 78,316repo stars orbit-3d-entry orbit-3d-entry sets up a GSAP animation where items flip in from 3D coordinates and transition into a continuous elliptical orbit around a center point. CX Codex +1 ★ 78,316repo stars motion-graphics motion-graphics is a Claude Code skill that creates short motion-led graphics, from animated headlines and charts to logo stings. For pieces without narration or live-action footage. CX Codex +1 ★ 78,316repo stars avatar-cloud-network avatar-cloud-network guides the agent in creating an elliptical community reveal scene with a center hub and SVG lines. Built for social proof animations powered by GSAP. CX Codex +1 ★ 78,316repo stars viewport-change viewport-change — a rule that teaches the agent a virtual camera in GSAP scenes: zoom, pan and focus-lock on a moving element, all through one wrapper. CX Codex +1 ★ 78,316repo stars coordinate-target-zoom coordinate-target-zoom — a rule that teaches the agent to zoom into an element displaced from viewport center by pairing scale with counter-translation — the target lands at center after the zoom. CX Codex +1 ★ 78,316repo stars ai-tracking-box ai-tracking-box generates an animated target bounding box with corner brackets and oscillating coordinates to simulate computer vision tracking in GSAP. CX Codex +1 ★ 78,316repo stars

Project sponsors

Companies that keep this analytics open