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

              
                <html>
  
<head>
  <meta charset="UTF-8">
  <meta name="ad.size" content="width=300,height=250">
  <title>300x250</title>
  <link href="https://fonts.googleapis.com/css?family=Lato:400,700,900" rel="stylesheet">
</head>

<body>
<div id="container">
  
  <div id="headerSection">
    <img id="logo" src="https://dl.dropboxusercontent.com/u/316858/CodePen%20SplitText%20Demo/logo.png" alt=""/>
    <div id="headerBlock">
      <div id="headerTxtMask">
        <div id="headerTxt">home renovators perth</div>
      </div>
      <div id="headerLine"></div>
    </div>
  </div>

  <div class="slide" id="slide1">
    <div class="picMask" id="picMask1">
      <img class="pic" id="pic1" src="https://dl.dropboxusercontent.com/u/316858/CodePen%20SplitText%20Demo/pic1.jpg" alt=""/>
    </div>
    <div class="labelTxt" id="beforeLabel">before</div>
  </div>

  <div class="slide" id="slide2-5">
    <div class="picMask" id="picMask2">
      <img class="pic" id="pic2" src="https://dl.dropboxusercontent.com/u/316858/CodePen%20SplitText%20Demo/pic2.jpg" alt=""/>
    </div>
    <div class="picMask" id="picMask3">
      <img class="pic" id="pic3" src="https://dl.dropboxusercontent.com/u/316858/CodePen%20SplitText%20Demo/pic3.jpg" alt=""/>
    </div>
    <div class="labelTxt" id="afterLabel">after</div>
  </div>

  <div id="footer">
    <div id="footerLine"></div>
    <div class="footerTxt" id="footerTxt2">Over 35 Years Experience</div>
    <div class="footerTxt" id="footerTxt3">3D Design Service Included</div>
    <div class="footerTxt" id="footerTxt4">Multi Award Winning Company</div>
    <div id="cta">online quote</div>
  </div>
  
  <div id="whiteBg"></div>
  
</div>
</body>
</html>
              
            
!

CSS

              
                    * {
      padding: 0;
      margin: 0;
      -webkit-font-smoothing: antialiased;
    }

    body {
      background-color: grey;
    }

    #container {
      position: absolute;
      width: 300px;
      height: 250px;
      background-color: white;
      overflow: hidden;
    }

    #logo {
      margin-left: 15px;
      height: 60px;
    }

    #headerBlock {
      float: right;
      margin: 15px 15px 0 0;
    }

    #headerBlock > * {
      display: inline-block;
      vertical-align: top;
    }

    #headerTxtMask {
      overflow: hidden;
    }

    #headerTxt {
      font-family: "Lato", sans-serif;
      font-size: 16px;
      line-height: 16px;
      font-weight: 900;
      text-align: right;
      text-transform: uppercase;
      width: 160px;
      color: #1A2A34;
    }

    #headerLine {
      width: 2px;
      height: 30px;
      margin-left: 2px;
      background-color: #FF8C25;
    }

    .slide {
      position: absolute;
      top: 60px;
      width: 300px;
      height: 190px;
      overflow: hidden;
    }

    .picMask {
      position: absolute;
      width: 300px;
      height: 190px;
      overflow: hidden;
    }

    .pic {
      position: absolute;
      width: 300px;
    }

    .labelTxt {
      position: absolute;
      right: 15px;
      font-family: "Lato", sans-serif;
      font-weight: 700;
      font-size: 13px;
      text-transform: uppercase;
      padding: 5px 7px;
      color: white;
    }

    #beforeLabel {
      background-color: #770D29;
    }

    #afterLabel {
      background-color: #FF8C25;
    }

    #footer {
      position: absolute;
      bottom: 0;
      height: 60px;
      width: 300px;
      background-color: #1A2A34;
    }

    #footerLine {
      height: 2px;
      background-color: #FF8C25;
    }

    .footerTxt {
      position: absolute;
      display: inline-block;
      width: 130px;
      margin: 8px 0 0 15px;
      font-family: "Lato", sans-serif;
      font-weight: 400;
      font-size: 16px;
      line-height: 18px;
      color: white;
    }

    #footerTxt3, #footerTxt4 {
      visibility: hidden;
    }

    #footerTxt3 {
      width: 120px;
    }

    #footerTxt4 {
      width: 140px;
    }

    #cta {
      position: relative;
      float: right;
      display: inline-block;
      box-sizing: border-box;
      padding: 5px 10px;
      margin: 15px 15px 0 0;
      font-family: "Lato", sans-serif;
      font-weight: 700;
      font-size: 13px;
      text-transform: uppercase;
      color: white;
      background-color: #770D29;
      border: 1px solid white;
    }

    #whiteBg {
      position: absolute;
      width: 300px;
      height: 250px;
      top: 0;
      left: 0;
      background-color: white;
      z-index: 1;
      visibility: hidden;
    }
              
            
