shaders-cursor-ripples
できること
このスキルは、写真やヒーロー画像の上で、マウスに追従するWebGPUの波紋のゆがみを加えます。ページを再デザインせずに、流動的でインタラクティブな画像が欲しいフロントエンド開発者向けです。
使う場面
- ✓ヒーローやギャラリーの画像に、マウスに追従する水の波紋の効果が必要なとき。
- ✓画像にある古いスポットライトやフラッシュライトの効果を置き換えたいとき。
- ✓参考例からシェーダーの操作だけを取り入れ、そのデザインはコピーしたくないとき。
スキルのリンク
https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/shaders-cursor-ripples/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“ヒーローの画像に、マウスに追従する水の波紋を付けてください。ただし、ページの他の部分は変えないでください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、既存の画像と内容を残し、画像の上にシェーダーのキャンバスを置いて、その上に波紋の層を加えます。古いカスタムのポインターのコードを取り除き、動きが減らされている場合やWebGPUが使えない場合には、通常の画像に戻します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Shaders Cursor Ripples
Core Contract
- Preserve the existing page, content, and semantic image.
- Install
shadersand import from the active framework subpath. - Render the source image through one
Shadercanvas. - Place
CursorRipplesafterImageTextureso it post-processes that image. - Keep
toneMapping="aces"on the root. - Let Shaders track the cursor. Remove custom spotlight coordinates, radial masks, duplicated reveal images, and pointer animation loops.
- Keep one real image beneath the canvas as the accessible loading and WebGPU fallback.
- Disable the shader for reduced motion and unsupported WebGPU.
- Lazy-load the shader code so the library does not inflate the initial page bundle.
When the user asks for only the shader effect, do not copy a reference's ribbon, blob, glow, typography, layout, copy, colors, or identity. Do not substitute the Shaders Water component: CursorRipples is the interactive image-displacement effect.
Inspect Before Editing
- Find the real media wrapper, image URL, crop, overlays, z-index, and existing motion.
- Confirm the wrapper has a non-zero rendered width and height.
- Search for old reveal code such as
data-reveal-hover,mask-image: radial-gradient, duplicated images,requestAnimationFrame, and manual pointer listeners. - Preserve unrelated parallax or entrance motion unless it conflicts with the shader canvas.
- Check the installed
shadersversion and current framework API when the package may have changed.
Install
npm install shaders
Import from shaders/react, shaders/vue, shaders/svelte, or shaders/solid. For Vite projects, never add shaders to optimizeDeps.exclude; its CommonJS dependencies need Vite pre-bundling. No optimizeDeps entry is normally required.
Before a commercial release, verify the current Shaders license terms.
Required Composition
Keep the component order and values below:
<Shader toneMapping="aces">
<ImageTexture url={imageUrl} objectFit="cover" />
<CursorRipples decay={7.3} radius={0.6} />
</Shader>
Use this as the baseline before tuning intensity, chromaticSplit, or edges. Do not add SolidColor, Blob, Form3D, GaborNoise, Glow, or another generator unless the user explicitly requests the reference's generated artwork.
For React, copy and adapt assets/react/cursor-ripple-shader.tsx and assets/react/cursor-ripple-media.css.
Client and Fallback Pattern
Mount the shader only after the browser confirms WebGPU and motion is allowed:
const CursorRippleShader = lazy(() => import("./cursor-ripple-shader"));
const [shaderEnabled, setShaderEnabled] = useState(false);
const [shaderReady, setShaderReady] = useState(false);
useEffect(() => {
const reduceMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
const sync = () => {
const enabled = "gpu" in navigator && !reduceMotion.matches;
setShaderEnabled(enabled);
if (!enabled) setShaderReady(false);
};
sync();
reduceMotion.addEventListener("change", sync);
return () => reduceMotion.removeEventListener("change", sync);
}, []);
Keep the semantic image in the wrapper, then overlay the lazy shader:
<figure className="cursor-ripple-media">
<img
className="cursor-ripple-media__fallback"
src={imageUrl}
alt={meaningfulAlt}
width={width}
height={height}
/>
{shaderEnabled ? (
<Suspense fallback={null}>
<CursorRippleShader
imageUrl={imageUrl}
ready={shaderReady}
onReady={() => setShaderReady(true)}
/>
</Suspense>
) : null}
</figure>
For Next.js, an ssr: false dynamic import is also valid. Do not hide the fallback until the shader calls onReady; a failed WebGPU initialization must leave the page legible and complete.
Layering Rules
- Give the media wrapper
position: relative, a definite size,overflow: hidden, andisolation: isolate. - Keep the fallback at z-index
0and the canvas at z-index1. - Fill the wrapper with
position: absolute; inset: 0; width: 100%; height: 100%. - Set the shader layer to
pointer-events: none; Shaders listens globally and converts pointer coordinates using the canvas bounds. - Mark the shader wrapper
aria-hidden="true"; the fallback image owns the accessible name. - Place copy, links, and controls above the canvas so the effect never intercepts i
よくある質問
訪問者のブラウザがWebGPUに対応していない場合はどうなりますか?
スキルは、キャンバスの下に一枚の本物の画像を代替として残し、ページが正しく見えるようにすると述べています。
ページの重さは増えますか?
スキルは、最初のページの読み込みを遅くしないよう、シェーダーのコードを遅延読み込みするとしています。
ブランドやコピーは変わりますか?
いいえ。ページ、内容、意味のある画像は保たれます。
詳細
作者による元の説明
Add cursor-following fluid WebGPU distortion over an existing image with the Shaders library's ImageTexture and CursorRipples components. Use when a hero, gallery, or media panel needs a water-ripple mouse effect; when replacing a drifting CSS spotlight or flashlight reveal; or when a prompt says to borrow only the shader interaction from a Shaders.com reference while preserving the current brand, image, copy, and layout.
repo: MengTo/Skills
人気
- GitHubのスター
- 7.2k
- ランキング
- #13466
- ライセンス
- MIT
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
3d-cloth-material
7.2kThree.js で、糸の織り、柔らかい光沢、自然な襞、裾、縫い目を持つ、本物の織物らしい布を作るようエージェントを支援します。
3d-falling-leaves
7.2k3D のシーンに、回転し、風に流され、カメラの動きに合わせて再利用される、本物らしい落ち葉を加えるようエージェントを支援します。
3d-four-seasons
7.2k3D のシーンに、春、夏、秋、冬の見た目を加え、シーン全体を作り直さずに、茂み、光、空、雪を変えるようエージェントを支援します。
3d-high-poly-models
7.2k滑らかな形と自然な縁をもつ、詳細な3Dモデルを作り、その後、Web で快適に動く軽いバージョンを準備するようエージェントを支援します。
似ているスキル
angular-developer
280kエージェントがAngularのコードを作成し、プロジェクト構成についてアドバイスできるようにします。新しいプロジェクトの開始、コード部品の作成、パフォーマンスやアクセシビリティの改善に役立ちます。
frontend-a11y
280kエージェントが Web インターフェースを誰にとっても使いやすくするよう支援します。スクリーンリーダーやキーボード操作に対応し、サイトやアプリが適切に動作するようにします。
frontend-patterns
280kエージェントがフロントエンド開発の最新パターンを適用できるようにします。React と Next.js において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。