css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <body id="codepen">
<p>The sf-timeline (below) is wrapped in a section element.</p>
<p>Each block of content is contained in a sf-timeline-item div.</p>
<p>The image/icon and the text content are then separated into two divs sf-timeline-img and sf-timeline-content.</p>
<p>A ::before selector is used in absolute position to create the vertical line. each image/icon is in absolute position too. </p>
<p>&nbsp</p>
<p>&nbsp</p>
<p>&nbsp</p>
<section class="sf-timeline">
    <div class="container">

		<div class="sf-timeline-item">
			<div class="sf-timeline-img">
			</div> <!-- cd-timeline-img -->

			<div class="sf-timeline-content">
				<h2>Title of section 2</h2>
				<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto, optio, dolorum provident rerum aut hic quasi placeat iure tempora laudantium ipsa ad debitis unde?</p>
				<a href="#0" class="sf-read-more">Read more</a>
				<span class="sf-date">Jan 18</span>
			</div> <!-- cd-timeline-content -->
		</div> <!-- cd-timeline-block -->
      
      
      
      <!--- TIMELINE ITEM -!-->
      <div class="sf-timeline-item">
                <div class="sf-timeline-img"></div>
        <div class="sf-timeline-content js--fadeInLeft" data-sr-id="1" style="; visibility: visible;  -webkit-transform: translateX(0) scale(1); opacity: 1;transform: translateX(0) scale(1); opacity: 1;-webkit-transition: -webkit-transform 0.8s ease-in-out 0s, opacity 0.8s ease-in-out 0s; transition: transform 0.8s ease-in-out 0s, opacity 0.8s ease-in-out 0s; ">
          <h2>Collect your results</h2>
            <div class="sf-timeline-title">STEP 1</div>
          <p>Collect your GCSE results from your school.</p>
        </div>
      </div>
        <!--- END OF TIMELINE ITEM -!-->
        <!--- TIMELINE ITEM -!-->
      <div class="sf-timeline-item">
                <div class="sf-timeline-img"></div>
        <div class="sf-timeline-content sf-timeline-card js--fadeInRight" data-sr-id="4" style="; visibility: visible;  -webkit-transform: translateX(0) scale(1); opacity: 1;transform: translateX(0) scale(1); opacity: 1;-webkit-transition: -webkit-transform 0.8s ease-in-out 0s, opacity 0.8s ease-in-out 0s; transition: transform 0.8s ease-in-out 0s, opacity 0.8s ease-in-out 0s; ">
            <h2>Review your results</h2>
            <div class="sf-timeline-title">Step 2</div>
          <p>Now you know your results, check you have achieved a minimum of 6 full passes at Grade C or higher.</p>
        </div>
      </div>
        <!--- END OF TIMELINE ITEM -!-->
        <!--- TIMELINE ITEM -!-->
      <div class="sf-timeline-item">
                <div class="sf-timeline-img"></div>
        <div class="sf-timeline-content sf-timeline-card js--fadeInLeft" data-sr-id="2" style="; visibility: visible;  -webkit-transform: translateX(0) scale(1); opacity: 1;transform: translateX(0) scale(1); opacity: 1;-webkit-transition: -webkit-transform 0.8s ease-in-out 0s, opacity 0.8s ease-in-out 0s; transition: transform 0.8s ease-in-out 0s, opacity 0.8s ease-in-out 0s; ">
            <h2>Attend a school interview</h2>
            <div class="sf-timeline-title">Step 3</div>
          <p>At the interview, we'll be able to .....</p>
        </div>
      </div>
        <!--- END OF TIMELINE ITEM -!-->
        <!--- TIMELINE ITEM -!-->
      <div class="sf-timeline-item">
                <div class="sf-timeline-img"></div>
        <div class="sf-timeline-content sf-timeline-card js--fadeInRight" data-sr-id="5" style="; visibility: visible;  -webkit-transform: translateX(0) scale(1); opacity: 1;transform: translateX(0) scale(1); opacity: 1;-webkit-transition: -webkit-transform 0.8s ease-in-out 0s, opacity 0.8s ease-in-out 0s; transition: transform 0.8s ease-in-out 0s, opacity 0.8s ease-in-out 0s; ">
            <h2>Read the Sixth Form Subject Choice Booklet</h2>
            <div class="sf-timeline-title">Step 4</div>
          <p>The booklet provides full details...</p>
        </div>
      </div>
        <!--- END OF TIMELINE ITEM -!-->
      <div class="sf-timeline-item">
                <div class="sf-timeline-img"></div>
        <div class="sf-timeline-content sf-timeline-card js--fadeInLeft" data-sr-id="3" style="; visibility: visible;  -webkit-transform: translateX(0) scale(1); opacity: 1;transform: translateX(0) scale(1); opacity: 1;-webkit-transition: -webkit-transform 0.8s ease-in-out 0s, opacity 0.8s ease-in-out 0s; transition: transform 0.8s ease-in-out 0s, opacity 0.8s ease-in-out 0s; ">
            <h2>That's It!</h2>
            <div class="sf-timeline-title">Congratulations!</div>
          <p>It's that easy. We'll do all the heavy lifting and in no time you'll be enjoying your fresh new interior, flooring, or window treatment in your beautifully designed Koeber's Interiors Home!</p>
        </div>
      </div>
    </div>
  </section>
  
