1
- /* globals jQuery */
2
- /* Author:
3
- Philipp C. Adrian
4
- */
5
- ( function ( $ , window , undefined ) {
6
- ////////////////////////////////////////////////////////////////////////////////
7
- const bjs = {
8
- ////////////////////////////////////////////////////////////////////////////////
9
- init : function ( ) {
10
- //$("html").removeClass("no-js");
11
-
12
- //bjs.activateReferenceItem(location.hash);
13
- $ ( 'pre.code' ) . highlight ( { source :1 , zebra :1 , indent :'space' , list :'ol' } ) ;
14
-
15
- //bjs.behaviour($("body"));
16
- } ,
17
- ////////////////////////////////////////////////////////////////////////////////
18
- behaviour : function ( context ) {
19
- $ ( '.referenceLink' , context ) . bind ( 'click' , function ( e ) {
20
- e . preventDefault ( ) ;
21
- bjs . activateReferenceItem ( $ ( this ) . attr ( 'href' ) ) ;
22
- } ) ;
23
-
24
- bjs . iScroll = new iScroll ( 'iScroll' , {
25
- hideScrollbar :false ,
26
- hScroll :false
27
- } ) ;
28
- } ,
29
- ////////////////////////////////////////////////////////////////////////////////
30
- iScroll : false ,
31
- activateReferenceItem : function ( id ) {
32
- var content = $ ( id ) ;
33
- if ( ! content . length ) return ;
34
- window . location = id ;
35
- $ ( '.referenceLink' ) . removeClass ( 'active' ) ;
36
- $ ( '[href="' + id + '"]' ) . addClass ( 'active' ) ;
37
- content . siblings ( ) . removeClass ( '.active' ) . fadeOut ( 100 , function ( ) {
38
- content . addClass ( '.active' ) . css ( { display :'none' , opacity :1 } ) . fadeIn ( 100 ) ;
39
- } ) ;
40
- }
41
- } ;
42
- ////////////////////////////////////////////////////////////////////////////////
43
- $ ( document ) . ready ( function ( ) {
44
- bjs . init ( ) ;
45
- $ ( 'body > *' ) . wrapAll ( '<div class=\'wrapper\'></div>' ) ;
46
- specialChars ( ) ;
47
- createGuideLines ( ) ;
48
-
49
- $ ( '.nav-o-meter' ) . append ( '<ul class="bars"><li></li><li></li><li></li></ul>' ) ;
50
- // MOBILE NAVIGATION
51
- $ ( '.nav-o-meter' ) . on ( 'click' , function ( ) {
52
- $ ( this ) . toggleClass ( 'opened' ) ;
53
- $ ( ' .main-menu' ) . toggle ( ) ;
54
-
55
- $ ( '.main-menu' ) . find ( 'li a' ) . bind ( 'click' , function ( ) {
56
- if ( $ ( '.nav-o-meter' ) . hasClass ( 'opened' ) ) {
57
- $ ( '.nav-o-meter' ) . toggleClass ( 'opened' ) ;
58
- $ ( ' .main_menu' ) . toggle ( ) ;
59
- }
60
- } ) ;
1
+ $ ( document ) . ready ( function ( ) {
2
+ specialChars ( ) ;
3
+ createGuideLines ( ) ;
4
+ // MOBILE NAVIGATION
5
+ $ ( '.nav-o-meter' ) . on ( 'click' , function ( ) {
6
+ $ ( this ) . toggleClass ( 'opened' ) ;
7
+ $ ( '.main-menu' ) . toggle ( ) ;
8
+ $ ( '.main-menu' ) . find ( 'li a' ) . bind ( 'click' , function ( ) {
9
+ if ( $ ( '.nav-o-meter' ) . hasClass ( 'opened' ) ) {
10
+ $ ( '.nav-o-meter' ) . toggleClass ( 'opened' ) ;
11
+ $ ( '.main_menu' ) . toggle ( ) ;
12
+ }
61
13
} ) ;
62
14
} ) ;
63
-
64
-
65
- function specialChars ( ) {
66
- $ ( 'a.stepped-link' ) . each ( function ( ) {
67
- const chars = $ ( this ) . text ( ) . split ( '' ) ;
68
- const that = $ ( this ) ;
69
- that . empty ( ) ;
70
- $ . each ( chars , function ( i , char ) {
71
- const fontSize = 30 - ( 2 * i ) ;
72
- const style = `border-bottom-width: ${ ( i + 1 ) } px; font-size: ${ fontSize } px; top: -${ ( i + ( 2 * i ) ) } px;` ;
73
-
74
- // var style = 'style="border-bottom-width: ' + (i+1) + 'px; ';
75
- // style += 'font-size: '+fontSize+'px; ';
76
- // style += 'top: -' + (i+(2*i)) + 'px;"';
77
- that . append ( '<span style="' + style + '">' + char + '</span>' ) ;
78
- } ) ;
79
- // for(var i = 0; i < chars.length; i++) {
80
- // chars[i] = '<span>'+chars[i]+'</span>';
81
- // console.log(chars[i]);
82
- // }
15
+ } ) ;
16
+
17
+ function specialChars ( ) {
18
+ $ ( 'a.stepped-link' ) . each ( function ( ) {
19
+ const chars = $ ( this ) . text ( ) . split ( '' ) ;
20
+ const that = $ ( this ) ;
21
+ that . empty ( ) ;
22
+ $ . each ( chars , function ( i , char ) {
23
+ const fontSize = 30 - ( 2 * i ) ;
24
+ const style = `border-bottom-width: ${ ( i + 1 ) } px; font-size: ${ fontSize } px; top: -${ ( i + ( 2 * i ) ) } px;` ;
25
+ that . append ( '<span style="' + style + '">' + char + '</span>' ) ;
83
26
} ) ;
84
- }
85
-
27
+ } ) ;
28
+ }
86
29
87
- function createGuideLines ( ) {
88
- $ ( '.guidelines' ) . append ( '<div class="bottom_lines">' ) ;
89
- for ( var b = 0 ; b < 5 ; b ++ ) {
90
- $ ( '.bottom_lines' ) . append ( '<div class="bottomLine line_' + ( b + 1 ) + '">' ) ;
91
- }
92
- $ ( '.guidelines' ) . append ( '<div class="right_lines">' ) ;
93
- for ( var r = 0 ; r < 3 ; r ++ ) {
94
- $ ( '.right_lines' ) . append ( '<div class="right_line line_' + ( r + 1 ) + '">' ) ;
95
- }
96
- $ ( '.guidelines' ) . append ( '<div class="page_lines">' ) ;
97
- for ( var i = 0 ; i < 4 ; i ++ ) {
98
- $ ( '.page_lines' ) . append ( '<div class="line line_' + ( i + 1 ) + '">' ) ;
99
- }
30
+ function createGuideLines ( ) {
31
+ $ ( '.guidelines' ) . append ( '<div class="bottom_lines">' ) ;
32
+ for ( var b = 0 ; b < 5 ; b ++ ) {
33
+ $ ( '.bottom_lines' ) . append ( '<div class="bottomLine line_' + ( b + 1 ) + '">' ) ;
100
34
}
101
-
102
- ////////////////////////////////////////////////////////////////////////////////
103
- } ) ( jQuery , window , undefined ) ;
35
+ $ ( '.guidelines' ) . append ( '<div class="right_lines">' ) ;
36
+ for ( var r = 0 ; r < 3 ; r ++ ) {
37
+ $ ( '.right_lines' ) . append ( '<div class="right_line line_' + ( r + 1 ) + '">' ) ;
38
+ }
39
+ $ ( '.guidelines' ) . append ( '<div class="page_lines">' ) ;
40
+ for ( var i = 0 ; i < 4 ; i ++ ) {
41
+ $ ( '.page_lines' ) . append ( '<div class="line line_' + ( i + 1 ) + '">' ) ;
42
+ }
43
+ }
0 commit comments