Gem Smoke
Free
Fills a logo with drifting smoke behind glassy edges, with smoke colors, inner color, glow, and distortion controls. Adapted from Gem Smoke by Paper Shaders (shaders.paper.design) under the Apache 2.0 license.
Code
Usage
<ShaderGemSmoke
smokeColor1="#333333"
smokeColor2="#e7e6df"
smokeColor3="#333333"
smokeColor4="#e7e6df"
smokeColor5="#333333"
smokeColor6="#e7e6df"
backgroundColor="#f0efea"
innerColor="#fafaf5"
smokeColorCount={2}
innerOpacity={1}
logoSrc="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='465' height='427' viewBox='21 28 465 427'%3E %3Cpath fill='%23000' d='M274 38 318 171h-25l-19-52-18 52h-26z'/%3E %3Cpath fill='%23000' d='m356 286 43 137-116-84 21-16 41 31-11-53z'/%3E %3Cpath fill='%23000' d='M31 185h445L115 445l234-217z'/%3E%3C/svg%3E"
innerDistortion={0.8}
innerGlow={1}
outerDistortion={0.6}
outerGlow={0.55}
smokeAngle={0}
smokeOffset={0}
smokeSize={0.8}
smokeSpeed={1}
graphicScale={0.6}
graphicRotation={0}
graphicOffsetX={0}
graphicOffsetY={0}
/>Props
| prop | type | default | description |
|---|---|---|---|
logoSrc | string | "" | Logo URL. Use an SVG or PNG with a transparent background. The URL must be same-origin or served with CORS headers. |
logoLabel | string | "" | Accessible name for the logo. Leave it empty when the effect is decorative. |
shape | "none" | "circle" | "daisy" | "diamond" | "metaballs" | diamond | Built-in shape to draw when logoSrc is empty. |
smokeColorCount | number | 2 | Number of active smoke colors, from 1 to 6. |
smokeColor1 | string | #333333 | Smoke color 1 as a CSS color. |
smokeColor2 | string | #e7e6df | Smoke color 2 as a CSS color. |
smokeColor3 | string | #333333 | Smoke color 3 as a CSS color. |
smokeColor4 | string | #e7e6df | Smoke color 4 as a CSS color. |
smokeColor5 | string | #333333 | Smoke color 5 as a CSS color. |
smokeColor6 | string | #e7e6df | Smoke color 6 as a CSS color. |
backgroundColor | string | #f0efea | Color behind the logo. Accepts any CSS color. |
innerColor | string | #fafaf5 | Extra color inside the logo that mixes with the smoke. Accepts any CSS color. |
innerOpacity | number | 1 | Opacity of the inner color. Range 0 to 1. |
innerDistortion | number | 0.8 | Smoke distortion inside the logo. Needs inner glow above 0. Range 0 to 1. |
outerDistortion | number | 0.6 | Smoke distortion outside the logo. Needs outer glow above 0. Range 0 to 1. |
outerGlow | number | 0.55 | Smoke visibility outside the logo. Range 0 to 1. |
innerGlow | number | 1 | Smoke visibility inside the logo. Range 0 to 1. |
smokeOffset | number | 0 | Moves the smoke up or down inside the logo. Range -1 to 1. |
smokeAngle | number | 0 | Direction of the smoke in degrees. Range 0 to 360. |
smokeSize | number | 0.8 | Size of the smoke shape. Range 0 to 1. |
smokeSpeed | number | 1 | Animation speed. 0 stops the animation. Range 0 to 2. |
graphicScale | number | 0.6 | 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 box. |
opacity | number | 1 | Sets the opacity of the whole block. |
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. |