</body>
            
          
!
            
              #codepen {
  margin-left: 200px;
  margin-right: 200px;
}


@timeline-line-bg-color: #ad0000;
@timeline-image-bg-color: #000;
@timeline-title-bg-color: #ad0000;
@timeline-title-color: #fff;
@timeline-content-bg-color: #eee;

/* vertical timeline */
.sf-timeline:before {
    background: @timeline-line-bg-color;
    content: '';
    width: 5px;
    height: 100%;
    position: absolute;
    left: 50%;
    transform: translatex(-50%);
}
/* arrow from content to timeline */
.sf-timeline-content::after {
    content: '';
    position: absolute;
    border-style: solid;
    width: 0;
    height: 0;
    top: 70px;
    right: -15px;
    border-width: 10px 0 10px 15px;
    border-color: transparent transparent transparent @timeline-content-bg-color;
}

.sf-timeline-item {
    width: 100%;
    margin-bottom: 40px;
}
.sf-timeline-item::after {
    content: '';
    display: block;
    clear: both;
}
/* grey timeline content box */
.sf-timeline-content {
    background: @timeline-content-bg-color;
    position: relative;
    width: 45%;
    box-sizing: border-box !important;
    padding: 80px 40px 40px 40px !important;
    border-radius: 2px;
}

/* black dots on timeline */
.sf-timeline-img {
    background: @timeline-image-bg-color;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    margin-top: 65px;
    margin-left: -15px;
}
.sf-timeline-title {
    background: @timeline-title-bg-color;
    color: @timeline-title-color;
    display: inline-block;
    padding: 20px 40px;
    font-size: 20px;
    position: absolute;
    top: 0;
    width: 100%;
    box-sizing: border-box !important;
    right: 0;
}

/* Place even steps on the right of timeline */
.sf-timeline-item:nth-child(even) .sf-timeline-content {
    float: right;
}
/* arrow from content to timeline should point left for even steps */
.sf-timeline-item:nth-child(even) .sf-timeline-content::after {
    content: '';
    position: absolute;
    border-style: solid;
    width: 0;
    height: 0;
    top: 70px;
    left: -15px;
    border-width: 10px 15px 10px 0;
    border-color: transparent @timeline-content-bg-color transparent transparent;
}

.sf-timeline-item:nth-child(even) .sf-timeline-content .sf-timeline-title {
    right: auto;
    left: 0;
}
            
          
!
            
              jQuery(document).ready(function($){
	var $timeline_block = $('.sf-timeline-item');

	//hide timeline blocks which are outside the viewport
	$timeline_block.each(function(){
		if($(this).offset().top > $(window).scrollTop()+$(window).height()*0.75) {
			$(this).find('.sf-timeline-img, .sf-timeline-content').addClass('is-hidden');
		}
	});

	//on scolling, show/animate timeline blocks when enter the viewport
	$(window).on('scroll', function(){
		$timeline_block.each(function(){
			if( $(this).offset().top <= $(window).scrollTop()+$(window).height()*0.75 && $(this).find('.sf-timeline-img').hasClass('is-hidden') ) {
				$(this).find('.sf-timeline-img, .sf-timeline-content').removeClass('is-hidden').addClass('bounce-in');
			}
		});
	});
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console