Difference between revisions of "Team:Newcastle/Notebook/Diary"

Line 4: Line 4:
  
 
<html>
 
<html>
 +
jQuery(document).ready(function($){
 +
var $timeline_block = $('.cd-timeline-block');
 +
 +
//hide timeline blocks which are outside the viewport
 +
$timeline_block.each(function(){
 +
if($(this).offset().top > $(window).scrollTop()+$(window).height()*0.75) {
 +
$(this).find('.cd-timeline-img, .cd-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('.cd-timeline-img').hasClass('is-hidden') ) {
 +
$(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in');
 +
}
 +
});
 +
});
 +
});
 
<style>
 
<style>
@import url(//fonts.googleapis.com/css?family=Open+Sans);
+
@import "bourbon";
body {
+
 
    margin: 5px 20px;
+
// variables - colors
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iNiIgaGVpZ2h0PSI2Ij4KPHJlY3Qgd2lkdGg9IjYiIGhlaWdodD0iNiIgZmlsbD0iI2VlZWVlZSI+PC9yZWN0Pgo8ZyBpZD0iYyI+CjxyZWN0IHdpZHRoPSIzIiBoZWlnaHQ9IjMiIGZpbGw9IiNlNmU2ZTYiPjwvcmVjdD4KPHJlY3QgeT0iMSIgd2lkdGg9IjMiIGhlaWdodD0iMiIgZmlsbD0iI2Q4ZDhkOCI+PC9yZWN0Pgo8L2c+Cjx1c2UgeGxpbms6aHJlZj0iI2MiIHg9IjMiIHk9IjMiPjwvdXNlPgo8L3N2Zz4=");
+
 
    font-family: 'Open Sans';  
+
$main-text: #7f8c97; // main text
    font-weight: 300;  
+
$link: #acb7c0; // anchor tags
 +
$background: #e9f0f5; // body background color
 +
 
 +
$color-1: #303e49; // blue dark
 +
$color-2: #c03b44; // red
 +
$color-3: #ffffff; // white
 +
$color-4: #75ce66; // green
 +
$color-5: #f0ca45; // yellow
 +
 
 +
// variables - fonts
 +
 
 +
$primary-font: 'Droid Serif', serif;
 +
$secondary-font: 'Open Sans', sans-serif;
 +
 
 +
// mixins - rem fallback - credits: http://zerosixthree.se/
 +
 
 +
@function calculateRem($size) {
 +
  $remSize: $size / 16px;
 +
  @return $remSize * 1rem;
 
}
 
}
  
h2 {
+
@mixin font-size($size) {
    margin-bottom: 30px;
+
  font-size: $size;
    color: #4679bd;
+
  font-size: calculateRem($size);
    font-weight: 400;
+
    text-align: center;
+
 
}
 
}
  
p.footer {
+
// mixins - border radius
    margin-bottom: 20px;
+
 
    color: #999999;
+
@mixin border-radius($radius:.25em) {
    font-size: 18px;
+
  border-radius: $radius;
    text-align: center;
+
 
}
 
}
  
/* -----------------------------------------------
+
// layout - breakpoints
* Timeline
+
 
* --------------------------------------------- */
+
$S:    320px; 
.timeline {
+
$M:    768px;   
    list-style: none;
+
$L:    1170px;   
    padding: 10px 0;
+
 
    position: relative;
+
// layout - media queries
    font-weight: 300;
+
 
 +
@mixin MQ($canvas) {
 +
  @if $canvas == S {
 +
  @media only screen and (min-width: $S) { @content; }
 +
  }
 +
  @else if $canvas == M {
 +
  @media only screen and (min-width: $M) { @content; }
 +
  }
 +
  @else if $canvas == L {
 +
  @media only screen and (min-width: $L) { @content; }
 +
  }
 
}
 
}
.timeline:before {
+
 
    top: 0;
+
/* --------------------------------
    bottom: 0;
+
 
    position: absolute;
+
Primary style
    content:" ";
+
 
    width: 2px;
+
-------------------------------- */
    background: #ffffff;
+
 
    left: 50%;
+
html * {
    margin-left: -1.5px;
+
-webkit-font-smoothing: antialiased;
 +
-moz-osx-font-smoothing: grayscale;
 
}
 
}
.timeline > li {
+
 
    margin-bottom: 20px;
+
*, *:after, *:before {
    position: relative;
+
@include box-sizing(border-box);
    width: 50%;
+
    float: left;
+
    clear: left;
+
 
}
 
}
.timeline > li:before, .timeline > li:after {
+
 
    content:" ";
+
body {
    display: table;
+
font: {
 +
size: 100%;
 +
family: $primary-font;
 +
}
 +
color: $main-text;
 +
background-color: $background;
 
}
 
}
.timeline > li:after {
+
 
    clear: both;
+
a {
 +
color: $link;
 +
text-decoration: none;
 +
font-family: $secondary-font;
 
}
 
}
.timeline > li:before, .timeline > li:after {
+
 
    content:" ";
+
img {
    display: table;
+
max-width: 100%;
 
}
 
}
.timeline > li:after {
+
 
    clear: both;
+
h1, h2 {
 +
font-family: $secondary-font;
 +
font-weight: bold;
 
}
 
}
.timeline > li > .timeline-panel {
+
 
    width: calc(100% - 25px);
+
/* --------------------------------
    width: -moz-calc(100% - 25px);
+
 
    width: -webkit-calc(100% - 25px);
+
Modules - reusable parts of our design
    float: left;
+
 
    border: 1px solid #dcdcdc;
+
-------------------------------- */
    background: #ffffff;
+
 
    position: relative;
+
.cd-container { /* this class is used to give a max-width to the element it is applied to, and center it horizontally when it reaches that max-width */
 +
width: 90%;
 +
max-width: $L; // breakpoints inside partials > _layout.scss
 +
margin: 0 auto;
 +
 
 +
&::after { /* clearfix */
 +
content: '';
 +
display: table;
 +
clear: both;
 +
}
 
}
 
}
.timeline > li > .timeline-panel:before {
+
 
    position: absolute;
+
/* --------------------------------
    top: 26px;
+
 
    right: -15px;
+
Main components
    display: inline-block;
+
 
    border-top: 15px solid transparent;
+
-------------------------------- */
    border-left: 15px solid #dcdcdc;
+
 
    border-right: 0 solid #dcdcdc;
+
header {
    border-bottom: 15px solid transparent;
+
height: 200px;
    content:" ";
+
line-height: 200px;
 +
text-align: center;
 +
background: $color-1;
 +
 
 +
h1 {
 +
color: $color-3;
 +
@include font-size(18px);
 +
}
 +
 
 +
@include MQ(L) {
 +
height: 300px;
 +
line-height: 300px;
 +
 
 +
h1 {
 +
@include font-size(24px);
 +
}
 +
}
 
}
 
}
.timeline > li > .timeline-panel:after {
+
 
    position: absolute;
+
#cd-timeline {
    top: 27px;
+
position: relative;
    right: -14px;
+
padding: 2em 0;
    display: inline-block;
+
margin: {
    border-top: 14px solid transparent;
+
top: 2em;
    border-left: 14px solid #ffffff;
+
bottom: 2em;
    border-right: 0 solid #ffffff;
+
}
    border-bottom: 14px solid transparent;
+
 
    content:" ";
+
&::before {
 +
/* this is the vertical line */
 +
content: '';
 +
position: absolute;
 +
top: 0;
 +
left: 18px;
 +
height: 100%;
 +
width: 4px;
 +
background: darken($background, 5%);
 +
}
 +
 
 +
@include MQ(L) {
 +
margin: {
 +
top: 3em;
 +
bottom: 3em;
 +
}
 +
 
 +
&::before {
 +
left: 50%;
 +
margin-left: -2px;
 +
}
 +
}
 
}
 
}
.timeline > li > .timeline-badge {
+
 
    color: #ffffff;
+
.cd-timeline-block {
    width: 24px;
+
position: relative;
    height: 24px;
+
margin: 2em 0;
    line-height: 50px;
+
@include clearfix;
    text-align: center;
+
 
    position: absolute;
+
&:first-child {
    top: 16px;
+
margin-top: 0;
    right: -12px;
+
}
    z-index: 100;
+
 
 +
&:last-child {
 +
margin-bottom: 0;
 +
}
 +
 
 +
@include MQ(L) {
 +
margin: 4em 0;
 +
 
 +
&:first-child {
 +
margin-top: 0;
 +
}
 +
 
 +
&:last-child {
 +
margin-bottom: 0;
 +
}
 +
}
 
}
 
}
.timeline > li.timeline-inverted > .timeline-panel {
+
 
    float: right;
+
.cd-timeline-img {
 +
position: absolute;
 +
top: 0;
 +
left: 0;
 +
width: 40px;
 +
height: 40px;
 +
border-radius: 50%;
 +
box-shadow: 0 0 0 4px $color-3, inset 0 2px 0 rgba(#000, .08), 0 3px 0 4px rgba(#000, .05) ;
 +
 
 +
img {
 +
display: block;
 +
width: 24px;
 +
height: 24px;
 +
position: relative;
 +
left: 50%;
 +
top: 50%;
 +
margin-left: -12px;
 +
margin-top: -12px;
 +
}
 +
 
 +
&.cd-picture {
 +
background: $color-4;
 +
}
 +
 
 +
&.cd-movie {
 +
background: $color-2;
 +
}
 +
 
 +
&.cd-location {
 +
background: $color-5;
 +
}
 +
 
 +
@include MQ(L) {
 +
width: 60px;
 +
height: 60px;
 +
left: 50%;
 +
margin-left: -30px;
 +
 
 +
/* Force Hardware Acceleration in WebKit */
 +
-webkit-transform: translateZ(0);
 +
-webkit-backface-visibility: hidden;
 +
 
 +
.cssanimations &.is-hidden {
 +
visibility: hidden;
 +
}
 +
 
 +
.cssanimations &.bounce-in {
 +
visibility: visible;
 +
@include animation(cd-bounce-1 .6s);
 +
}
 +
}
 
}
 
}
.timeline > li.timeline-inverted > .timeline-panel:before {
+
 
    border-left-width: 0;
+
@include keyframes(cd-bounce-1) {
    border-right-width: 15px;
+
0% {
    left: -15px;
+
opacity: 0;
    right: auto;
+
@include transform(scale(.5));
 +
}
 +
 
 +
60% {
 +
opacity: 1;
 +
@include transform(scale(1.2));
 +
}
 +
 
 +
100% {
 +
@include transform(scale(1));
 +
}
 
}
 
}
.timeline > li.timeline-inverted > .timeline-panel:after {
+
 
    border-left-width: 0;
+
.cd-timeline-content {
    border-right-width: 14px;
+
position: relative;
    left: -14px;
+
margin-left: 60px;
    right: auto;
+
background: $color-3;
 +
@include border-radius;
 +
padding: 1em;
 +
box-shadow: 0 3px 0 darken($background, 5%);
 +
@include clearfix;
 +
 
 +
h2 {
 +
color: $color-1;
 +
}
 +
 
 +
p, .cd-read-more, .cd-date {
 +
@include font-size(13px);
 +
}
 +
 
 +
.cd-read-more, .cd-date {
 +
display: inline-block;
 +
}
 +
 
 +
p {
 +
margin: 1em 0;
 +
line-height: 1.6;
 +
}
 +
 
 +
.cd-read-more {
 +
float: right;
 +
padding: .8em 1em;
 +
background: $link;
 +
color: $color-3;
 +
@include border-radius;
 +
 
 +
.no-touch &:hover {
 +
background-color: lighten($link, 5%);
 +
}
 +
}
 +
 
 +
.cd-date {
 +
float: left;
 +
padding: .8em 0;
 +
opacity: .7;
 +
}
 +
 
 +
&::before {
 +
content: '';
 +
position: absolute;
 +
top: 16px;
 +
right: 100%;
 +
height: 0;
 +
width: 0;
 +
border: 7px solid transparent;
 +
border-right: 7px solid $color-3;
 +
}
 +
 
 +
@include MQ(M) {
 +
h2 {
 +
@include font-size(20px);
 +
}
 +
 
 +
p {
 +
@include font-size(16px);
 +
}
 +
 
 +
.cd-read-more, .cd-date {
 +
@include font-size(14px);
 +
}
 +
}
 +
 
 +
@include MQ(L) {
 +
margin-left: 0;
 +
padding: 1.6em;
 +
width: 45%;
 +
 
 +
&::before {
 +
top: 24px;
 +
left: 100%;
 +
border-color: transparent;
 +
border-left-color: $color-3;
 +
}
 +
 
 +
.cd-read-more {
 +
float: left;
 +
}
 +
 
 +
.cd-date {
 +
position: absolute;
 +
width: 100%;
 +
left: 122%;
 +
top: 6px;
 +
@include font-size(16px);
 +
}
 +
 
 +
.cd-timeline-block:nth-child(even) & {
 +
float: right;
 +
 
 +
&::before {
 +
top: 24px;
 +
left: auto;
 +
right: 100%;
 +
border-color: transparent;
 +
border-right-color: $color-3;
 +
}
 +
 
 +
.cd-read-more {
 +
float: right;
 +
}
 +
 
 +
.cd-date {
 +
left: auto;
 +
right: 122%;
 +
text-align: right;
 +
}
 +
}
 +
 
 +
.cssanimations &.is-hidden {
 +
visibility: hidden;
 +
}
 +
 
 +
.cssanimations &.bounce-in {
 +
visibility: visible;
 +
@include animation(cd-bounce-2 .6s);
 +
}
 +
}
 
}
 
}
.timeline-badge > a {
+
 
    color: #ffffff !important;
+
@include MQ(L) {
 +
/* inverse bounce effect on even content blocks */
 +
.cssanimations .cd-timeline-block:nth-child(even) .cd-timeline-content.bounce-in {
 +
@include animation(cd-bounce-2-inverse .6s);
 +
}
 
}
 
}
.timeline-badge a:hover {
+
 
    color: #dcdcdc !important;
+
@include keyframes(cd-bounce-2) {
 +
0% {
 +
opacity: 0;
 +
@include transform(translateX(-100px));
 +
}
 +
 
 +
60% {
 +
opacity: 1;
 +
@include transform(translateX(20px));
 +
}
 +
 
 +
100% {
 +
@include transform(translateX(0));
 +
}
 
}
 
}
.timeline-title {
+
 
    margin-top: 0;
+
@include keyframes(cd-bounce-2-inverse) {
    color: inherit;
+
0% {
 +
opacity: 0;
 +
@include transform(translateX(100px));
 +
}
 +
 
 +
60% {
 +
opacity: 1;
 +
@include transform(translateX(-20px));
 +
}
 +
 
 +
100% {
 +
@include transform(translateX(0));
 +
}
 
}
 
}
.timeline-heading h4 {
+
 
    font-weight: 400;
+
    padding: 0 15px;
+
    color: #4679bd;
+
}
+
.timeline-body > p, .timeline-body > ul {
+
    padding: 10px 15px;
+
    margin-bottom: 0;
+
}
+
.timeline-footer {
+
    padding: 5px 15px;
+
    background-color:#f4f4f4;
+
}
+
.timeline-footer p { margin-bottom: 0; }
+
.timeline-footer > a {
+
    cursor: pointer;
+
    text-decoration: none;
+
}
+
.timeline > li.timeline-inverted {
+
    float: right;
+
    clear: right;
+
}
+
.timeline > li:nth-child(2) {
+
    margin-top: 60px;
+
}
+
.timeline > li.timeline-inverted > .timeline-badge {
+
    left: -12px;
+
}
+
.no-float {
+
    float: none !important;
+
}
+
@media (max-width: 767px) {
+
    ul.timeline:before {
+
        left: 40px;
+
    }
+
    ul.timeline > li {
+
        margin-bottom: 0px;
+
        position: relative;
+
        width:100%;
+
        float: left;
+
        clear: left;
+
    }
+
    ul.timeline > li > .timeline-panel {
+
        width: calc(100% - 65px);
+
        width: -moz-calc(100% - 65px);
+
        width: -webkit-calc(100% - 65px);
+
    }
+
    ul.timeline > li > .timeline-badge {
+
        left: 28px;
+
        margin-left: 0;
+
        top: 16px;
+
    }
+
    ul.timeline > li > .timeline-panel {
+
        float: right;
+
    }
+
    ul.timeline > li > .timeline-panel:before {
+
        border-left-width: 0;
+
        border-right-width: 15px;
+
        left: -15px;
+
        right: auto;
+
    }
+
    ul.timeline > li > .timeline-panel:after {
+
        border-left-width: 0;
+
        border-right-width: 14px;
+
        left: -14px;
+
        right: auto;
+
    }
+
    .timeline > li.timeline-inverted {
+
        float: left;
+
        clear: left;
+
        margin-top: 30px;
+
        margin-bottom: 30px;
+
    }
+
    .timeline > li.timeline-inverted > .timeline-badge {
+
        left: 28px;
+
    }
+
}
+
.st { text-decoration: line-through; }
+
sup { margin-right: 0.5em; }
+
 
</style>
 
</style>
  
<h2>Super Simple Bootstrap Responsive Timeline</h2>
+
<body>
 +
<header>
 +
<h1>Responsive Vertical Timeline</h1>
 +
</header>
  
<ul class="timeline">
+
<section id="cd-timeline" class="cd-container">
    <li>
+
<div class="cd-timeline-block">
        <div class="timeline-badge">
+
<div class="cd-timeline-img cd-picture">
          <a><i class="fa fa-circle" id=""></i></a>
+
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/148866/cd-icon-picture.svg" alt="Picture">
        </div>
+
</div> <!-- cd-timeline-img -->
        <div class="timeline-panel">
+
            <div class="timeline-heading">
+
                <h4>Timeline Event</h4>
+
            </div>
+
            <div class="timeline-body">
+
                <p>Invitamus me testatur sed quod non dum animae tuae lacrimis ut libertatem deum rogus aegritudinis causet. Dicens hoc contra serpentibus isto.</p>
+
            </div>
+
            <div class="timeline-footer">
+
                <p class="text-right">Feb-21-2014</p>
+
            </div>
+
        </div>
+
    </li>
+
   
+
    <li class="timeline-inverted">
+
        <div class="timeline-badge">
+
            <a><i class="fa fa-circle invert" id=""></i></a>
+
        </div>
+
        <div class="timeline-panel">
+
            <div class="timeline-heading">
+
                <h4>Timeline Event</h4>
+
            </div>
+
            <div class="timeline-body">
+
                <p></p>
+
            </div>
+
            <div class="timeline-footer">
+
                <p class="text-right">Feb-23-2014</p>
+
            </div>
+
        </div>
+
    </li>
+
   
+
    <li>
+
        <div class="timeline-badge">
+
            <a><i class="fa fa-circle" id=""></i></a>
+
        </div>
+
        <div class="timeline-panel">
+
            <div class="timeline-heading">
+
                <h4>Timeline Event</h4>
+
            </div>
+
            <div class="timeline-body">
+
                <p>Advenientibus aliorum eam ad per te sed. Facere debetur aut veneris accedens.</p>
+
            </div>
+
            <div class="timeline-footer">
+
                <p class="text-right">Feb-23-2014</p>
+
            </div>
+
        </div>
+
    </li>
+
   
+
    <li class="timeline-inverted">
+
        <div class="timeline-badge">
+
            <a><i class="fa fa-circle invert" id=""></i></a>
+
        </div>
+
        <div class="timeline-panel">
+
            <div class="timeline-heading">
+
                <h4>Timeline Event</h4>
+
            </div>
+
            <div class="timeline-body">
+
                <p>Volvitur ingreditur id ait mea vero cum autem quod ait Cumque ego illum vero cum unde beata. Commendavi si non dum est in. Dionysiadem tuos ratio puella ut casus, tunc lacrimas effunditis magister cives Tharsis. Puellae addita verbaque' capellam sanctissima quid, apollinem existimas filiam rex cum autem quod tamen adnuente rediens eam est se in. Peracta licet ad nomine Maria non ait in modo compungi mulierem volutpat.</p>
+
            </div>
+
            <div class="timeline-footer">
+
                <p class="text-right">Feb-27-2014</p>
+
            </div>
+
        </div>
+
    </li>
+
   
+
    <li>
+
        <div class="timeline-badge">
+
            <a><i class="fa fa-circle" id=""></i></a>
+
        </div>
+
        <div class="timeline-panel">
+
            <div class="timeline-heading">
+
                <h4>Timeline Event</h4>
+
            </div>
+
            <div class="timeline-body">
+
                <p>Adfertur guttae sapientiae ducitur est Apollonius ut a a his domino Lycoridem in lucem. Theophile atque bona dei cenam veniebant est cum. Iusto opes mihi Tyrum in modo compungi mulierem ubi augue eiusdem ordo quos vero diam omni catervis famulorum. Bene dictis ut diem finito servis unde.</p>
+
            </div>
+
            <div class="timeline-footer">
+
                <p class="text-right">Mar-01-2014</p>
+
            </div>
+
        </div>
+
    </li>
+
   
+
    <li  class="timeline-inverted">
+
        <div class="timeline-badge">
+
            <a><i class="fa fa-circle invert" id=""></i></a>
+
        </div>
+
        <div class="timeline-panel">
+
            <div class="timeline-heading">
+
                <h4>Timeline Event</h4>
+
            </div>
+
            <div class="timeline-body">
+
                <p>Crede respiciens loco dedit beneficio ad suis alteri si puella eius in. Acceptis codicello lenonem in deinde plectrum anni ipsa quod eam est Apollonius.</p>
+
            </div>
+
            <div class="timeline-footer primary">
+
                <p class="text-right">Mar-02-2014</p>
+
            </div>
+
        </div>
+
    </li>
+
    <li class="clearfix no-float"></li>
+
</ul>
+
  
<p class="footer">Icons by <a href="http://fortawesome.github.io/Font-Awesome/">FontAwesome 4.1 Icons</a>.<br />
+
<div class="cd-timeline-content">
  Created by <a href="http://jenniferperrin.com">Jennifer Perrin</a>
+
<h2>Title of section 1</h2>
</p>
+
<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? Iste voluptatibus minus veritatis qui ut.</p>
 +
<a href="#0" class="cd-read-more">Read more</a>
 +
<span class="cd-date">Jan 14</span>
 +
</div> <!-- cd-timeline-content -->
 +
</div> <!-- cd-timeline-block -->
  
<body>
+
<div class="cd-timeline-block">
 +
<div class="cd-timeline-img cd-movie">
 +
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/148866/cd-icon-movie.svg" alt="Movie">
 +
</div> <!-- cd-timeline-img -->
 +
 
 +
<div class="cd-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="cd-read-more">Read more</a>
 +
<span class="cd-date">Jan 18</span>
 +
</div> <!-- cd-timeline-content -->
 +
</div> <!-- cd-timeline-block -->
 +
 
 +
<div class="cd-timeline-block">
 +
<div class="cd-timeline-img cd-picture">
 +
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/148866/cd-icon-picture.svg" alt="Picture">
 +
</div> <!-- cd-timeline-img -->
 +
 
 +
<div class="cd-timeline-content">
 +
<h2>Title of section 3</h2>
 +
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Excepturi, obcaecati, quisquam id molestias eaque asperiores voluptatibus cupiditate error assumenda delectus odit similique earum voluptatem doloremque dolorem ipsam quae rerum quis. Odit, itaque, deserunt corporis vero ipsum nisi eius odio natus ullam provident pariatur temporibus quia eos repellat consequuntur perferendis enim amet quae quasi repudiandae sed quod veniam dolore possimus rem voluptatum eveniet eligendi quis fugiat aliquam sunt similique aut adipisci.</p>
 +
<a href="#0" class="cd-read-more">Read more</a>
 +
<span class="cd-date">Jan 24</span>
 +
</div> <!-- cd-timeline-content -->
 +
</div> <!-- cd-timeline-block -->
 +
 
 +
<div class="cd-timeline-block">
 +
<div class="cd-timeline-img cd-location">
 +
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/148866/cd-icon-location.svg" alt="Location">
 +
</div> <!-- cd-timeline-img -->
 +
 
 +
<div class="cd-timeline-content">
 +
<h2>Title of section 4</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? Iste voluptatibus minus veritatis qui ut.</p>
 +
<a href="#0" class="cd-read-more">Read more</a>
 +
<span class="cd-date">Feb 14</span>
 +
</div> <!-- cd-timeline-content -->
 +
</div> <!-- cd-timeline-block -->
 +
 
 +
<div class="cd-timeline-block">
 +
<div class="cd-timeline-img cd-location">
 +
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/148866/cd-icon-location.svg" alt="Location">
 +
</div> <!-- cd-timeline-img -->
 +
 
 +
<div class="cd-timeline-content">
 +
<h2>Title of section 5</h2>
 +
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto, optio, dolorum provident rerum.</p>
 +
<a href="#0" class="cd-read-more">Read more</a>
 +
<span class="cd-date">Feb 18</span>
 +
</div> <!-- cd-timeline-content -->
 +
</div> <!-- cd-timeline-block -->
 +
 
 +
<div class="cd-timeline-block">
 +
<div class="cd-timeline-img cd-movie">
 +
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/148866/cd-icon-movie.svg" alt="Movie">
 +
</div> <!-- cd-timeline-img -->
 +
 
 +
<div class="cd-timeline-content">
 +
<h2>Final Section</h2>
 +
<p>This is the content of the last section</p>
 +
<span class="cd-date">Feb 26</span>
 +
</div> <!-- cd-timeline-content -->
 +
</div> <!-- cd-timeline-block -->
 +
</section> <!-- cd-timeline -->
 
</body>
 
</body>
 
</html>
 
</html>

Revision as of 01:20, 17 October 2016





jQuery(document).ready(function($){ var $timeline_block = $('.cd-timeline-block'); //hide timeline blocks which are outside the viewport $timeline_block.each(function(){ if($(this).offset().top > $(window).scrollTop()+$(window).height()*0.75) { $(this).find('.cd-timeline-img, .cd-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('.cd-timeline-img').hasClass('is-hidden') ) { $(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in'); } }); }); });

Responsive Vertical Timeline

Picture

Title of section 1

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto, optio, dolorum provident rerum aut hic quasi placeat iure tempora laudantium ipsa ad debitis unde? Iste voluptatibus minus veritatis qui ut.

Read more Jan 14
Movie

Title of section 2

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto, optio, dolorum provident rerum aut hic quasi placeat iure tempora laudantium ipsa ad debitis unde?

Read more Jan 18
Picture

Title of section 3

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Excepturi, obcaecati, quisquam id molestias eaque asperiores voluptatibus cupiditate error assumenda delectus odit similique earum voluptatem doloremque dolorem ipsam quae rerum quis. Odit, itaque, deserunt corporis vero ipsum nisi eius odio natus ullam provident pariatur temporibus quia eos repellat consequuntur perferendis enim amet quae quasi repudiandae sed quod veniam dolore possimus rem voluptatum eveniet eligendi quis fugiat aliquam sunt similique aut adipisci.

Read more Jan 24
Location

Title of section 4

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto, optio, dolorum provident rerum aut hic quasi placeat iure tempora laudantium ipsa ad debitis unde? Iste voluptatibus minus veritatis qui ut.

Read more Feb 14
Location

Title of section 5

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto, optio, dolorum provident rerum.

Read more Feb 18
Movie

Final Section

This is the content of the last section

Feb 26