This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +86
-3
lines changed
Expand file tree Collapse file tree 4 files changed +86
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,14 @@ header(class="background-sky l-relative")
55 h1.text-headline #{title} <br >#{subtitle}
66 a( href ="/docs/ts/latest/quickstart.html" class ="hero-cta md-raised button button-large button-plain" md-button ) Get Started
77
8- .announcement-bar.shadow-2.clearfix
8+
9+ banner( image ="/resources/images/logos/angular2/angular.svg" text ="Angular 2.0 Final Release Now Live!" button ="Learn More" )
10+ .announcement-bar-slide.clearfix
911 img( src ="/resources/images/logos/angular2/angular.svg" )
1012 p Angular 2.0 Final Release Now Live!
11- a( href ="http://angularjs.blogspot.com/2016/09/angular2-final.html" target ="_blank" class ="button " + "md-button" ) Learn More
13+ a( href ="http://angularjs.blogspot.com/2016/09/angular2-final.html" target ="_blank" class ="button " + "md-button" ) Learn More
14+
15+ .announcement-bar-slide.clearfix
16+ img( src ="/resources/images/logos/ng-europe/ng-europe-logo.png" )
17+ p Join us for <strong >ng-europe in Paris</strong >, France this October!
18+ a( href ="https://ngeurope.org/?utm_source=angular&utm_medium=banner&utm_campaign=angular-banner" target ="_blank" class ="button md-button" ) Register now
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ script(src="/resources/js/directives/cheatsheet.js")
2828script( src ="/resources/js/directives/api-list.js" )
2929script( src ="/resources/js/directives/bio.js" )
3030script( src ="/resources/js/directives/bold.js" )
31+ script( src ="/resources/js/directives/banner.js" )
3132script( src ="/resources/js/directives/code.js" )
3233script( src ="/resources/js/directives/copy.js" )
3334script( src ="/resources/js/directives/code-tabs.js" )
Original file line number Diff line number Diff line change 1010* Variables
1111*/
1212
13+ $announcement-bar : ' .announcement-bar' ;
1314$announcement-bar-height : 104px ;
1415$announcement-bar-width : 752px ;
1516
@@ -18,7 +19,7 @@ $announcement-bar-width: 752px;
1819* Class
1920*/
2021
21- . announcement-bar {
22+ #{ $ announcement-bar} {
2223 background : $white ;
2324 bottom : 0 ;
2425 box-sizing : border-box ;
@@ -67,6 +68,29 @@ $announcement-bar-width: 752px;
6768 }
6869 }
6970
71+
72+ #{$announcement-bar } -slide {
73+ bottom : 0 ;
74+ box-sizing : border-box ;
75+ height : $announcement-bar-height ;
76+ left : 0 ;
77+ margin-bottom : - $announcement-bar-height ;
78+ opacity : 0 ;
79+ padding : $unit * 4 ;
80+ position : absolute ;
81+ right : 0 ;
82+ transition : all .8s ;
83+ width : $announcement-bar-width ;
84+ z-index : $layer-1 ;
85+
86+ & .is-visible {
87+ margin-bottom : 0 ;
88+ opacity : 1 ;
89+ z-index : $layer-2 ;
90+ }
91+ }
92+
93+
7094 /*
7195 * Mobile Styles
7296 *
Original file line number Diff line number Diff line change 1+ /*eslint no-unused-vars: "angularIO" */
2+
3+ /*
4+ * Announcement Bar Banner Directive
5+ *
6+ * A rotating announcement banners used to display
7+ * important updates and news.
8+ */
9+
10+ angularIO . directive ( 'banner' , [ '$interval' , function ( $interval ) {
11+ return {
12+ restrict : 'E' ,
13+ transclude : true ,
14+ compile : function ( tElement , attrs ) {
15+ var template =
16+ '<div class="announcement-bar shadow-2 clearfix" ng-transclude></div>' ;
17+
18+ // UPDATE ELEMENT WITH NEW TEMPLATE
19+ tElement . html ( template ) ;
20+
21+ // RETURN ELEMENT
22+ return function ( scope , element , attrs ) {
23+ var slides = angular . element ( element [ 0 ] . getElementsByClassName ( 'announcement-bar-slide' ) ) ;
24+ var slideLenth = slides . length ;
25+ var currentSlide = 1 ;
26+
27+ // SHOW FIRST SLIDE
28+ angular . element ( slides [ 0 ] ) . addClass ( 'is-visible' ) ;
29+
30+
31+ // START SLIDESHOW CYCLE
32+ var timeoutId = $interval ( function ( ) {
33+
34+ if ( ( currentSlide + 1 ) <= slideLenth ) {
35+ slides . removeClass ( 'is-visible' ) ;
36+ angular . element ( slides [ currentSlide ] ) . addClass ( 'is-visible' ) ;
37+ }
38+ else {
39+ // RESET ON LAST SLIDE
40+ currentSlide = 0 ;
41+ slides . removeClass ( 'is-visible' ) ;
42+ angular . element ( slides [ currentSlide ] ) . addClass ( 'is-visible' ) ;
43+ }
44+
45+ // INCREMENT
46+ currentSlide = currentSlide + 1 ;
47+ } , 5000 ) ;
48+ } ;
49+ }
50+ } ;
51+ } ] ) ;
You can’t perform that action at this time.
0 commit comments