Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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 lang="en">

<head>
  <meta charset="UTF-8" />
  <title>An Animated Timeline</title>
  <meta name="viewport" content="width=device-width">
</head>

<body>
  <header>
    <div class="poster">
      <h1 class="poster__heading">The North Pole 2015 
          <span class="poster__subheading">The Ultimate Artic Adventure</span>
         <a href="#" class="btn--primary">Book Request</a>
      </div>
    </div>
  </header>
  <main class="timeline-wrapper">
    <div class="svg-timeline">
      <svg width="8px" height="1490.7px" viewBox="0 0 8 1490.7">
        <line id="timeline" fill="none" stroke="#FFFFFF" stroke-width="8" stroke-miterlimit="10" x1="4" y1="0" x2="4" y2="1490.7"/>
      </svg>
    </div>
    <ol class="timeline clearfix">
      <li class="timeline__item">
        <h3 class="timeline__day">Day 1: <span>Helsinki, Finland</span></h3>
        <p class="timeline__day-sum">Your adventure begins with a one-night stay in Helsinki, Finland's capital.</p>
        <a href="#" class="btn--comments">19 Comments</a>
      </li>
      <li class="timeline__item right">
        <h3 class="timeline__day dayTwo">Day 2: <span>Embarkation Day in Murmansk</span></h3>
        <p class="timeline__day-sum">From Helsinki, your charter flight will take you to Murmansk, Russia, where you'll embark on your voyage to the North Pole and get acquainted with 50 Years of Victory, the world's largest and most powerful icebreaker.</p>
        <a href="#" class="btn--comments">35 Comments</a>
      </li>
      <li class="timeline__item">
        <h3 class="timeline__day dayThree">Day 3-6: <span>Northbound in the Arctic Ocean</span></h3>
        <p class="timeline__day-sum">Watching the ship crush through the Arctic ice pack is a sight you'll never forget, made even more memorable by taking a helicopter flight for a thrilling aerial view of the ship and expansive Arctic Ocean.</p>
        <p class="timeline__day-sum">You can expect days, and hours,to present variable sailing conditions this far north. The crossing from Murmansk to the North Pole can take us anywhere from 5-8 days. This means you'll have plenty of time to get to know your shipmates, stare out at the horizon, grab some drinks at the bar or do some laps in our indoor pool.</p>
        <a href="#" class="btn--comments">72 Comments</a>
      </li>
      <li class="timeline__item right">
        <h3 class="timeline__day dayFour">Day 7: <span>90&deg; North</span></h3>
        <p class="timeline__day-sum">All of the anticipation of the past few days reaches a climax as you reach the North Pole! Many travelers find themselves overcome with emotion, while others are in a festive mood. Take photos, wave a flag, enjoy your moment! Later, everyone enjoys a champagne toast and a BBQ on the ice. Add an exclamation to your success by rising high in one of our hot air balloons to commemerate this great moment.</p>
        <a href="#" class="btn--comments">132 Comments</a>
      </li>
      <li class="timeline__item">
        <h3 class="timeline__day dayFive">Day 8: <span>Southbound in the Arctic Ocean</span></h3>
        <p class="timeline__day-sum">Now you can sit back and relax, everything from here on out is a bonus! Expect more great memories as you head south, you may get lucky and spot a Polar Bear hunting a Seal.</p>
        <a href="#" class="btn--comments">2 Comments</a>
      </li>
      <li class="timeline__item right">
        <h3 class="timeline__day daySix">Day 9-10: <span>Franz Josef Land</span></h3>
        <p class="timeline__day-sum">Now you can sit back and relax, everything from here on out is a bonus! Expect more great memories as you head south, you may get lucky and spot a Polar Bear hunting a Seal.</p>
        <a href="#" class="btn--comments">12 Comments</a>
      </li>
    </ol>
  </main>
</body>
</html>
              
            
!

CSS

              
                html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

.right {
  float:right;
}
/* ====== MIXINS ===== */
// BEM selectors mixin
// block__element
@mixin e($element) {
  &__#{$element} {
    @content;
  }
}

// block__element--modifier
@mixin m($modifier) {
  &--#{$modifier}{
    @content;
  }
}
// Media queries mixin
$sm: 31.25em; // 500px
$md: 50em; // 800px
$lg: 75em; // 1200px
@mixin mq($break) {
  @if $break=="sm" {
    @media screen and ( min-width: $sm) {
      @content;
    }
  }
  @else if $break=="md" {
    @media screen and ( min-width: $md) {
      @content;
    }
  }
  @else if $break=="lg" {
    @media screen and ( min-width: $lg) {
      @content;
    }
  }
  @else {
    @media screen and ( min-width: $break) {
      @content;
    }
  }
}

// Variables 
$font-family--primary: 'Open Sans';
$font-weight--light: 300;
$font-weight--norm: 400;
$font-weight--semi: 600;
$font-weight--bold: 700;
$font-weight--ultra: 900;
$orange: #FF9639;
// helpers
%center-text {
  text-align: center;
}

%center-align {
  margin: 0 auto;
}

html {
  font-family: $font-family--primary;
  font-size: 100%;
  @include mq(sm) {
    font-size: 105%;
  }
  @include mq(md) {
    font-size: 115%;
  }
  @include mq(lg) {
    font-size: 125%;
  }
}

