본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)7.2k · #13466

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/shaders-cursor-ripples/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“히어로 이미지에 마우스를 따라 움직이는 물결 효과를 넣어 주세요. 나머지 페이지는 그대로 두고요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 기존 이미지와 콘텐츠를 그대로 두고, 이미지 위에 셰이더 캔버스를 놓은 다음 그 위에 파문 레이어를 추가합니다. 기존 커스텀 포인터 코드는 제거하며, 동작 줄이기가 켜져 있거나 WebGPU를 쓸 수 없으면 기본 이미지로 돌아갑니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Shaders Cursor Ripples

Core Contract

  1. Preserve the existing page, content, and semantic image.
  2. Install shaders and import from the active framework subpath.
  3. Render the source image through one Shader canvas.
  4. Place CursorRipples after ImageTexture so it post-processes that image.
  5. Keep toneMapping="aces" on the root.
  6. Let Shaders track the cursor. Remove custom spotlight coordinates, radial masks, duplicated reveal images, and pointer animation loops.
  7. Keep one real image beneath the canvas as the accessible loading and WebGPU fallback.
  8. Disable the shader for reduced motion and unsupported WebGPU.
  9. 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 shaders version 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, and isolation: isolate.
  • Keep the fallback at z-index 0 and the canvas at z-index 1.
  • 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