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.


                <!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Rainbow Button owo</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="style.css">
        <h1 class="rainbow-name">
            <canvas class="rainbow-name__canvas" width="930" height="418"></canvas>
            <img class="rainbow-name__image" src="" alt="Dusty Button">
        <script src="main.js"></script>


                body {
    background: #020916;
.rainbow-name {
    position: relative;
    margin: 100px 10%;
    max-width: 1000px;
  .rainbow-name__canvas {
    position: absolute;
    left: 0px;
    top: 0;
    width: 110%; 
  .rainbow-name__image {
    display: block;
    width: 100%;
    position: relative;


                var wordmark = document.querySelector('.rainbow-name');

var wordmarkImg = wordmark.querySelector('.rainbow-name__image');
var canvas = wordmark.querySelector('.rainbow-name__canvas');
var ctx = canvas.getContext('2d');
var trailCount = 100;
var canvasWidth = canvas.width;
var canvasHeight = canvas.height;

var nameImage = new Image();
nameImage.onload = onImageLoad;
nameImage.src = "";

function onImageLoad() {
  setColorCanvas( 'blue', '#5ab3b5' );
  setColorCanvas( 'gold', '#EA0' );
  setColorCanvas( 'orange', '#E62' );
  setColorCanvas( 'magenta', '#C25' );

var colorCanvases = {};

function setColorCanvas( name, color ) {
  var colorCanvas = document.createElement('canvas');
  colorCanvas.width = nameImage.width;
  colorCanvas.height = nameImage.height;
  var colorCtx = colorCanvas.getContext('2d');
  colorCtx.drawImage( nameImage, 0, 0 );
  colorCtx.globalCompositeOperation = 'source-in';
  colorCtx.fillStyle = color;
  colorCtx.fillRect( 0, 0, nameImage.width, nameImage.height );
  colorCanvases[ name ] = colorCanvas;

var t = 0;
var rainbow = [];

(function() {
  for ( var i=0; i < trailCount; i++ ) {

var colorCycle = [ 'blue', 'gold', 'orange', 'magenta' ];

function animate() {
  requestAnimationFrame( animate );

function update() {
  var colorCycleIndex = Math.floor( t / 8 ) % 4;
  var nextColor =  colorCycle[ colorCycleIndex ];
  rainbow.unshift( nextColor );
  rainbow.unshift( nextColor );
  rainbow.unshift( nextColor );

function render() {
  ctx.clearRect( 0, 0, canvasWidth, canvasHeight );

  // iterate backwards through rainbow
  for ( var i = rainbow.length-1; i >= 0; i-- ) {
    var color = rainbow[i];
    if ( color ) {
      ctx.drawImage( colorCanvases[ color ], i+1, i+1 );