!

JS

              
                    window.onload = function () {

      var master = new TimelineMax({repeat: -1});

      var

        logo = document.getElementById("logo"),

        picMask1 = document.getElementById("picMask1"),
        picMask2 = document.getElementById("picMask2"),
        picMask3 = document.getElementById("picMask3"),

        pic1 = document.getElementById("pic1"),
        pic2 = document.getElementById("pic2"),
        pic3 = document.getElementById("pic3"),

        beforeLabel = document.getElementById("beforeLabel"),
        afterLabel = document.getElementById("afterLabel"),

        headerLine = document.getElementById("headerLine"),
        footerLine = document.getElementById("footerLine"),

        headerTxt = document.getElementById("headerTxt"),
        headerTxtMask = document.getElementById("headerTxtMask"),


        footerTxt2 = document.getElementById("footerTxt2"),
        footerSplit2 = new SplitText(footerTxt2, {type: "lines, words, chars"}),

        footerTxt3 = document.getElementById("footerTxt3"),
        footerSplit3 = new SplitText(footerTxt3, {type: "lines, words, chars"}),

        footerTxt4 = document.getElementById("footerTxt4"),
        footerSplit4 = new SplitText(footerTxt4, {type: "lines, words, chars"}),

        cta = document.getElementById("cta"),

        whiteBg = document.getElementById("whiteBg")
        ;

      master
        .add("begin")
        .from(logo, 2, {autoAlpha: 0}, "begin")
        .from(headerLine, 1, {height: 0, ease: Power1.easeOut}, "begin")
        .from(headerTxtMask, 1, {height: 0, ease: Power1.easeOut}, "begin")
        .from(pic1, 2, {autoAlpha: 0, ease: Power1.easeOut}, "begin")
        .from(beforeLabel, 1, {y: -130, ease: Power3.easeOut}, "begin+=1")
        .from(footer, 2, {y: 62, ease: Power2.easeOut}, "+=2")
        .from(picMask2, 2.5, {y: -190, ease: Power1.easeOut}, "-=2")
        .from(pic2, 2.5, {y: 190, ease: Power1.easeOut}, "-=2.5")
        .from(afterLabel, 1, {y: -30, ease: Power1.easeOut}, "-=1")
        .add(footerSplitFunc2(), "-=2")
        .from(cta, 1.5, {y: 62, ease: Power2.easeOut}, "-=1.5")
        .set(footerTxt3, {visibility: "visible"})
        .to(footerTxt2, 1, {autoAlpha: 0, ease: Power2.easeIn}, "+=2")
        .add(footerSplitFunc3())
        .from(picMask3, 2, {x: 300, ease: Power1.easeOut}, "+=1")
        .from(pic3, 2, {x: -300, ease: Power1.easeOut}, "-=2")
        .to(footerTxt3, 1, {autoAlpha: 0, ease: Power2.easeIn}, "-=2")
        .set(footerTxt4, {visibility: "visible"}, "-=1")
        .add(footerSplitFunc4(), "-=0.5")
        .set(whiteBg, {visibility: "visible"})
        .from(whiteBg, 1, {autoAlpha: 0, ease: Power2.easeIn}, "+=2")
      ;

      function footerSplitFunc2() {
        var tl = new TimelineMax();
        tl.staggerFrom(footerSplit2.chars, 0.75, {transformOrigin: "50% 100%", autoAlpha: 0, scale: 0, x: 20, ease: Power1.easeOut}, 0.02);
        return tl;
      }

      function footerSplitFunc3() {
        var tl = new TimelineMax();
        tl.staggerFrom(footerSplit3.chars, 0.75, {transformOrigin: "50% 100%", autoAlpha: 0, scale: 0, x: 20, ease: Power1.easeOut}, 0.02);
        return tl;
      }

      function footerSplitFunc4() {
        var tl = new TimelineMax();
        tl.staggerFrom(footerSplit4.chars, 0.75, {transformOrigin: "50% 100%", autoAlpha: 0, scale: 0, x: 20, ease: Power1.easeOut}, 0.02);
        return tl;
      }
    }
              
            
!
999px

Console