// button styles
%btn {
  display: inline;
  text-decoration: none;
  padding: .45em 1.25em; 
  text-transform: uppercase;
  font-weight: $font-weight--norm;
  letter-spacing: 1px;
  font-size: .75rem;
  border-radius: 25px;
  color: white;
  font-family: $font-family--primary;
  transition: all 250ms ease;
}

.btn--primary {
  border: 1px solid white;
  @extend %btn;
    &:hover {
    background-color: white;
    color: black;
  }
}

.poster {
  height: 100vh;
  width: 100%;
  background-size: cover;
  background-position: center center;
  background-image: url("http://codepen.vincebrown.me/assets/images/snow-mountains.jpg");
  // .poster__heading
  @include e('heading') {
    @extend %center-text;
    @extend %center-align;
    width: 95%;
    color: white;
    padding-top: 5.5rem;
    font-weight: $font-weight--semi;
    font-size: 2em;
    transition: all 400ms ease;
    @include mq(sm) {
      font-size: 2.25em;
    }
    @include mq(md) {
      font-size: 2.75em;
    }
  }
  @include e('subheading') {
    @extend %center-text;
    display: block;
    font-size: .3em;
    letter-spacing: 5px;
    font-weight: $font-weight--norm;
    text-transform: uppercase;
    color: $orange;
    padding-top: .8em;
    margin-bottom: .6em;
  }
} // end .poster


// timeline
.btn--comments{
  @extend %btn;
  background-color: rgba(255,255,255,.4);
  border:none;
  font-size: .6em;
  &:hover {
    background-color: rgba(255,255,255,.6);
  }
}

.timeline-wrapper{
  position: relative;
   padding-bottom:25em;
  background: linear-gradient(#000 10%, #283048 60%, #55679a 70%, rgba(255,255,255,0));
  &:after{
    content:'';
    display:block;
    background-image: url('http://codepen.vincebrown.me/assets/images/white-mountains.jpg');
    height:500px;
    width: 100%;
    background-size:cover;
    position: absolute;
    background-position:25% center;
    z-index:-10;
    bottom:0;
  }
}
.svg-timeline {
  position: absolute;
  margin-left:50%;
  transform: translateX(-50%);
  display:none;
  @include mq(md) {
    display:block;
  }
}
.timeline {
  transition:all 250ms ease;
  width: 90%;
  margin: 0 auto;
  @include mq(sm) {
    width: 80%;
  }
  @include mq(md) {
    width: 95%;
  }
  @include e('item') {
    margin-bottom: 4em;
    clear:both;
    @include mq(md) {
      width: 40%;
    }
  }
  // .timeline__day
  @include e('day') {
    font-weight: $font-weight--semi;
    font-size: .9em;
    color:white;
    text-transform: uppercase;
    padding-bottom:.75em;
    span{
      font-weight: $font-weight--light;
      color:orange;
      text-transform: none;
    }
  }
  //.timeline__day-sum
  @include e('day-sum') {
    color:white;
    font-weight: $font-weight--light;
    font-size: .8em;
    display:block;
    margin-bottom:1.5em;
    line-height: 1.5;
    
  }
  
}







.clearfix:after {
     visibility: hidden;
     display: block;
     font-size: 0;
     content: " ";
     clear: both;
     height: 0;
     }
.clearfix { display: inline-block; }
/* start commented backslash hack \*/
* html .clearfix { height: 1%; }
.clearfix { display: block; }
/* close commented backslash hack */
              
            
!

JS

              
                var controller = new ScrollMagic.Controller();
TweenMax.set('#timeline',{visibility:0});

var tweenOne =
new TweenMax.fromTo('#timeline',1,{drawSVG:"0%"}, {drawSVG:"10%"});  
 
var scene1 = new ScrollMagic.Scene({
  triggerElement: '#timeline',
}).setTween(tweenOne).addTo(controller); 
    
var tweenTwo =
new TweenMax.fromTo('#timeline',1,{drawSVG:"10%"}, {drawSVG:"20%"});

var scene2 = new ScrollMagic.Scene({
  triggerElement: '.dayTwo',
}).setTween(tweenTwo).addTo(controller); 


var tweenThree =
new TweenMax.fromTo('#timeline',1,{drawSVG:"20%"}, {drawSVG:"40%"});

var scene3 = new ScrollMagic.Scene({
  triggerElement: '.dayThree',
}).setTween(tweenThree).addTo(controller); 


var tweenFour =
new TweenMax.fromTo('#timeline',1,{drawSVG:"40%"}, {drawSVG:"65%"});

var scene3 = new ScrollMagic.Scene({
  triggerElement: '.dayFour',
}).setTween(tweenFour).addTo(controller); 
 
var tweenFive =
new TweenMax.fromTo('#timeline',1,{drawSVG:"65%"}, {drawSVG:"85%"});

var scene3 = new ScrollMagic.Scene({
  triggerElement: '.dayFive',
}).setTween(tweenFive).addTo(controller); 

var tweenSix =
new TweenMax.fromTo('#timeline',1,{drawSVG:"85%"}, {drawSVG:"102%"});

var scene3 = new ScrollMagic.Scene({
  triggerElement: '.daySix',
}).setTween(tweenSix).addTo(controller); 
              
            
!
999px

Console