CSS Timeline
HTML
<html lang="en" ng-app="s-timeline">
<body ng-controller="timelimeController">
<div class="bar"></div>
<div class="timeline">
<div class="entry">
<h1>1990</h1>
<h2>Entry Title</h2>
<img src="http://dummyimage.com/300x200/000/fff"/>
Here's the info about this date
</div>
<div class="entry">
<h1>1995</h1>
Here's the info about this date
</div>
<div class="entry">
<h1>2000</h1>
Here's the info about this date
</div>
<div class="entry">
<h1>2005</h1>
Here's the info about this date
</div>
<div class="entry">
<h1>2010</h1>
Here's the info about this date
</div>
</div>
</body>
</html>
CSS
body {
padding:25px;
font-family:sans-serif;
}
.timeline {
white-space:nowrap;
overflow-x: scroll;
padding:30px 0 10px 0;
position:relative;
}
.entry {
display:inline-block;
vertical-align:top;
background:#13519C;
color:#fff;
padding:10px;
font-size:12px;
text-align:center;
position:relative;
border-top:4px solid #06182E;
border-radius:3px;
min-width:200px;
max-width:500px;
}
.entry img {
display:block;
max-width:100%;
height:auto;
margin-bottom:10px;
}
.entry:after {
content:'';
display:block;
background:#eee;
width:7px;
height:7px;
border-radius:6px;
border:3px solid #06182E;
position:absolute;
left:50%;
top:-30px;
margin-left:-6px;
}
.entry:before {
content:'';
display:block;
background:#06182E;
width:5px;
height:20px;
position:absolute;
left:50%;
top:-20px;
margin-left:-2px;
}
.entry h1 {
color:#fff;
font-size:18px;
font-family:Georgia, serif;
font-weight:bold;
margin-bottom:10px;
}
.entry h2 {
letter-spacing:.2em;
margin-bottom:10px;
font-size:14px;
}
.bar {
height:4px;
background:#eee;
width:100%;
position:relative;
top:13px;
left:0;
}
JavaScript
var app = angular.module('s-timeline', []);
app.controller('timelimeController', function ($scope) {
var inputObject = {
startYear: 2016,
endYear: 2020,
milestones: [
{
"name": "Milestone 1",
"type": "planned",
"date": "15-01-2016"
},
{
"name": "Milestone 2",
"type": "planned",
"date": "20-3-2016"
},
{
"name": "Milestone 3",
"type": "planned",
"date": "10-06-2016"
},
{
"name": "Milestone 4",
"type": "planned",
"date": "02-09-2016"
},
{
"name": "Milestone 5",
"type": "planned",
"date": "15-12-2016"
},
{
"name": "Milestone 6",
"type": "planned",
"date": "15-01-2017"
},
{
"name": "Milestone 7",
"type": "planned",
"date": "20-3-2017"
},
{
"name": "Milestone 8",
"type": "planned",
"date": "10-06-2017"
},
{
"name": "Milestone 9",
"type": "planned",
"date": "02-09-2017"
},
{
"name": "Milestone 10",
"type": "planned",
"date": "15-12-2017"
}, {
"name": "Milestone 11",
"type": "planned",
"date": "15-01-2018"
},
{
"name": "Milestone 12",
"type": "planned",
"date": "20-3-2018"
},
{
"name": "Milestone 13",
"type": "planned",
"date": "10-06-2018"
...