Sine Wave

사인파

Animated wave with thickness and softness.

Also known as: SineWaveSine wave

Moves in browsers that support WebGPU

This device could not render the demo — showing a still

React
// Renders only in browsers with WebGPU.
import { Shader, SineWave } from 'shaders/react'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <SineWave />
    </Shader>
  )
}
Vue
<!-- Renders only in browsers with WebGPU. -->
<script setup lang="ts">
import { Shader, SineWave } from 'shaders/vue'
</script>

<template>
  <Shader style="width: 100%; height: 320px" :disable-telemetry="true">
    <SineWave/>
  </Shader>
</template>
Svelte
<!-- Renders only in browsers with WebGPU. -->
<script>
  import { Shader, SineWave } from 'shaders/svelte'
</script>

<Shader style="width: 100%; height: 320px" disableTelemetry>
  <SineWave />
</Shader>
Solid
// Renders only in browsers with WebGPU.
import { Shader, SineWave } from 'shaders/solid'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <SineWave />
    </Shader>
  )
}
JavaScript
// Renders only in browsers with WebGPU.
// expects <canvas id="canvas" style="width:100%;height:320px"></canvas> on the page
import { createShader } from 'shaders/js'

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

Props · SineWave

Changes apply to the demo above and to the code tabs. Descriptions come from the library registry (MIT).

NameValueDefaultRange / optionsDescription
colorColor#ffffff—The color of the sine wave
amplitudeAmplitude0.150 – 1 (step 0.1)The height/amplitude of the sine wave
frequencyFrequency10.1 – 20 (step 0.1)The frequency/number of wave cycles
speedSpeed1-5 – 5 (step 0.1)The animation speed of the wave
angleAngle00 – 360 (step 1)The rotation angle of the wave (in degrees)
positionPosition
x0.5y0.5
{"x":0.5,"y":0.5}x, y: 0 – 1The center position of the wave
thicknessThickness0.20 – 2 (step 0.1)The thickness of the wave line
softnessSoftness0.40 – 1 (step 0.1)Edge softness of the wave line

Every component also takes blendMode · opacity · visible · maskSource/maskType · boundingBox · id

It resembles a single trace on an oscilloscope or audio display: a smooth curve that keeps moving.

`amplitude` from 0–1 changes its height and `frequency` from 0.1–20 sets the number of cycles across the canvas. Rotate it with `angle` from 0–360 and adjust line weight with `thickness` from 0–2. `speed` from -5–5 controls direction and pace.

Sine Wave draws a moving line and does not read an input signal. For a visualizer that can respond to a value, use Waveform instead, and keep enough contrast between the line and its background.

When to use

Use it as audio or science themed decoration, a simple animated hero detail, or a curved divider. Avoid it when the line must display real sensor or audio data.

Open as page ↗