cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <svg xmlns="http://www.w3.org/2000/svg" 
     viewBox="0 0 200 200"
     preserveAspectRatio="xMidYMid slice"
     id="svg">
    
    <linearGradient id="grad">
        <stop class="stop stop--1" 
              stop-color="crimson"
              offset="0"></stop>
        <stop class="stop stop--2" 
              stop-color="gold"
              offset="49%"></stop>
        <stop class="stop stop--2" 
              stop-color="gold"
              offset="51%"></stop>
        <stop class="stop stop--3" 
              stop-color="teal"
              offset="100%"></stop>
    </linearGradient>
    
    <pattern id="pattern" 
              viewBox="0 0 50 50"
              width="2" height="2"
             patternUnits="userSpaceOnUse">
        <path stroke="black"
              stroke-width="6"
              d="M0,50 50,0
                 "></path>
    </pattern>
    
    <mask id="mask">
        <rect width="100%" height="100%"
          fill="white">
        </rect>
        <rect width="100%" height="100%"
          fill="url(#pattern)">
        </rect>
    </mask>
    
    <g mask="url(#mask)">
        <text x="50.7%" y="50.7%" dy=".25em"
          text-anchor="middle"
          fill="none"
          stroke="url(#grad)"
          stroke-width=".25"
          >Text</text>
       <text x="50%" y="50%" dy=".25em"
          text-anchor="middle"
          fill="url(#grad)"
          >Text</text>
    </g>
</svg>
            
          
!
            
              HTML, BODY {
    height: 100%;
}

BODY {
    background: #000;
    background: linear-gradient(#000,#222);
    font-family: Georgia, sans-serif;
    font-size: 42px; 
    font-weight: bold
}

svg  {
    position: absolute;
    width: 100%;
    height: 100%;
    // border: 1px solid red;
}

.stop--1 {
    animation: colors-1 2.5s infinite;
}
.stop--2 {
    animation: colors-2 5s infinite;
}
.stop--3 {
    animation: colors-3 7.5s infinite;
}

@keyframes colors-1 {
    30% {
        stop-color: purple;
    }
    60% {
        stop-color: red;
    }
}
@keyframes colors-2 {
    50% {
        stop-color: khaki;
    }
}
@keyframes colors-3 {
    30% {
        stop-color: teal;
    }
    60% {
        stop-color: yellowgreen;
    }
}

            
          
!
            
              console.clear();
var grad = document.querySelector('#grad');
var grad2 = document.querySelector('#grad-2');

function getGradSet( angle ) {
    return gradSet = {
        set1: {
            'gradientTransform': 'rotate(0, .5, .5)' 
        },
        set2: {
            'gradientTransform': 'rotate(' + angle + ', .5, .5)' 
        }
    };
}

addAnimation( grad,  getGradSet( 360 )  );

function addAnimation( elem, sets ) {
    var tl = new TimelineLite();
    var duration = Math.random() * 2 + 2;    
    
    animateGrad();
    
    function animateGrad() {    
        tl.set( elem, { attr: sets.set1 } );
        tl.to( elem, duration, { 
            attr: sets.set2,
            ease: Power0.easeNone,
            onComplete: animateGrad
        });    
    }
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console