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")
5
5
h1.text-headline #{title} <br >#{subtitle}
6
6
a( href ="/docs/ts/latest/quickstart.html" class ="hero-cta md-raised button button-large button-plain" md-button ) Get Started
7
7
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
9
11
img( src ="/resources/images/logos/angular2/angular.svg" )
10
12
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")
28
28
script( src ="/resources/js/directives/api-list.js" )
29
29
script( src ="/resources/js/directives/bio.js" )
30
30
script( src ="/resources/js/directives/bold.js" )
31
+ script( src ="/resources/js/directives/banner.js" )
31
32
script( src ="/resources/js/directives/code.js" )
32
33
script( src ="/resources/js/directives/copy.js" )
33
34
script( src ="/resources/js/directives/code-tabs.js" )
Original file line number Diff line number Diff line change 10
10
* Variables
11
11
*/
12
12
13
+ $announcement-bar : ' .announcement-bar' ;
13
14
$announcement-bar-height : 104px ;
14
15
$announcement-bar-width : 752px ;
15
16
@@ -18,7 +19,7 @@ $announcement-bar-width: 752px;
18
19
* Class
19
20
*/
20
21
21
- . announcement-bar {
22
+ #{ $ announcement-bar} {
22
23
background : $white ;
23
24
bottom : 0 ;
24
25
box-sizing : border-box ;
@@ -67,6 +68,29 @@ $announcement-bar-width: 752px;
67
68
}
68
69
}
69
70
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
+
70
94
/*
71
95
* Mobile Styles
72
96
*
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