Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <div id="stage-wrapper">
  <svg xmlns="http://www.w3.org/2000/svg" id="stage-master" version="1.2" width="800" height="400" x="0" y="0" viewBox="0 0 800 400">
  <g id="text-group">
    <text dominant-baseline="hanging" text-anchor="middle" font-size="200" width="800" height="400" stroke="black" fill="rgb(255, 255, 255)">
      <tspan alignment-baseline="hanging" y="120" x="400">TEST</tspan>
    </text>
  </g>
</svg>
</div>
<div id="form-stuff">
  <label for="trans-time">Crossfade time in seconds</label>
  <input type="text" id="trans-time" value='4' />
  <label for="background-blend-mode">Blend mode</label>
  <select name="background-blend-mode" id="background-blend-mode">
    <option value="darken" selected="selected">darken</option>
    <option value="luminosity">luminosity</option>
    <option value="multiply">multiply</option>
    <option value="normal">normal</option>
  </select>
  <button id="play">Play</button>
  <button id="pause">Pause</button>
  <button id="reverse">Reverse</button>
  <button id="rewind">Rewind</button>
</div>


              
            
!

CSS

              
                body
  margin: 0
  background: black
#stage-wrapper
  position: relative
  width: 800px
  height: 400px
  #stage-master
    position: absolute
    margin: 0
    background-size: cover
    background-blend-mode: darken
    background-repeat: no-repeat
    background-position: center center
    -moz-transition: 3s
    background-color: white
g#text-group, text, tspan
  opacity: 1
  visibility: visible
button
  font-size: 14px
  color: white
  background: green
  border: none
  border-radius: 5px
  padding: 6px 18px
  margin: 5px
  cursor: pointer
  
#form-stuff
  width: 790px
  background: #dddddd
  margin: 15px 0 5px
  padding: 5px
  input
    width: 25px
    border: 1px solid gray
    display: inline-block
    text-align: center
  label
    font-family: 'helvetica neue', helvetica, arial, sans-serif
    font-size: 14px
    margin-left: 10px
  
              
            
!

JS

              
                console.clear();

// in order to set the dims in the bgArr for any solid color following an imageURL, will need to have already snagged the dims from the previous image
// if you transition from a background with one native size to another of another native size weird things can happen
// duration ( bgArr -> dur) needs to be set to a value higher than the transition time...
var bgArr = [
      {startAt: 0, type: 'color', dims: {ht: 800, wd: 800}, url: 'green'},
      {startAt: 5, type: 'img', dims: {ht: 800, wd: 800}, url: 'url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDgwMCA4MDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDgwMCA4MDA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojQ0NFQkY2O30KCS5zdDF7ZmlsbDojQTJEOUUzO30KCS5zdDJ7ZmlsbDojQjJFMEYwO30KCS5zdDN7Zmlsb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zLTEwLDI5NC40LDYyLjhDNDQ4LjksNzA3LjMsNjU5LjksNzM4LjUsNzk5LjgsNjY3LjF6Ii8+Cgk8L2c+CjwvZz4KPGcgaWQ9IkxheWVyXzRfMV8iPgoJPGcgaWQ9IkxheWVyXzJfMV8iPgoJCTxwYXRoIGNsYXNzPSJzdDMiIGQ9Ik03OTkuOC0wLjNWOTRjLTkzLTM0LjEtMjI4LjEtMzEuNC0zNjcuOCw2MC41Yy0xNDQuMyw5NS0zNDUuNCwxMjUuOS00MzIuMiw4NS4zVi0wLjNINzk5Ljh6Ii8+Cgk8L2c+CjwvZz4KPC9zdmc+Cg==)'},
      {startAt: 10, type: 'color', dims: {ht: 800, wd: 800}, url: '#0000ff'},
      {startAt: 15, type: 'img', dims: {ht: 800, wd: 800}, url: 'url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDgwMCA4MDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDgwMCA4MDA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojQjBEMjY0O30KCS5zdDF7ZmlsbDojODBCRDI3O30KCS5zdDJ7ZmlsbDojMjM4NTMzO30KCS5zdDN7ZmlsbDojMTc1ODI5O30KPC9zdHlsZT4KPGcgaWQ9IkxheWVyXzEiPg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uMi0xOC42LDY4LjItMjMsMTEzLjUtMy4zYzMwLjIsMTQuMyw1NiwzNC41LDc3LjcsNTguN2gxMzEuMgoJCQljLTMyLjQtMjguMS02Ny44LTUyLjItMTA3LjMtNzBjLTEwNy4zLTUwLjgtMjI1LjgtMzMuOS0zMjEuNywxNi45Yy0zMS45LDE4LjYtNjUuNywzNi45LTEwMC43LDUzTDI4OC44LDgwMEwyODguOCw4MDB6Ii8+CgkJPHBhdGggY2xhc3M9InN0MyIgZD0iTTgwMCwwaC0xOS40QzcyMSwxNi44LDY2MC41LDMzLjgsNTk4LjEsNDkuOUM0NTEuNSw4Ny42LDI5My44LDc1LjksMTM2LDBIMTcuMwoJCQlDMjEzLjksOTQuMSw0MTksMTI0LjIsNTk4LjYsNzguOEM2NjguOSw2MSw3MzUuNCw0MC41LDgwMCwxOS41VjB6Ii8+CgkJPHBhdGggY2xhc3M9InN0MyIgZD0iTTY1Ny43LDMzNS43Yy04Mi4yLDEuNi0xNzUsMTguMi0zMDIuMSw0MC43Yy04NC40LDE0LjEtMTcyLjEsMzMuMy0yNjAuOCwyNS41QzYzLjMsMzk5LjEsMzEuNiwzOTAsMCwzNzguNQoJCQl2MzMuMWMzNC4yLDUuOCw2OC40LDEwLDEwMi4xLDkuM2M5MC4yLTEuNywxNzcuNC0yMC42LDI1NS44LTMyLjVjMTYwLjctMjQuMiwyNTctMzkuMSwzMzEuOS0yMS4xYzQwLjcsOS44LDc1LDMwLjUsMTEwLjEsNTEuNQoJCQl2LTYyLjdDNzUyLjksMzQ1LjQsNzA3LjEsMzM0LjgsNjU3LjcsMzM1Ljd6Ii8+Cgk8L2c+CjwvZz4KPC9zdmc+Cg==)'},
      {startAt: 20, type: 'color', dims: {ht: 800, wd: 800}, url: 'rgba(0,255,255,0.6)'},
      {startAt: 25, type: 'img', dims: {ht: 800, wd: 800}, url: 'url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtL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iIHBvaW50cz0iMTkyLjUsNzg1LjMgMTk2LDgwMCAyMDEsODAwIAkJIi8+CgkJPHBvbHlnb24gY2xhc3M9InN0MSIgcG9pbnRzPSIyNTkuNiw3NTkuOCAyNzIuNSw4MDAgMzU4LDgwMCAJCSIvPgoJPC9nPgo8L2c+Cjwvc3ZnPgo=)'},
      {startAt: 30, type: 'color', dims: {ht: 800, wd: 800}, url: '#ffff00'},
      {startAt: 35, type: 'color', dims: {ht: 800, wd: 800}, url: 'rgb(255,0,0)'}
    ],
    words = ['TEST','ONE','TWO','THREE'],
    curr = 0,
    masterTL = new TimelineMax({paused: true}),
    bgTL = new TimelineMax(),
    testTL = new TimelineMax({
      repeat: 12,
      onRepeat: function(){
        curr++;
        curr = words[curr] === undefined ? 0 : curr;
        $('#text-group tspan').html(words[curr]);
      }
    }),
    trans,
    bgBlend,
    fadeBgAtEnd = true,
    bgTLAdded = false;

