평행사변형

Parallelogram

가로·세로 크기와 한쪽 변의 기울기를 조절하는 평행사변형입니다.

다른 이름: ParallelogramSlanted rectangle

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

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

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

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

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

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

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <Parallelogram />
    </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: 'Parallelogram',
    }
  ]
}, { disableTelemetry: true })

속성(props) · Parallelogram

값을 바꾸면 위 데모와 코드 탭에 바로 반영됩니다. 설명은 라이브러리 레지스트리의 영어 원문(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 parallelogram
centerCenter
x0.5y0.5
{"x":0.5,"y":0.5}x, y: 0 – 1Center position of the parallelogram
widthWidth0.320.02 – 1 (step 0.01)Half-width of the parallelogram
heightHeight0.220.02 – 1 (step 0.01)Half-height of the parallelogram
skewSkew0.15-0.4 – 0.4 (step 0.01)Horizontal skew of the top edge
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

평행사변형은 마주 보는 변이 나란한 채 옆으로 밀린 사각형입니다. 기울어진 라벨이나 속도감 있는 배경 패널처럼 방향성을 더할 때 어울립니다.

`width`와 `height`는 반쪽 크기로 각각 0.02–1 범위입니다. `skew`는 위쪽 변의 가로 기울기로 -0.4–0.4 범위이며, `rotation`은 0–360도 사이에서 도형 전체를 돌립니다.

`skew`가 모양의 한쪽 변을 기울이고 `rotation`이 도형 전체를 돌린다는 점은 서로 다릅니다. `Trapezoid`와 나란히 두면 폭 변화와 기울기 차이를 비교하기 좋고, 텍스트 뒤에 쓸 때는 기울어진 가장자리와 글자 간격을 확인하세요.

언제 쓰나

기울어진 라벨·배너·속도감 있는 패널에 좋습니다. 직사각형보다 방향성이 있는 배경 면을 만들 수 있습니다. 위아래 폭이 달라야 하는 사다리꼴이나 수직 정렬이 중요한 카드에는 피하세요.

페이지로 열기 ↗