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