function setTestAnimation() {
  TweenMax.set('#text-group text',{transformOrigin: 'center center'});
  testTL.fromTo('#text-group text',2,{scale: 0.1},{scale: 1.2, ease: Elastic.easeOut},0);
  masterTL.add(testTL,0);
}

setTestAnimation();

function transitionTime() {
  return `${parseFloat($('#trans-time').val())}s`;
}

function blendMode() {
  return $('#background-blend-mode').val();
}

function convertColors() {
    for ( let bg of bgArr ) {
    if( bg.type == 'color') {
      var canvas = document.createElement("canvas");
      canvas.width = bg.dims.wd;
      canvas.height = bg.dims.ht;
      var ctx = canvas.getContext("2d");
      ctx.fillStyle = bg.url;
      ctx.fillRect(0, 0, bg.dims.wd, bg.dims.ht);
      var dURL = canvas.toDataURL("image/png");
      bg.url = `url(${dURL})`;
      bg.type = 'image';
      URL.revokeObjectURL(dURL);
    }
  }
}

function setBgInsertPoints() {
  bgTL.kill().clear();
  TweenMax.set("#stage-master",{backgroundImage: 'none'});
  trans = transitionTime();
  bgBlend = blendMode();
  bgTL.set("#stage-master",{transition: trans, backgroundBlendMode: bgBlend},0);
  for( let bg of bgArr ) {
    bgTL.set("#stage-master",{backgroundColor: 'transparent', backgroundImage: bg.url},bg.startAt);
  }
  if(bgTLAdded) {
    masterTL.remove(bgTL);
  }
  masterTL.add(bgTL,0);
  bgTLAdded = true;
}

function processBackgrounds() {
  var dfd = $.Deferred();
  dfd
    .then( convertColors )
    .then( setBgInsertPoints )
    .done( function(){
      console.log('finished processing backgrounds. ready to play!');
      play();
    })
  dfd.resolve();
}

function play() {
  masterTL.play();
}
$('button#play').on("mousedown touchstart", function(){
  processBackgrounds();
});

function pause() {
  masterTL.pause();
}
$('button#pause').on("mousedown touchstart", function(){
  pause();
});

function reverse() {
  masterTL.reverse();
}
$('button#reverse').on("mousedown touchstart", function(){
  reverse();
});

function rewind() {
  curr = 0;
  $('#text-group tspan').html(words[curr]);
  masterTL.seek(0).pause();
}
$('button#rewind').on("mousedown touchstart", function(){
  rewind();
});




              
            
!
999px

Console