Pulsing Border
Free
Glowing trails of color that travel around a border and merge into a luminous frame, with optional pulse and smoke. Adapted from Pulsing Border by Paper Shaders (shaders.paper.design) under the Apache 2.0 license.
Code
Usage
<ShaderPulsingBorder
spotColor1="#0dc1fd"
spotColor2="#d915ef"
spotColor3="#ff3f2e"
spotColor4="#0dc1fd"
spotColor5="#d915ef"
backgroundColor="#000000"
spotColorCount={3}
spotOpacity1={1}
spotOpacity2={1}
spotOpacity3={0.8}
spotOpacity4={1}
spotOpacity5={1}
backgroundOpacity={0}
frameAspect="auto"
bloomStrength={0.25}
borderMarginBottom={0}
borderMarginLeft={0}
pulseStrength={0.25}
borderMarginRight={0}
borderRoundness={0.25}
smokeStrength={0.3}
smokeSize={0.6}
borderSoftness={0.75}
spotIntensity={0.2}
spotSize={0.5}
spotCount={4}
borderThickness={0.1}
borderMarginTop={0}
pulseSpeed={1}
graphicScale={1}
graphicRotation={0}
graphicOffsetX={0}
graphicOffsetY={0}
/>Props
| prop | type | default | description |
|---|---|---|---|
spotColorCount | number | 3 | Number of active spot colors, from 1 to 5. |
spotColor1 | string | #0dc1fd | Spot color 1 as a CSS color. |
spotOpacity1 | number | 1 | Opacity of spot color 1, from 0 to 1. |
spotColor2 | string | #d915ef | Spot color 2 as a CSS color. |
spotOpacity2 | number | 1 | Opacity of spot color 2, from 0 to 1. |
spotColor3 | string | #ff3f2e | Spot color 3 as a CSS color. |
spotOpacity3 | number | 0.8 | Opacity of spot color 3, from 0 to 1. |
spotColor4 | string | #0dc1fd | Spot color 4 as a CSS color. |
spotOpacity4 | number | 1 | Opacity of spot color 4, from 0 to 1. |
spotColor5 | string | #d915ef | Spot color 5 as a CSS color. |
spotOpacity5 | number | 1 | Opacity of spot color 5, from 0 to 1. |
backgroundColor | string | #000000 | Background color. Accepts any CSS color. |
backgroundOpacity | number | 0 | Opacity of the background color. Range 0 to 1. |
borderRoundness | number | 0.25 | Corner radius of the border. Range 0 to 1. |
borderThickness | number | 0.1 | Base width of the border. Range 0 to 1. |
borderSoftness | number | 0.75 | 0 gives a hard border edge. 1 gives a smooth glow. Range 0 to 1. |
frameAspect | "auto" | "square" | auto | Shape of the frame. |
spotIntensity | number | 0.2 | Thickness of each color spot. Softness makes it stronger. Range 0 to 1. |
bloomStrength | number | 0.25 | 0 blends colors normally. 1 adds them for a full glow. Range 0 to 1. |
spotCount | number | 4 | Number of spots for each color. Range 1 to 4. |
spotSize | number | 0.5 | Angular size of the spots. Range 0 to 1. |
pulseStrength | number | 0.25 | Strength of the pulsing animation. Range 0 to 1. |
smokeStrength | number | 0.3 | Noisy shape that extends the border. Range 0 to 1. |
smokeSize | number | 0.6 | Size of the smoke. Needs smoke above 0. Range 0 to 1. |
borderMarginLeft | number | 0 | Distance from the left edge to the border. Range 0 to 1. |
borderMarginRight | number | 0 | Distance from the right edge to the border. Range 0 to 1. |
borderMarginTop | number | 0 | Distance from the top edge to the border. Range 0 to 1. |
borderMarginBottom | number | 0 | Distance from the bottom edge to the border. Range 0 to 1. |
pulseSpeed | number | 1 | Animation speed. 0 stops the animation. Range 0 to 2. |
graphicScale | number | 1 | Overall zoom level of the graphic. |
graphicRotation | number | 0 | Rotation of the graphic in degrees. |
graphicOffsetX | number | 0 | Horizontal offset of the graphic center. |
graphicOffsetY | number | 0 | Vertical offset of the graphic center. |
graphicFit | "none" | "contain" | "cover" | contain | How the graphic fits the canvas. |
opacity | number | 1 | Sets the overall opacity of the shader wrapper. |
maxDpr | number | 1.5 | Caps device pixel ratio for sharper output without runaway GPU cost. |
maxFps | 30 | 45 | 60 | 60 | Caps the animation frame rate for performance-sensitive pages. |