Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <shader-art role="img" autoplay aria-label="An animated radial gradient using the colors of the pride flag">
  <uniform type="float" name="blur" value="0.01" min="0.0" max="0.2" step="0.001"/>
  <uniform type="float" name="amplitude" value=".1" min="0.0" max="0.5" step="0.01"/>
  <uniform type="float" name="frequency" value="6" min="0.0" max="20." step="1"/>
  <uniform type="float" name="motionSpeed" value="1." min="0.0" max="2." step="0.01"/>
  <script type="buffer" name="position" data-size="2">
    [-1, 1, -1,-1, 1,1, 1, 1, -1,-1, 1,-1]
  <script type="buffer" name="uv" data-size="2">
    [ 0, 0,  0, 1, 1,0, 1, 0,  0, 1, 1, 1]
  <script type="vert">
    precision highp float;
    attribute vec4 position;
    attribute vec2 uv;
    varying vec2 vUv;
    varying vec4 vPosition;
    void main() {
      vUv = uv;
      vPosition = position;
      gl_Position = position;
  <script type="frag">
    precision highp float;
    varying vec2 vUv;
    varying vec4 vPosition;
    uniform vec2 resolution;
    uniform float time;
    uniform float blur;
    uniform float amplitude;
    uniform float frequency;
    uniform float motionSpeed;
    const float PI = 3.141592654;
    vec3 blend(vec3 a, vec3 b, float t) {
      return sqrt(
        (1. - t) * pow(a,vec3(2.)) + t * pow(b,vec3(2.)));
    vec3 gradient(float x) {
      vec3 color1 = vec3(1., 0., 0.);
      vec3 color2 = vec3(1., .5, 0.);
      vec3 color3 = vec3(1., 1., 0.);
      vec3 color4 = vec3(0., .5, 0.);
      vec3 color5 = vec3(0., .0, 1.);
      vec3 color6 = vec3(.5, .0,.6);
      float s = 6.;
      float b = blur;
      vec3 color = blend(color6, color1, smoothstep(0., b, x));
      color = blend(color, color2, smoothstep(1./s, 1./s + b, x));
      color = blend(color, color3, smoothstep(2./s, 2./s+b, x));
      color = blend(color, color4, smoothstep(3./s, 3./s+b, x));
      color = blend(color, color5, smoothstep(4./s, 4./s+b, x));
      color = blend(color, color6, smoothstep(5./s, 5./s+b, x));
      return color;
    void main() {
      vec2 p = vec2(vPosition.x, vPosition.y);
      p.x *= resolution.x / resolution.y;
      float a = atan(p.y, p.x);
      float l = length(p.xy);
      gl_FragColor = vec4(gradient(mod(sin(sin(a * frequency) + time * motionSpeed) * amplitude + l, 1.)),1.);


                body {
  display: flex;
  height: 100vh;

shader-art {
  display: block;
  width: 100%;
  height: 100%;

shader-art canvas {
  display: block;
  width: 100%;
  height: 100%;


                import { ShaderArt } from '';
import { UniformPlugin } from '';

ShaderArt.register([() => new UniformPlugin()]);