cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

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.

            
              <div class="container">
<svg version="1.1"
   xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
   x="0px" y="0px" width="300px" height="250px" viewBox="0 0 300 250" enable-background="new 0 0 300 250" xml:space="preserve">

<defs>
</defs>
<rect class="bg" fill="#3d3d3d" width="300" height="250"/>
<rect class="yellowBox" fill="#0CFFB1" width="800" height="800"/>
<rect class="greyBox" fill="#3d3d3d" width="800" height="800"/>
 
<rect class="yellowLine" fill="#0CFFB1" y="180" width="300" height="4"/>
  <text class="h1 t0 strap" x="0" y="0">Relax...</text>
  <text class="h1 t1 strap" x="0" y="0"><tspan dy="0">SVG ads</tspan><tspan dx="-148" dy="50">have arrived...</tspan></text>
  <text class="h1 t2 strap" x="0" y="0">Small,</text>
  <text class="h1 t3 strap" x="0" y="0">scalable</text>
  <text class="h1 t4 strap" x="0" y="0">&amp;</text>
  <text class="h1 t5 strap" x="0" y="0">dynamic...</text>
  <text class="h1 t6 strap" x="0" y="0">Retina-ready,</text>
 <text class="h1 t6a strap" x="0" y="0">portable,</text>  
  
  <text class="h1 t7 strap" x="0" y="0"><tspan>flexible</tspan><tspan dx="-130" dy="50">&amp; sweet!</tspan></text>  
   <text class="h3 t8 strap" x="0" y="0">codepen.io/chrisgannon</text>
  
<g class="logoGroup">
  
    <rect x="94.8" y="126" fill="none" stroke="#EDEDED" stroke-width="1.8303" stroke-linejoin="round" stroke-miterlimit="10" width="2.7" height="15.7"/>
  
    <rect x="188.3" y="126" fill="none" stroke="#EDEDED" stroke-width="1.8303" stroke-linejoin="round" stroke-miterlimit="10" width="2.7" height="15.7"/>
  <g>
    <path fill="#EDEDED" stroke="#EDEDED" stroke-miterlimit="10" d="M179.4,145c-0.8,3-1.8,5.7-3,8c-8.5,15.9-27,17.3-33.3,17.3
      c-6.3,0-25.1-1.7-33.5-17.9c-1.2-2.4-2.2-5.1-3-8.1c-0.5-2.2-0.9-4.5-1-7.1v10.1c0,0,2.1,30.7,37.5,30.7s37.5-31.1,37.5-31.1v-9.2
      C180.3,140.3,179.9,142.8,179.4,145z"/>
    <path fill="#EDEDED" stroke="#EDEDED" stroke-miterlimit="10" d="M142.7,99.3c0,0,35-0.8,37.8,29.9V115c0,0-8.2-24.7-37.7-24.7
      c-29.5,0-37.3,24.7-37.3,24.7v14.3C107.9,99,138.3,99.3,142.7,99.3z"/>
  </g>
  <g>
    <path fill="#EDEDED" d="M142.7,75.4c0-9.2-4.8-14-14-14c9.2,0,14-4.8,14-14c0,9.2,4.8,14,14,14C147.5,61.4,142.7,66.2,142.7,75.4z
      "/>
  </g>
  <g>
    <path fill="#EDEDED" d="M89.9,102.8c0-6.6-3.4-10.1-10.1-10.1c6.6,0,10.1-3.4,10.1-10.1c0,6.6,3.4,10.1,10.1,10.1
      C93.4,92.7,89.9,96.2,89.9,102.8z"/>
  </g>
  <g>
    <path fill="#EDEDED" d="M195.5,102.8c0-6.6-3.4-10.1-10.1-10.1c6.6,0,10.1-3.4,10.1-10.1c0,6.6,3.4,10.1,10.1,10.1
      C199,92.7,195.5,96.2,195.5,102.8z"/>
  </g>
  <circle fill="#EDEDED" cx="114.6" cy="75.7" r="3.7"/>
  <circle fill="#EDEDED" cx="174" cy="75.7" r="3.7"/>
  <path fill="none" stroke="#EDEDED" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" d="M105.5,151v12.9
    c0,0,9.6,23.2,37.5,23.2s37.5-23.6,37.5-23.6V151"/>
  <polygon fill="none" stroke="#EDEDED" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" points="180.5,151.7 
    180.5,151.7 180.5,151.7 187.5,144.6 187.5,122.9 180.5,115   "/>
  <polygon fill="none" stroke="#EDEDED" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" points="105.5,115 
    97.5,121 97.5,143.8 105.5,151.7 105.5,151.7 105.5,151.7   "/>
  <g>
    <g>
      
        <line fill="none" stroke="#EDEDED" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x1="184" y1="119" x2="184" y2="120"/>
      
        <line fill="none" stroke="#EDEDED" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="2,5" x1="184" y1="125" x2="184" y2="144"/>
      
        <line fill="none" stroke="#EDEDED" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x1="184" y1="146" x2="184" y2="147"/>
    </g>
  </g>
  <g>
    <g>
      
        <line fill="none" stroke="#EDEDED" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x1="101" y1="119" x2="101" y2="120"/>
      
        <line fill="none" stroke="#EDEDED" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="2,5" x1="101" y1="125" x2="101" y2="144"/>
      
        <line fill="none" stroke="#EDEDED" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x1="101" y1="147" x2="101" y2="148"/>
    </g>
  </g>
  <path opacity="0.35" fill="#FFFFFF" d="M176.3,153c-8.5,15.9-27,17.3-33.3,17.3c-6.3,0-25.1-1.7-33.5-17.9
    c14-4.7,29.4-4.6,33.1-4.6C142.6,147.8,160.3,147.5,176.3,153z"/>
  <path fill="#FFFFFF" d="M128.4,123.9c-2.1,5.1-6.6,7.6-9.6,4.9c-3-2.6-3.5-7.8-1.4-10.8c2.1-3.1,6.6-4.6,9.6-3.9
    C129.9,114.7,130.5,118.8,128.4,123.9z"/>
