선형 와이프

Linear Wipe

부드러운 직선 경계가 입력 화면을 가로질러 지나가며 지웁니다.

다른 이름: LinearWipelinear wipewipe transition

WebGPU 를 지원하는 브라우저에서 움직입니다

이 기기에서는 데모를 그리지 못해 정지 화면을 보여 줍니다

React
// WebGPU 를 지원하는 브라우저에서만 그립니다.
// /samples/… 는 이 사이트의 샘플 파일입니다. 내 프로젝트의 이미지·영상 경로로 바꾸세요.
import { Shader, ImageTexture, LinearWipe } from 'shaders/react'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <ImageTexture
        objectFit="cover"
        url="/samples/still.jpg" />
      <LinearWipe
        progress={{
          type: "auto-animate",
          mode: "ping-pong",
          outputMin: 0,
          outputMax: 1,
          speed: 0.5
        }}>
        <ImageTexture
          objectFit="cover"
          url="/samples/photo.jpg" />
      </LinearWipe>
    </Shader>
  )
}
Vue
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<!-- /samples/… 는 이 사이트의 샘플 파일입니다. 내 프로젝트의 이미지·영상 경로로 바꾸세요. -->
<script setup lang="ts">
import { Shader, ImageTexture, LinearWipe } from 'shaders/vue'
</script>

<template>
  <Shader style="width: 100%; height: 320px" :disable-telemetry="true">
    <ImageTexture
      object-fit="cover"
      url="/samples/still.jpg"/>
    <LinearWipe
      :progress="{
        type: 'auto-animate',
        mode: 'ping-pong',
        outputMin: 0,
        outputMax: 1,
        speed: 0.5
      }">
      <ImageTexture
        object-fit="cover"
        url="/samples/photo.jpg"/>
    </LinearWipe>
  </Shader>
</template>
Svelte
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<!-- /samples/… 는 이 사이트의 샘플 파일입니다. 내 프로젝트의 이미지·영상 경로로 바꾸세요. -->
<script>
  import { Shader, ImageTexture, LinearWipe } from 'shaders/svelte'
</script>

<Shader style="width: 100%; height: 320px" disableTelemetry>
  <ImageTexture
    objectFit="cover"
    url="/samples/still.jpg" />
  <LinearWipe
    progress={{
      type: "auto-animate",
      mode: "ping-pong",
      outputMin: 0,
      outputMax: 1,
      speed: 0.5
    }}>
    <ImageTexture
      objectFit="cover"
      url="/samples/photo.jpg" />
  </LinearWipe>
</Shader>
Solid
// WebGPU 를 지원하는 브라우저에서만 그립니다.
// /samples/… 는 이 사이트의 샘플 파일입니다. 내 프로젝트의 이미지·영상 경로로 바꾸세요.
import { Shader, ImageTexture, LinearWipe } from 'shaders/solid'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <ImageTexture
        objectFit="cover"
        url="/samples/still.jpg" />
      <LinearWipe
        progress={{
          type: "auto-animate",
          mode: "ping-pong",
          outputMin: 0,
          outputMax: 1,
          speed: 0.5
        }}>
        <ImageTexture
          objectFit="cover"
          url="/samples/photo.jpg" />
      </LinearWipe>
    </Shader>
  )
}
JavaScript
// WebGPU 를 지원하는 브라우저에서만 그립니다.
// /samples/… 는 이 사이트의 샘플 파일입니다. 내 프로젝트의 이미지·영상 경로로 바꾸세요.
// <canvas id="canvas" style="width:100%;height:320px"></canvas> 가 페이지에 있어야 한다
import { createShader } from 'shaders/js'

const shader = await createShader(document.getElementById("canvas"), {
  components: [
    {
      type: 'ImageTexture',
      props: {
        objectFit: 'cover',
        url: '/samples/still.jpg',
      },
    },
    {
      type: 'LinearWipe',
      props: {
        progress: {
          type: 'auto-animate',
          mode: 'ping-pong',
          outputMin: 0,
          outputMax: 1,
          speed: 0.5
        },
      },
      children: [
        {
          type: 'ImageTexture',
          props: {
            objectFit: 'cover',
            url: '/samples/photo.jpg',
          },
        },
      ],
    }
  ]
}, { disableTelemetry: true })

속성(props) · LinearWipe

값을 바꾸면 위 데모와 코드 탭에 바로 반영됩니다. 설명은 라이브러리 레지스트리의 영어 원문(MIT)입니다.

이름값기본값범위·선택지설명(원문)
progressProgress데모에서 자동으로 오가는 값 — 움직이면 그 값에 고정됩니다0.50 – 1 (step 0.01)How far the wipe has travelled (0 = fully visible, 1 = fully wiped away)
angleAngle00 – 360 (step 1)Direction of the wipe in degrees (0 = left to right)
featherFeather0.10 – 1 (step 0.01)Softness of the wipe edge
invertInvertfalse—Reverse the direction the wipe travels

모든 컴포넌트 공통: blendMode · opacity · visible · maskSource/maskType · boundingBox · id

화면 위로 커튼 가장자리가 지나가듯 직선 경계 한쪽이 사라집니다. 경계가 선명한지 부드러운지에 따라 전환의 속도감이 달라 보입니다.

`progress`는 기본 0.5, 범위 0–1이며 0은 모두 보임, 1은 모두 지워진 상태입니다. `angle`은 기본 0도, 범위 0–360도이며 기본 방향은 왼쪽에서 오른쪽입니다. `feather`는 기본 0.1, 범위 0–1로 경계의 부드러움을 조절하고, `invert`는 기본 false로 방향을 뒤집습니다.

지울 이미지나 영상 입력 위에 놓으세요. 실제 두 화면 사이의 전환을 만들려면 다음 화면을 아래 레이어에 두고 progress를 시간에 따라 움직입니다. feather가 크면 작은 글자 주변까지 흐릿해질 수 있습니다.

언제 쓰나

장면을 방향감 있게 교체하거나, 제목·이미지를 순서대로 드러내거나, 섹션 사이의 단순한 전환에 좋습니다. 움직임 없이 중간 progress만 보여 주면 화면이 반쯤 잘린 상태로 남으므로 피하세요.

페이지로 열기 ↗