레이어 반복

Repeater

하나의 입력을 격자·원형·직선으로 복제해 배열하고 복사본마다 크기와 회전 등을 달리합니다.

다른 이름: RepeaterInstance repeater

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

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

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

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

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

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

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <ImageTexture
        objectFit="cover"
        url="/samples/photo.jpg" />
      <Repeater />
    </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/photo.jpg',
      },
    },
    {
      type: 'Repeater',
    }
  ]
}, { disableTelemetry: true })

속성(props) · Repeater

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

이름값기본값범위·선택지설명(원문)
modeModegridgrid · radial · linearLayout used to place the repeated instances
cropLeftCrop Left00 – 0.49 (step 0.005)Crop inset from the left edge of the source element (fraction of its width)
cropRightCrop Right00 – 0.49 (step 0.005)Crop inset from the right edge of the source element (fraction of its width)
cropTopCrop Top00 – 0.49 (step 0.005)Crop inset from the top edge of the source element (fraction of its height)
cropBottomCrop Bottom00 – 0.49 (step 0.005)Crop inset from the bottom edge of the source element (fraction of its height)
columnsColumns31 – 12 (step 1)Number of grid columns
rowsRows31 – 12 (step 1)Number of grid rows
gapXGap X0.050 – 0.5 (step 0.005)Horizontal gap between grid cells
gapYGap Y0.050 – 0.5 (step 0.005)Vertical gap between grid cells
staggerStagger00 – 1 (step 0.01)Horizontal offset applied to every other row (brick layout)
flipFlipnonenone · alternate-flip-x · alternate-flip-y · bothMirror alternating columns/rows for seamless tiling patterns
countCount81 – 64 (step 1)Number of repeated instances
radiusRadius0.30 – 1 (step 0.005)Orbit radius of the radial layout
startAngleStart Angle00 – 360 (step 1)Angle of the first instance on the orbit
sweepSweep3600 – 360 (step 1)Angular span the instances are distributed across
faceCenterFace Centerfalse—Rotate each instance to face the orbit center
directionDirection00 – 360 (step 1)Direction of the linear layout in degrees (0 = rightward)
spacingSpacing0.20 – 1 (step 0.005)Distance between consecutive instances
instanceScaleScale10.5 – 2 (step 0.005)Progressive scale multiplier applied per instance (compounds with each copy)
instanceRotationRotation0-180 – 180 (step 1)Additional rotation in degrees applied per instance (accumulates with each copy)
instanceOpacityOpacity10 – 1 (step 0.005)Progressive opacity falloff applied per instance (compounds with each copy)
hueShiftHue Shift00 – 360 (step 1)Hue rotation in degrees added per instance
phasePhase00 – 1 (step 0.001)Seamless layout animation phase (0-1 wraps to the identical layout)
zOrderZ-Orderforwardforward · backwardStacking order of overlapping instances
jitterPositionPosition00 – 1 (step 0.005)Random per-instance position offset
jitterRotationRotation00 – 1 (step 0.005)Random per-instance rotation
jitterScaleScale00 – 1 (step 0.005)Random per-instance scale variation
jitterOpacityOpacity00 – 1 (step 0.005)Random per-instance opacity variation
seedSeed00 – 100 (step 1)Random seed for the jitter values

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

스티커 한 장을 격자나 원형으로 여러 번 찍어 놓은 것처럼, 입력 하나가 일정한 배열로 복제됩니다.

`mode`에서 격자·방사형·직선 배열을 고릅니다. 격자에서는 `columns`와 `rows`로 칸 수를 정하고, 방사형·직선에서는 `count`로 복사본 수를 조절합니다. 직선 배열의 `spacing`은 복사본 사이 거리를 바꿉니다.

복제할 이미지나 도형 레이어를 Repeater 안에 넣어야 표시됩니다. 배열 방식에 따라 쓸 수 있는 설정이 달라지고 복사본마다 크기·회전·불투명도 변화를 줄 수도 있습니다. 수를 너무 늘리면 세부가 뭉쳐 보이므로 단순한 도형이나 패턴을 사용하세요.

언제 쓰나

배경 패턴, 아이콘 배열, 원형 방사형 장식에 적합합니다. 복사본이 많아져도 각 요소를 따로 읽어야 하는 화면에는 피하세요.

페이지로 열기 ↗