Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ show history or describe a sequence of events.

[Demo](http://rpocklin.github.io/angular-timeline/example/index.html)

[Demo using attributes](http://rpocklin.github.io/angular-timeline/example/index-attributes.html)

[Demo without bootstrap](http://rpocklin.github.io/angular-timeline/example/index-no-bootstrap.html)

[Original Implementation (HTML / Javascript)](http://bootsnipp.com/snippets/featured/timeline-responsive)
Expand Down
8 changes: 4 additions & 4 deletions dist/angular-timeline-animations.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
opacity: 0; }

@media only screen and (min-width: 768px) {
.timeline timeline-event:nth-child(odd) timeline-panel.bounce-in {
.timeline .timeline-event:nth-child(odd) .timeline-panel.bounce-in {
animation: cd-bounce-2 0.5s; }
.timeline timeline-event:nth-child(even) timeline-panel.bounce-in {
.timeline .timeline-event:nth-child(even) .timeline-panel.bounce-in {
animation: cd-bounce-2-inverse 0.5s; } }

@media only screen and (max-width: 767px) {
.timeline timeline-event timeline-panel.bounce-in {
.timeline .timeline-event .timeline-panel.bounce-in {
animation: cd-bounce-2 0.5s; } }

.timeline timeline-event timeline-badge.bounce-in {
.timeline .timeline-event .timeline-badge.bounce-in {
animation: cd-bounce-1 0.5s; }

@-webkit-keyframes cd-bounce-2 {
Expand Down
199 changes: 89 additions & 110 deletions dist/angular-timeline.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
margin-right: 4px;
vertical-align: -1px; }

img {
.timeline img {
vertical-align: middle; }

.img-responsive {
.timeline .img-responsive {
display: block;
height: auto;
max-width: 100%; }

.img-rounded {
.timeline .img-rounded {
border-radius: 3px; }

.img-thumbnail {
.timeline .img-thumbnail {
background-color: #fff;
border: 1px solid #ededf0;
border-radius: 3px;
Expand All @@ -27,23 +27,22 @@ img {
transition: all .2s ease-in-out;
webkit-transition: all .2s ease-in-out; }

.img-circle {
.timeline .img-circle {
border-radius: 50%; }

.timeline {
padding: 0;
list-style: none;
position: relative; }

.timeline:before {
top: 0;
bottom: 0;
position: absolute;
content: " ";
width: 3px;
background-color: #cccccc;
left: 50%;
margin-left: -1.5px; }
.timeline:before {
top: 0;
bottom: 0;
position: absolute;
content: " ";
width: 3px;
background-color: #cccccc;
left: 50%;
margin-left: -1.5px; }

.timeline-event {
margin-bottom: 20px;
Expand All @@ -59,60 +58,7 @@ img {
padding: 0.8em 1em;
margin: 0; }

timeline-badge.primary {
background-color: #2e6da4 !important; }

timeline-badge.success {
background-color: #3f903f !important; }

timeline-badge.warning {
background-color: #f0ad4e !important; }

timeline-badge.danger {
background-color: #d9534f !important; }

timeline-badge.info {
background-color: #5bc0de !important; }

.timeline-title {
margin-top: 0; }

timeline-panel > * {
margin: 0; }

timeline-panel {
background-color: #fff;
float: left;
border: 1px solid #d4d4d4;
border-radius: 2px;
padding: 12px;
position: relative;
-webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175); }

timeline-panel:before {
position: absolute;
top: 35px;
right: -15px;
display: inline-block;
border-top: 15px solid transparent;
border-left: 15px solid #ccc;
border-right: 0 solid #ccc;
border-bottom: 15px solid transparent;
content: " "; }

timeline-panel:after {
position: absolute;
top: 36px;
right: -14px;
display: inline-block;
border-top: 14px solid transparent;
border-left: 14px solid #fff;
border-right: 0 solid #fff;
border-bottom: 14px solid transparent;
content: " "; }

timeline-badge {
.timeline-badge {
box-shadow: 0 0 0 4px white, inset 0 2px 0 rgba(0, 0, 0, 0.08), 0 3px 0 4px rgba(0, 0, 0, 0.05);
color: #fff;
width: 50px;
Expand All @@ -130,66 +76,99 @@ timeline-badge {
border-top-left-radius: 50%;
border-bottom-right-radius: 50%;
border-bottom-left-radius: 50%; }
.timeline-badge.primary {
background-color: #2e6da4 !important; }
.timeline-badge.success {
background-color: #3f903f !important; }
.timeline-badge.warning {
background-color: #f0ad4e !important; }
.timeline-badge.danger {
background-color: #d9534f !important; }
.timeline-badge.info {
background-color: #5bc0de !important; }

.timeline-inverted timeline-panel {
float: right; }

.timeline-inverted timeline-panel:before {
border-left-width: 0;
border-right-width: 15px;
left: -15px;
right: auto; }

.timeline-inverted timeline-panel:after {
border-left-width: 0;
border-right-width: 14px;
left: -14px;
right: auto; }

.timeline-event:before,
.timeline-event:after {
content: " ";
display: table; }
.timeline-title {
margin-top: 0; }

.timeline-event:after {
clear: both; }
.timeline-panel {
background-color: #fff;
float: left;
border: 1px solid #d4d4d4;
border-radius: 2px;
padding: 12px;
position: relative;
-webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175); }
.timeline-panel > * {
margin: 0; }
.timeline-panel:before {
position: absolute;
top: 35px;
right: -15px;
display: inline-block;
border-top: 15px solid transparent;
border-left: 15px solid #ccc;
border-right: 0 solid #ccc;
border-bottom: 15px solid transparent;
content: " "; }
.timeline-panel:after {
position: absolute;
top: 36px;
right: -14px;
display: inline-block;
border-top: 14px solid transparent;
border-left: 14px solid #fff;
border-right: 0 solid #fff;
border-bottom: 14px solid transparent;
content: " "; }

.timeline-inverted .timeline-panel {
float: right; }
.timeline-inverted .timeline-panel:before {
border-left-width: 0;
border-right-width: 15px;
left: -15px;
right: auto; }
.timeline-inverted .timeline-panel:after {
border-left-width: 0;
border-right-width: 14px;
left: -14px;
right: auto; }

.timeline-event:before,
.timeline-event:after {
.timeline-event:before, .timeline-event:after {
content: " ";
display: table; }

.timeline-event:after {
clear: both; }

@media only screen and (min-width: 768px) {
timeline-panel {
.timeline-panel {
width: calc(50% - 45px);
width: -moz-calc(50% - 45px);
width: -webkit-calc(50% - 45px); } }

@media only screen and (max-width: 767px) {
.timeline:before {
left: 40px; }
timeline-panel {
.timeline-panel {
float: right;
width: calc(100% - 85px);
width: -moz-calc(100% - 85px);
width: -webkit-calc(100% - 85px); }
timeline-badge {
.timeline-panel:before {
border-left-width: 0;
border-right-width: 15px;
left: -15px;
right: auto;
top: 46px; }
.timeline-panel:after {
border-left-width: 0;
border-right-width: 14px;
left: -14px;
right: auto;
top: 47px; }
.timeline-badge {
left: 15px;
margin-left: 0;
top: 36px; }
timeline-panel {
float: right; }
timeline-panel:before {
border-left-width: 0;
border-right-width: 15px;
left: -15px;
right: auto;
top: 46px; }
timeline-panel:after {
border-left-width: 0;
border-right-width: 14px;
left: -14px;
right: auto;
top: 47px; } }
top: 36px; } }
6 changes: 6 additions & 0 deletions dist/angular-timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ angular.module('angular-timeline').directive('timelineBadge', function() {
require: '^timelineEvent',
restrict: 'AE',
transclude: true,
replace: true,
template: '<div class="timeline-badge" ng-transclude></div>'
};
});
Expand All @@ -30,6 +31,7 @@ angular.module('angular-timeline').directive('timeline', function() {
return {
restrict: 'AE',
transclude: true,
replace: true,
template: '<ul class="timeline" ng-transclude></ul>',
controller: function() {}
};
Expand All @@ -55,6 +57,7 @@ angular.module('angular-timeline').directive('timelineEvent', function() {
require: '^timeline',
restrict: 'AE',
transclude: true,
replace: true,
template: '<li class="timeline-event" ng-class-odd="oddClass" ng-class-even="evenClass" ng-transclude></li>',
link: function(scope, element, attrs, controller) {

Expand Down Expand Up @@ -105,6 +108,7 @@ angular.module('angular-timeline').directive('timelineFooter', function() {
require: '^timelinePanel',
restrict: 'AE',
transclude: true,
replace: true,
template: '<div class="timeline-footer" ng-transclude></div>'
};
});
Expand All @@ -123,6 +127,7 @@ angular.module('angular-timeline').directive('timelineHeading', function() {
require: '^timelinePanel',
restrict: 'AE',
transclude: true,
replace: true,
template: '<div class="timeline-heading" ng-transclude></div>'
};
});
Expand All @@ -141,6 +146,7 @@ angular.module('angular-timeline').directive('timelinePanel', function() {
require: '^timeline',
restrict: 'AE',
transclude: true,
replace: true,
template: '<div class="timeline-panel" ng-transclude></div>'
};
});
16 changes: 16 additions & 0 deletions example/app-attributes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

var app = angular.module('example', [
'ngSanitize',
'ui.router',
'angular-timeline',
'angular-scroll-animate'
]);

app.config(function($stateProvider) {
$stateProvider.state('user', {
url: '',
controller: 'ExampleCtrl',
templateUrl: 'example-attributes.html'
});
});
37 changes: 37 additions & 0 deletions example/example-attributes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<div class="container-fluid">
<h1>Angular Timeline</h1>
<button ng-click="addEvent()">Add New Event</button>
<button ng-click="leftAlign()">Left Side</button>
<button ng-click="rightAlign()">Right Side</button>
<button ng-click="defaultAlign()">Alternate Sides</button>
<br/>
<br/>
<div data-timeline>
<!-- can also hard-code to side="left" or side="right" -->
<div data-timeline-event ng-repeat="event in events" side="{{side}}">
<!-- uses angular-scroll-animate to give it some pop -->
<div data-timeline-badge class="{{event.badgeClass}} timeline-hidden"
when-visible="animateElementIn" when-not-visible="animateElementOut">
<i class="glyphicon {{event.badgeIconClass}}"></i>
</div>

<!-- uses angular-scroll-animate to give it some pop -->
<div data-timeline-panel class="{{event.badgeClass}} timeline-hidden"
when-visible="animateElementIn" when-not-visible="animateElementOut">
<div data-timeline-heading>
<h4>{{event.title}}</h4>

<p ng-if="event.when">
<small class="text-muted"><i class="glyphicon glyphicon-time"></i>{{event.when}}</small>
</p>
<p ng-if="event.titleContentHtml" ng-bind-html="event.titleContentHtml">
</p>
</div>
<p ng-bind-html="event.contentHtml"></p>
<div data-timeline-footer ng-if="event.footerContentHtml">
<span ng-bind-html="event.footerContentHtml"></span>
</div>
</div>
</div>
</div>
</div>
Loading