초승달

Crescent

큰 원에서 옆으로 이동한 작은 원 부분을 덜어 초승달 실루엣을 만듭니다.

다른 이름: CrescentCrescent moon

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

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

React
// WebGPU 를 지원하는 브라우저에서만 그립니다.
import { Shader, Crescent } from 'shaders/react'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <Crescent />
    </Shader>
  )
}
Vue
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<script setup lang="ts">
import { Shader, Crescent } from 'shaders/vue'
</script>

<template>
  <Shader style="width: 100%; height: 320px" :disable-telemetry="true">
    <Crescent/>
  </Shader>
</template>
Svelte
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<script>
  import { Shader, Crescent } from 'shaders/svelte'
</script>

<Shader style="width: 100%; height: 320px" disableTelemetry>
  <Crescent />
</Shader>
Solid
// WebGPU 를 지원하는 브라우저에서만 그립니다.
import { Shader, Crescent } from 'shaders/solid'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <Crescent />
    </Shader>
  )
}
JavaScript
// WebGPU 를 지원하는 브라우저에서만 그립니다.
// <canvas id="canvas" style="width:100%;height:320px"></canvas> 가 페이지에 있어야 한다
import { createShader } from 'shaders/js'

const shader = await createShader(document.getElementById("canvas"), {
  components: [
    {
      type: 'Crescent',
    }
  ]
}, { disableTelemetry: true })

속성(props) · Crescent

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

이름값기본값범위·선택지설명(원문)
originOrigin코드에서 지정center—Reference edge the center position is measured from (center default). Lets you pin the shape relative to a corner or the canvas centre.
colorColor#ffffff—Fill color of the crescent
centerCenter
x0.5y0.5
{"x":0.5,"y":0.5}x, y: 0 – 1Center position of the crescent
radiusSize0.30.05 – 1 (step 0.01)Outer circle radius
innerRatioBite Size0.80.3 – 1.2 (step 0.01)Inner (bite) circle radius as a fraction of outer radius
offsetBite Offset0.20.01 – 0.5 (step 0.01)Horizontal distance the bite circle is shifted from center
rotationRotation00 – 360 (step 1)Rotation in degrees
softnessSoftness00 – 0.1 (step 0.001)Edge softness for antialiasing
strokeThicknessStroke Thickness00 – 0.2 (step 0.005)Stroke thickness. Zero means no stroke.
strokeColorStroke Color#000000—Color of the stroke outline
strokePositionStroke Positioncenteroutside · center · insidePosition of the stroke relative to the shape edge
colorSpaceColor Blendinglinearlinear · oklch · oklab · hsl · hsv · lchColor space for blending fill and stroke colors

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

초승달은 둥근 원 한쪽을 다른 원이 파고든 듯한 실루엣입니다. 달 모양 아이콘이나 방향감 있는 장식으로 알아보기 쉽습니다.

`radius`는 바깥 원의 반지름이며 0.05–1 범위입니다. `innerRatio`는 안쪽 원 반지름의 비율로 0.3–1.2 범위이고, `offset`은 안쪽 원을 중심에서 옮기는 가로 거리로 0.01–0.5 범위입니다. `rotation`은 0–360도 사이에서 초승달 방향을 바꿉니다.

`innerRatio`와 `offset`의 조합이 파인 부분의 폭과 위치를 함께 바꿉니다. `Circle`과 나란히 두어 달의 모양을 비교하거나 `Star`를 배경 장식으로 더하되, 작은 크기에서는 열린 방향이 읽히는지 확인하세요.

언제 쓰나

달 아이콘·야간 테마·방향감이 있는 장식에 좋습니다. 큰 원을 파낸 듯한 비대칭 실루엣으로 시선을 유도할 수 있습니다. 완전히 닫힌 원형이나 대칭 원형 띠가 필요하면 피하세요.

페이지로 열기 ↗