</g>
<a class="clickTag"  xlink:href="https://codepen.io/chrisgannon/blog/my-first-svg-banner-ad" target="blank"><rect width="300" height="250" fill="rgba(0,0,0,0)"><title class="clickTitle">Chris Gannon's First SVG Banner Ad</title></rect> </a>
</svg>
 

  </div>
            
          
!
            
              body{
  background-color:#FFF;

  
}
body, html {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}
.container{
  width:300px;
  height:250px;
}
svg{
  position:absolute;
  width:300px;
  overflow:hidden;
  visibility:hidden;
}
.strap{
  position:absolute;
  font-family: "cronos-pro"; 
}
h1, .h1{
  font-weight:bold;
  font-size:44px;
  padding:0;
  margin:0;
  letter-spacing:0px;
  }
h3, .h3, a{
  font-weight:100;
  font-size:18px;
  padding:0;
  margin:0;
  fill:#FFF;
  letter-spacing:0.5px;
  }

.t0, .t2, .t3, .t4, .t5{
  fill:#0CFFB1;
}
.t1, .t6, .t6a, .t7{
  fill:#3d3d3d;
} 
            
          
!
            
              
  var slideDelay = 3.2, select = function(s) {
        return document.querySelector(s);
      }, selectAll = function(s) {
        return document.querySelectorAll(s);
      }, xLink = "http://www.w3.org/1999/xlink", xmlns = "http://www.w3.org/2000/svg", container = select('.container'), t0 = select('.t0'), t1 = select('.t1'), t2 = select('.t2'), t3 = select('.t3'), t4 = select('.t4'), t5 = select('.t5'), t6 = select('.t6'),t6a = select('.t6a'), t7 = select('.t7'), t8 = select('.t8'), greyBox = select('.greyBox'), yellowBox = select('.yellowBox'), logoGroup = select('.logoGroup'), yellowLine = select('.yellowLine'), clickTag = select('.clickTag'), clickTitle = select('.clickTitle');

 TweenMax.set(container, {
  position:'absolute',
  left:'50%',
  top:'50%',
  xPercent:-50,
  yPercent:-50
})

  var tl = new TimelineMax({repeat:-1, delay:3});
  tl.set([yellowBox, greyBox],{
    x:320,
    y:0,
    rotation:45,
    transformOrigin:'50% 50%',
    alpha:1
  })
  .set(logoGroup, {
    alpha:0,
    scale:0.9,
    transformOrigin:'50% 50%'
  })
  .set(yellowLine, {
    x:300
  })
  .set([t0],{
    attr:{
      x:60,
      y:140
    },
    alpha:0
  })
  .set([ t1],{
    attr:{
      x:20,
      y:120
    },
    alpha:0
  })
  .set([t2, t3],{
    attr:{
      x:20,
      y:140
    },
    alpha:0
  })

  .set([t4],{
    attr:{
      x:170,
      y:140
    },
    alpha:0
  })
  .set([t5],{
    attr:{
      x:20,
      y:190
    },
    alpha:0
  })
  .set([t6],{
    attr:{
      x:20,
      y:110
    },
    alpha:0
  })
  .set([t6a],{
    attr:{
      x:20,
      y:160
    },
    alpha:0
  })
  .set([t7],{
    attr:{
      x:20,
      y:160
    },
    alpha:0
  })
  .set([t8],{
    attr:{
      x:25,
      y:200
    },
    alpha:0
  })

  //END SETUP

  .to(t0, 3, {
    attr:{
      x:20
    },
    alpha:1,
    ease:Power4.easeOut
  })
  .to(yellowBox, 2, {
    x:-250,
    ease:Power4.easeInOut
  })
  .to(t0, 1, {
    attr:{
      x:'-=10'
    },
    ease:Power2.easeIn,
    alpha:0
  },'-=2')
  .to(t1, 1, {
    alpha:1,
    ease:Power4.easeOut
  }, '-=1')

  .to(greyBox, 2, {
    x:-250,
    delay:slideDelay,
    ease:Power4.easeInOut
  })

  .to(t1, 1, {
    attr:{
      x:'-=10'
    },
    ease:Power2.easeIn,
    alpha:0
  },'-=2')
  .set([yellowBox, greyBox], {
    x:320
  })
  .to(t2, 1, {
    alpha:1,
    ease:Power4.easeOut
  }, '-=1')
  .to(t2, 1,{
    attr:{
      y:'-=50'
    },
    ease:Power1.easeInOut
  })
  .to(t3, 0.5,{
    alpha:1,
    ease:Power2.easeInOut
  },'-=0.5')
  .to([t4], 1,{
    alpha:1,
    ease:Power2.easeIn
  })
  .to([t5], 1,{
    alpha:1,
    ease:Power2.easeIn
  })

  .to(yellowBox, 2,{
    x:-250,
    delay:slideDelay,
    ease:Power3.easeInOut
  })
  .staggerTo([t2,t3, t4, t5], 1,{
    attr:{
      x:'-=20'
    },
    ease:Power2.easeIn,
    alpha:0
  },0.051, '-=2')
  .staggerTo([t6, t6a], 1, {
    alpha:1,
    ease:Power2.easeOut
  },1, '-=1')

  //empployment management goes UP
  .staggerTo([t6, t6a], 1, {
    attr:{
      y:'-=60'
    },
    delay:slideDelay/2,
    ease:Power2.easeInOut
  },0.05)
  .to(t7, 1, {
    alpha:1,
    ease:Power2.easeIn
  },'-=1')
  .to(greyBox, 2,{
    x:-250,
    delay:slideDelay,
    ease:Power3.easeInOut
  })
  .staggerTo([t6, t6a,t7], 1,{
    attr:{
      x:'-=20'
    },
    alpha:0,
    ease:Power2.easeIn
  },0.2, '-=2')
  .to(logoGroup, 1, {
    scale:1,
    alpha:1
  },'-=1')

  //yellow line comes in

  .to(logoGroup, 2, {
    scale:0.8,
    x:-80,
    y:-10,
    delay:slideDelay,
    ease:Back.easeInOut.config(0.4)
  })

  .to(yellowLine, 1, {
    x:25,
    ease:Power2.easeInOut
  },'-=1')
  .to(t8, 0.6, {
    attr:{
      y:210
    },
    alpha:1  
  },'-=0.2')

  //Yellow line goes out
  .to(yellowLine, 1, {
    x:-300,
    delay:slideDelay,
    ease:Power2.easeInOut
  })
  .to(logoGroup, 1, {
    alpha:0
  },'-=1')
  .to(t8, 1, {
    autoAlpha:0  
  },'-=1')

  tl.timeScale(1.5);

  TweenMax.set('svg', {
    visibility:'visible'
  })  
            
          
!
999px
Loading ..................

Console