Skip to main content
rule CX Codex

context-sensitive-cursor — Claude Code rule

context-sensitive-cursor — a rule for typewriter scenes where the caret takes its colour and height from whichever segment of the line is being typed.

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/context-sensitive-cursor.md
Open on GitHub

What context-sensitive-cursor does

This rule covers a scene with a typed line where the caret picks up the colour of the segment on screen. Every entry in the sequence holds a time, the visible text, a segment key and a hex colour. A GSAP driver looks up the entry for the current time inside onUpdate and repaints the caret block.

You get the scene markup, CSS with placeholders such as {monoFont} and {cursorGap}, a paused timeline and a few variations: no blink while characters are still being added, a taller caret on the brand segment, a contrast swap when the text renders dark. Blink runs off Math.sin instead of CSS @keyframes because keyframe animation drifts once the scene is seeked.

Use a monospace stack. A proportional face makes the caret slide away mid-segment. Keep the palette to 3-4 colours, or the shifts look random. The example loads [email protected] from a CDN, so the page needs that script before the timeline runs.

What it helps with

  • colour the caret to match a brand accent mid-line
  • keep blink in sync when the scene is seeked
  • highlight a keyword by switching cursor colour
  • lay out a terminal scene with a monospace caret on GSAP
  • suppress blink while characters are still typing

Example prompts for the agent

  • Make the caret switch to the brand accent while the brand name is being typed, then fade back to grey on the placeholder.
  • Drive the blink with Math.sin so seeking does not throw it off.
  • Add a success segment entry to SEQUENCE with a green caret.

How to install context-sensitive-cursor

Manually: put the files in place

.claude/rules/context-sensitive-cursor.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 context-sensitive-cursor

How do I install context-sensitive-cursor in Claude Code?

Place the rule file at .claude/rules/context-sensitive-cursor.md.

What does context-sensitive-cursor do?

It describes a typing animation where the caret takes colour and height from the active segment, with a sine-driven blink.

Does the scene need GSAP?

Yes. The example pulls [email protected] from a CDN and builds the timeline on it; without the script the driver never runs.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set101

The whole set →
vertical-spring-ticker vertical-spring-ticker is a rule for Claude Code and Codex that defines a slot-machine vertical ticker with additive GSAP spring physics. Each spring advances the stack one discrete step instead of a smooth scroll. CX Codex +1 ★ 78,316repo stars multi-phase-camera multi-phase-camera — a rule for animated web scenes: the camera moves through 2-3 zoom phases (pull-back, focus, push) with continuous micro-drift on top. For when a single linear zoom feels mechanical. CX Codex +1 ★ 78,316repo stars camera Reference rule for ManimGL CameraFrame controls. Helps write 2D pans, zoom sequences, and 3D view changes without syntax errors. CX Codex +1 ★ 78,316repo stars scale-swap-transition The scale-swap-transition rule describes a morph-like swap between two DOM elements using a shrinking exit and a springy entrance. Use it for UI state changes. CX Codex +1 ★ 78,316repo stars cursor-click-ripple cursor-click-ripple supplies GSAP timeline specifications for a moving cursor, button press recoil, and expanding ripple waves. CX Codex +1 ★ 78,316repo stars split-tilt-cards The split-tilt-cards rule builds a two-card 3D split layout with opposing tilt. Use it for comparisons, paired features, or before/after scenes. CX Codex +1 ★ 78,316repo stars reactive-displacement reactive-displacement — a transition rule where the incoming card's spring also drives the outgoing card, so the swap reads as a hit. CX Codex +1 ★ 78,316repo stars hyperframes-media hyperframes-media generates voiceovers, background tracks, sound effects, and subtitles for HyperFrames projects using scripts/audio.mjs. CX Codex +1 ★ 78,316repo stars

Project sponsors

Companies that keep this analytics open