jekyll-bulma-theme 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,214 +1,214 @@
1
- .highlighter-rouge {
2
- margin-bottom: 10px;
3
- }
4
-
5
- .highlight table td { padding: 5px; }
6
- .highlight table pre { margin: 0; }
7
- .highlight .c, .highlight .cd {
8
- color: #75715e;
9
- font-style: italic;
10
- }
11
- .highlight .cm {
12
- color: #75715e;
13
- font-style: italic;
14
- }
15
- .highlight .c1 {
16
- color: #75715e;
17
- font-style: italic;
18
- }
19
- .highlight .cp {
20
- color: #75715e;
21
- font-weight: bold;
22
- }
23
- .highlight .cs {
24
- color: #75715e;
25
- font-weight: bold;
26
- font-style: italic;
27
- }
28
- .highlight .err {
29
- color: #960050;
30
- background-color: #1e0010;
31
- }
32
- .highlight .gi {
33
- color: #ffffff;
34
- background-color: #324932;
35
- }
36
- .highlight .gd {
37
- color: #ffffff;
38
- background-color: #493131;
39
- }
40
- .highlight .ge {
41
- color: #000000;
42
- font-style: italic;
43
- }
44
- .highlight .gr {
45
- color: #aa0000;
46
- }
47
- .highlight .gt {
48
- color: #aa0000;
49
- }
50
- .highlight .gh {
51
- color: #999999;
52
- }
53
- .highlight .go {
54
- color: #888888;
55
- }
56
- .highlight .gp {
57
- color: #555555;
58
- }
59
- .highlight .gs {
60
- font-weight: bold;
61
- }
62
- .highlight .gu {
63
- color: #aaaaaa;
64
- }
65
- .highlight .k, .highlight .kv {
66
- color: #66d9ef;
67
- font-weight: bold;
68
- }
69
- .highlight .kc {
70
- color: #66d9ef;
71
- font-weight: bold;
72
- }
73
- .highlight .kd {
74
- color: #66d9ef;
75
- font-weight: bold;
76
- }
77
- .highlight .kp {
78
- color: #66d9ef;
79
- font-weight: bold;
80
- }
81
- .highlight .kr {
82
- color: #66d9ef;
83
- font-weight: bold;
84
- }
85
- .highlight .kt {
86
- color: #66d9ef;
87
- font-weight: bold;
88
- }
89
- .highlight .kn {
90
- color: #f92672;
91
- font-weight: bold;
92
- }
93
- .highlight .ow {
94
- color: #f92672;
95
- font-weight: bold;
96
- }
97
- .highlight .o {
98
- color: #f92672;
99
- font-weight: bold;
100
- }
101
- .highlight .mf {
102
- color: #ae81ff;
103
- }
104
- .highlight .mh {
105
- color: #ae81ff;
106
- }
107
- .highlight .il {
108
- color: #ae81ff;
109
- }
110
- .highlight .mi {
111
- color: #ae81ff;
112
- }
113
- .highlight .mo {
114
- color: #ae81ff;
115
- }
116
- .highlight .m, .highlight .mb, .highlight .mx {
117
- color: #ae81ff;
118
- }
119
- .highlight .se {
120
- color: #ae81ff;
121
- }
122
- .highlight .sb {
123
- color: #e6db74;
124
- }
125
- .highlight .sc {
126
- color: #e6db74;
127
- }
128
- .highlight .sd {
129
- color: #e6db74;
130
- }
131
- .highlight .s2 {
132
- color: #e6db74;
133
- }
134
- .highlight .sh {
135
- color: #e6db74;
136
- }
137
- .highlight .si {
138
- color: #e6db74;
139
- }
140
- .highlight .sx {
141
- color: #e6db74;
142
- }
143
- .highlight .sr {
144
- color: #e6db74;
145
- }
146
- .highlight .s1 {
147
- color: #e6db74;
148
- }
149
- .highlight .ss {
150
- color: #e6db74;
151
- }
152
- .highlight .s {
153
- color: #e6db74;
154
- }
155
- .highlight .na {
156
- color: #a6e22e;
157
- }
158
- .highlight .nc {
159
- color: #a6e22e;
160
- font-weight: bold;
161
- }
162
- .highlight .nd {
163
- color: #a6e22e;
164
- font-weight: bold;
165
- }
166
- .highlight .ne {
167
- color: #a6e22e;
168
- font-weight: bold;
169
- }
170
- .highlight .nf {
171
- color: #a6e22e;
172
- font-weight: bold;
173
- }
174
- .highlight .no {
175
- color: #66d9ef;
176
- }
177
- .highlight .bp {
178
- color: #f8f8f2;
179
- }
180
- .highlight .nb {
181
- color: #f8f8f2;
182
- }
183
- .highlight .ni {
184
- color: #f8f8f2;
185
- }
186
- .highlight .nn {
187
- color: #f8f8f2;
188
- }
189
- .highlight .vc {
190
- color: #f8f8f2;
191
- }
192
- .highlight .vg {
193
- color: #f8f8f2;
194
- }
195
- .highlight .vi {
196
- color: #f8f8f2;
197
- }
198
- .highlight .nv {
199
- color: #f8f8f2;
200
- }
201
- .highlight .w {
202
- color: #f8f8f2;
203
- }
204
- .highlight .nl {
205
- color: #f8f8f2;
206
- font-weight: bold;
207
- }
208
- .highlight .nt {
209
- color: #f92672;
210
- }
211
- .highlight {
212
- color: #f8f8f2;
213
- background-color: #49483e;
214
- }
1
+ .highlighter-rouge {
2
+ margin-bottom: 10px;
3
+ }
4
+
5
+ .highlight table td { padding: 5px; }
6
+ .highlight table pre { margin: 0; }
7
+ .highlight .c, .highlight .cd {
8
+ color: #75715e;
9
+ font-style: italic;
10
+ }
11
+ .highlight .cm {
12
+ color: #75715e;
13
+ font-style: italic;
14
+ }
15
+ .highlight .c1 {
16
+ color: #75715e;
17
+ font-style: italic;
18
+ }
19
+ .highlight .cp {
20
+ color: #75715e;
21
+ font-weight: bold;
22
+ }
23
+ .highlight .cs {
24
+ color: #75715e;
25
+ font-weight: bold;
26
+ font-style: italic;
27
+ }
28
+ .highlight .err {
29
+ color: #960050;
30
+ background-color: #1e0010;
31
+ }
32
+ .highlight .gi {
33
+ color: #ffffff;
34
+ background-color: #324932;
35
+ }
36
+ .highlight .gd {
37
+ color: #ffffff;
38
+ background-color: #493131;
39
+ }
40
+ .highlight .ge {
41
+ color: #000000;
42
+ font-style: italic;
43
+ }
44
+ .highlight .gr {
45
+ color: #aa0000;
46
+ }
47
+ .highlight .gt {
48
+ color: #aa0000;
49
+ }
50
+ .highlight .gh {
51
+ color: #999999;
52
+ }
53
+ .highlight .go {
54
+ color: #888888;
55
+ }
56
+ .highlight .gp {
57
+ color: #555555;
58
+ }
59
+ .highlight .gs {
60
+ font-weight: bold;
61
+ }
62
+ .highlight .gu {
63
+ color: #aaaaaa;
64
+ }
65
+ .highlight .k, .highlight .kv {
66
+ color: #66d9ef;
67
+ font-weight: bold;
68
+ }
69
+ .highlight .kc {
70
+ color: #66d9ef;
71
+ font-weight: bold;
72
+ }
73
+ .highlight .kd {
74
+ color: #66d9ef;
75
+ font-weight: bold;
76
+ }
77
+ .highlight .kp {
78
+ color: #66d9ef;
79
+ font-weight: bold;
80
+ }
81
+ .highlight .kr {
82
+ color: #66d9ef;
83
+ font-weight: bold;
84
+ }
85
+ .highlight .kt {
86
+ color: #66d9ef;
87
+ font-weight: bold;
88
+ }
89
+ .highlight .kn {
90
+ color: #f92672;
91
+ font-weight: bold;
92
+ }
93
+ .highlight .ow {
94
+ color: #f92672;
95
+ font-weight: bold;
96
+ }
97
+ .highlight .o {
98
+ color: #f92672;
99
+ font-weight: bold;
100
+ }
101
+ .highlight .mf {
102
+ color: #ae81ff;
103
+ }
104
+ .highlight .mh {
105
+ color: #ae81ff;
106
+ }
107
+ .highlight .il {
108
+ color: #ae81ff;
109
+ }
110
+ .highlight .mi {
111
+ color: #ae81ff;
112
+ }
113
+ .highlight .mo {
114
+ color: #ae81ff;
115
+ }
116
+ .highlight .m, .highlight .mb, .highlight .mx {
117
+ color: #ae81ff;
118
+ }
119
+ .highlight .se {
120
+ color: #ae81ff;
121
+ }
122
+ .highlight .sb {
123
+ color: #e6db74;
124
+ }
125
+ .highlight .sc {
126
+ color: #e6db74;
127
+ }
128
+ .highlight .sd {
129
+ color: #e6db74;
130
+ }
131
+ .highlight .s2 {
132
+ color: #e6db74;
133
+ }
134
+ .highlight .sh {
135
+ color: #e6db74;
136
+ }
137
+ .highlight .si {
138
+ color: #e6db74;
139
+ }
140
+ .highlight .sx {
141
+ color: #e6db74;
142
+ }
143
+ .highlight .sr {
144
+ color: #e6db74;
145
+ }
146
+ .highlight .s1 {
147
+ color: #e6db74;
148
+ }
149
+ .highlight .ss {
150
+ color: #e6db74;
151
+ }
152
+ .highlight .s {
153
+ color: #e6db74;
154
+ }
155
+ .highlight .na {
156
+ color: #a6e22e;
157
+ }
158
+ .highlight .nc {
159
+ color: #a6e22e;
160
+ font-weight: bold;
161
+ }
162
+ .highlight .nd {
163
+ color: #a6e22e;
164
+ font-weight: bold;
165
+ }
166
+ .highlight .ne {
167
+ color: #a6e22e;
168
+ font-weight: bold;
169
+ }
170
+ .highlight .nf {
171
+ color: #a6e22e;
172
+ font-weight: bold;
173
+ }
174
+ .highlight .no {
175
+ color: #66d9ef;
176
+ }
177
+ .highlight .bp {
178
+ color: #f8f8f2;
179
+ }
180
+ .highlight .nb {
181
+ color: #f8f8f2;
182
+ }
183
+ .highlight .ni {
184
+ color: #f8f8f2;
185
+ }
186
+ .highlight .nn {
187
+ color: #f8f8f2;
188
+ }
189
+ .highlight .vc {
190
+ color: #f8f8f2;
191
+ }
192
+ .highlight .vg {
193
+ color: #f8f8f2;
194
+ }
195
+ .highlight .vi {
196
+ color: #f8f8f2;
197
+ }
198
+ .highlight .nv {
199
+ color: #f8f8f2;
200
+ }
201
+ .highlight .w {
202
+ color: #f8f8f2;
203
+ }
204
+ .highlight .nl {
205
+ color: #f8f8f2;
206
+ font-weight: bold;
207
+ }
208
+ .highlight .nt {
209
+ color: #f92672;
210
+ }
211
+ .highlight {
212
+ color: #f8f8f2;
213
+ background-color: #49483e;
214
+ }
@@ -1,4 +1,4 @@
1
- ---
2
- ---
3
-
4
- @import "app";
1
+ ---
2
+ ---
3
+
4
+ @import "app";
@@ -1,267 +1,267 @@
1
- 'use strict';
2
-
3
- document.addEventListener('DOMContentLoaded', function () {
4
-
5
- // Dropdowns
6
-
7
- var $metalinks = getAll('#meta a');
8
-
9
- if ($metalinks.length > 0) {
10
- $metalinks.forEach(function ($el) {
11
- $el.addEventListener('click', function (event) {
12
- event.preventDefault();
13
- var target = $el.getAttribute('href');
14
- var $target = document.getElementById(target.substring(1));
15
- $target.scrollIntoView(true);
16
- // window.history.replaceState(null, document.title, `${window.location.origin}${window.location.pathname}${target}`);
17
- return false;
18
- });
19
- });
20
- }
21
-
22
- // Dropdowns
23
-
24
- var $dropdowns = getAll('.dropdown:not(.is-hoverable)');
25
-
26
- if ($dropdowns.length > 0) {
27
- $dropdowns.forEach(function ($el) {
28
- $el.addEventListener('click', function (event) {
29
- event.stopPropagation();
30
- $el.classList.toggle('is-active');
31
- });
32
- });
33
-
34
- document.addEventListener('click', function (event) {
35
- closeDropdowns();
36
- });
37
- }
38
-
39
- function closeDropdowns() {
40
- $dropdowns.forEach(function ($el) {
41
- $el.classList.remove('is-active');
42
- });
43
- }
44
-
45
- // Toggles
46
-
47
- var $burgers = getAll('.navbar-burger');
48
-
49
- if ($burgers.length > 0) {
50
- $burgers.forEach(function ($el) {
51
- $el.addEventListener('click', function () {
52
- var target = $el.dataset.target;
53
- var $target = document.getElementById(target);
54
- $el.classList.toggle('is-active');
55
- $target.classList.toggle('is-active');
56
- });
57
- });
58
- }
59
-
60
- // Modals
61
-
62
- var rootEl = document.documentElement;
63
- var $modals = getAll('.modal');
64
- var $modalButtons = getAll('.modal-button');
65
- var $modalCloses = getAll('.modal-background, .modal-close, .modal-card-head .delete, .modal-card-foot .button');
66
-
67
- if ($modalButtons.length > 0) {
68
- $modalButtons.forEach(function ($el) {
69
- $el.addEventListener('click', function () {
70
- var target = $el.dataset.target;
71
- var $target = document.getElementById(target);
72
- rootEl.classList.add('is-clipped');
73
- $target.classList.add('is-active');
74
- });
75
- });
76
- }
77
-
78
- if ($modalCloses.length > 0) {
79
- $modalCloses.forEach(function ($el) {
80
- $el.addEventListener('click', function () {
81
- closeModals();
82
- });
83
- });
84
- }
85
-
86
- document.addEventListener('keydown', function (event) {
87
- var e = event || window.event;
88
- if (e.keyCode === 27) {
89
- closeModals();
90
- closeDropdowns();
91
- }
92
- });
93
-
94
- function closeModals() {
95
- rootEl.classList.remove('is-clipped');
96
- $modals.forEach(function ($el) {
97
- $el.classList.remove('is-active');
98
- });
99
- }
100
-
101
- // Functions
102
-
103
- function getAll(selector) {
104
- return Array.prototype.slice.call(document.querySelectorAll(selector), 0);
105
- }
106
-
107
- // Scrolling
108
-
109
- var shadowedEl = document.getElementById('shadowed');
110
- var navbarEl = document.getElementById('navbar');
111
- var navbarBurger = document.getElementById('navbarBurger');
112
- var specialShadow = document.getElementById('specialShadow');
113
- var NAVBAR_HEIGHT = 52;
114
- var THRESHOLD = 160;
115
- var navbarOpen = false;
116
- var horizon = NAVBAR_HEIGHT;
117
- var whereYouStoppedScrolling = 0;
118
- var scrollFactor = 0;
119
- var currentTranslate = 0;
120
-
121
- navbarBurger.addEventListener('click', function (el) {
122
- navbarOpen = !navbarOpen;
123
-
124
- if (navbarOpen) {
125
- rootEl.classList.add('bd-is-clipped-touch');
126
- shadowedEl.style.display = shadowedEl.style.display == 'none' ? 'block' : 'none';
127
- } else {
128
- rootEl.classList.remove('bd-is-clipped-touch');
129
- shadowedEl.style.display = shadowedEl.style.display == 'none' ? 'block' : 'none';
130
- }
131
- });
132
-
133
- function upOrDown(lastY, currentY) {
134
- if (currentY >= lastY) {
135
- return goingDown(currentY);
136
- }
137
- return goingUp(currentY);
138
- }
139
-
140
- function goingDown(currentY) {
141
- if (!navbarOpen) {
142
- var trigger = NAVBAR_HEIGHT;
143
- whereYouStoppedScrolling = currentY;
144
-
145
- if (currentY > horizon) {
146
- horizon = currentY;
147
- }
148
-
149
- translateHeader(currentY, false);
150
- }
151
- }
152
-
153
- function goingUp(currentY) {
154
- if (!navbarOpen) {
155
- var trigger = 0;
156
-
157
- if (currentY < whereYouStoppedScrolling - NAVBAR_HEIGHT) {
158
- horizon = currentY + NAVBAR_HEIGHT;
159
- }
160
-
161
- translateHeader(currentY, true);
162
- }
163
- }
164
-
165
- function constrainDelta(delta) {
166
- return Math.max(0, Math.min(delta, NAVBAR_HEIGHT));
167
- }
168
-
169
- function translateHeader(currentY, upwards) {
170
- // let topTranslateValue;
171
- var translateValue = void 0;
172
-
173
- if (upwards && currentTranslate == 0) {
174
- translateValue = 0;
175
- } else if (currentY <= NAVBAR_HEIGHT) {
176
- translateValue = currentY * -1;
177
- } else {
178
- var delta = constrainDelta(Math.abs(currentY - horizon));
179
- translateValue = delta - NAVBAR_HEIGHT;
180
- }
181
-
182
- if (translateValue != currentTranslate) {
183
- var navbarStyle = '\n transform: translateY(' + translateValue + 'px);\n ';
184
- currentTranslate = translateValue;
185
- navbarEl.setAttribute('style', navbarStyle);
186
- }
187
-
188
- if (currentY > THRESHOLD * 2) {
189
- scrollFactor = 1;
190
- } else if (currentY > THRESHOLD) {
191
- scrollFactor = (currentY - THRESHOLD) / THRESHOLD;
192
- } else {
193
- scrollFactor = 0;
194
- }
195
-
196
- var translateFactor = 1 + translateValue / NAVBAR_HEIGHT;
197
- specialShadow.style.opacity = scrollFactor;
198
- specialShadow.style.transform = 'scaleY(' + translateFactor + ')';
199
- }
200
-
201
- translateHeader(window.scrollY, false);
202
-
203
- var ticking = false;
204
- var lastY = 0;
205
-
206
- window.addEventListener('scroll', function () {
207
- var currentY = window.scrollY;
208
-
209
- if (!ticking) {
210
- window.requestAnimationFrame(function () {
211
- upOrDown(lastY, currentY);
212
- ticking = false;
213
- lastY = currentY;
214
- });
215
- }
216
-
217
- ticking = true;
218
- });
219
-
220
- // Popup Sharing
221
-
222
- function popupSharing(url, provider) {
223
- return window.open(url, 'Share to ' + provider, 'menubar=1,resizable=1,width=600,height=350')
224
- }
225
-
226
- var $onShare = Array.prototype.slice.call(document.querySelectorAll('.on-share'), 0);
227
- if ($onShare.length > 0) {
228
- $onShare.forEach(function ($el) {
229
- $el.addEventListener('click', function () {
230
- var url = $el.dataset.url;
231
- var provider = $el.dataset.provider;
232
- switch (provider) {
233
- case 'facebook':
234
- return popupSharing('https://www.facebook.com/sharer/sharer.php?u=' + url, provider);
235
- case 'twitter':
236
- return popupSharing('https://twitter.com/intent/tweet?url=' + url, provider);
237
- case 'google':
238
- return popupSharing('https://plus.google.com/share?url=' + url, provider);
239
- case 'pinterest':
240
- return popupSharing('http://pinterest.com/pin/create/button/?url=' + url, provider);
241
- }
242
- });
243
- });
244
- }
245
-
246
- // Heading anchor
247
-
248
- var contentEl = document.getElementsByClassName('content');
249
- for (var el of contentEl) {
250
- [].forEach.call(el.querySelectorAll('h1, h2, h3, h4, h5, h6'), (function (head) {
251
- head.innerHTML = `
252
- <a href="#${head.id}">
253
- ${toHashTag(head.tagName.substring(1))}
254
- </a>
255
- <span>${head.innerText}</span>
256
- `;
257
- }));
258
- }
259
-
260
- function toHashTag(num) {
261
- var hashTags = '';
262
- for(var i = 0; i < num; i++) {
263
- hashTags += '#';
264
- }
265
- return hashTags;
266
- }
267
- });
1
+ 'use strict';
2
+
3
+ document.addEventListener('DOMContentLoaded', function () {
4
+
5
+ // Dropdowns
6
+
7
+ var $metalinks = getAll('#meta a');
8
+
9
+ if ($metalinks.length > 0) {
10
+ $metalinks.forEach(function ($el) {
11
+ $el.addEventListener('click', function (event) {
12
+ event.preventDefault();
13
+ var target = $el.getAttribute('href');
14
+ var $target = document.getElementById(target.substring(1));
15
+ $target.scrollIntoView(true);
16
+ // window.history.replaceState(null, document.title, `${window.location.origin}${window.location.pathname}${target}`);
17
+ return false;
18
+ });
19
+ });
20
+ }
21
+
22
+ // Dropdowns
23
+
24
+ var $dropdowns = getAll('.dropdown:not(.is-hoverable)');
25
+
26
+ if ($dropdowns.length > 0) {
27
+ $dropdowns.forEach(function ($el) {
28
+ $el.addEventListener('click', function (event) {
29
+ event.stopPropagation();
30
+ $el.classList.toggle('is-active');
31
+ });
32
+ });
33
+
34
+ document.addEventListener('click', function (event) {
35
+ closeDropdowns();
36
+ });
37
+ }
38
+
39
+ function closeDropdowns() {
40
+ $dropdowns.forEach(function ($el) {
41
+ $el.classList.remove('is-active');
42
+ });
43
+ }
44
+
45
+ // Toggles
46
+
47
+ var $burgers = getAll('.navbar-burger');
48
+
49
+ if ($burgers.length > 0) {
50
+ $burgers.forEach(function ($el) {
51
+ $el.addEventListener('click', function () {
52
+ var target = $el.dataset.target;
53
+ var $target = document.getElementById(target);
54
+ $el.classList.toggle('is-active');
55
+ $target.classList.toggle('is-active');
56
+ });
57
+ });
58
+ }
59
+
60
+ // Modals
61
+
62
+ var rootEl = document.documentElement;
63
+ var $modals = getAll('.modal');
64
+ var $modalButtons = getAll('.modal-button');
65
+ var $modalCloses = getAll('.modal-background, .modal-close, .modal-card-head .delete, .modal-card-foot .button');
66
+
67
+ if ($modalButtons.length > 0) {
68
+ $modalButtons.forEach(function ($el) {
69
+ $el.addEventListener('click', function () {
70
+ var target = $el.dataset.target;
71
+ var $target = document.getElementById(target);
72
+ rootEl.classList.add('is-clipped');
73
+ $target.classList.add('is-active');
74
+ });
75
+ });
76
+ }
77
+
78
+ if ($modalCloses.length > 0) {
79
+ $modalCloses.forEach(function ($el) {
80
+ $el.addEventListener('click', function () {
81
+ closeModals();
82
+ });
83
+ });
84
+ }
85
+
86
+ document.addEventListener('keydown', function (event) {
87
+ var e = event || window.event;
88
+ if (e.keyCode === 27) {
89
+ closeModals();
90
+ closeDropdowns();
91
+ }
92
+ });
93
+
94
+ function closeModals() {
95
+ rootEl.classList.remove('is-clipped');
96
+ $modals.forEach(function ($el) {
97
+ $el.classList.remove('is-active');
98
+ });
99
+ }
100
+
101
+ // Functions
102
+
103
+ function getAll(selector) {
104
+ return Array.prototype.slice.call(document.querySelectorAll(selector), 0);
105
+ }
106
+
107
+ // Scrolling
108
+
109
+ var shadowedEl = document.getElementById('shadowed');
110
+ var navbarEl = document.getElementById('navbar');
111
+ var navbarBurger = document.getElementById('navbarBurger');
112
+ var specialShadow = document.getElementById('specialShadow');
113
+ var NAVBAR_HEIGHT = 52;
114
+ var THRESHOLD = 160;
115
+ var navbarOpen = false;
116
+ var horizon = NAVBAR_HEIGHT;
117
+ var whereYouStoppedScrolling = 0;
118
+ var scrollFactor = 0;
119
+ var currentTranslate = 0;
120
+
121
+ navbarBurger.addEventListener('click', function (el) {
122
+ navbarOpen = !navbarOpen;
123
+
124
+ if (navbarOpen) {
125
+ rootEl.classList.add('bd-is-clipped-touch');
126
+ shadowedEl.style.display = shadowedEl.style.display == 'none' ? 'block' : 'none';
127
+ } else {
128
+ rootEl.classList.remove('bd-is-clipped-touch');
129
+ shadowedEl.style.display = shadowedEl.style.display == 'none' ? 'block' : 'none';
130
+ }
131
+ });
132
+
133
+ function upOrDown(lastY, currentY) {
134
+ if (currentY >= lastY) {
135
+ return goingDown(currentY);
136
+ }
137
+ return goingUp(currentY);
138
+ }
139
+
140
+ function goingDown(currentY) {
141
+ if (!navbarOpen) {
142
+ var trigger = NAVBAR_HEIGHT;
143
+ whereYouStoppedScrolling = currentY;
144
+
145
+ if (currentY > horizon) {
146
+ horizon = currentY;
147
+ }
148
+
149
+ translateHeader(currentY, false);
150
+ }
151
+ }
152
+
153
+ function goingUp(currentY) {
154
+ if (!navbarOpen) {
155
+ var trigger = 0;
156
+
157
+ if (currentY < whereYouStoppedScrolling - NAVBAR_HEIGHT) {
158
+ horizon = currentY + NAVBAR_HEIGHT;
159
+ }
160
+
161
+ translateHeader(currentY, true);
162
+ }
163
+ }
164
+
165
+ function constrainDelta(delta) {
166
+ return Math.max(0, Math.min(delta, NAVBAR_HEIGHT));
167
+ }
168
+
169
+ function translateHeader(currentY, upwards) {
170
+ // let topTranslateValue;
171
+ var translateValue = void 0;
172
+
173
+ if (upwards && currentTranslate == 0) {
174
+ translateValue = 0;
175
+ } else if (currentY <= NAVBAR_HEIGHT) {
176
+ translateValue = currentY * -1;
177
+ } else {
178
+ var delta = constrainDelta(Math.abs(currentY - horizon));
179
+ translateValue = delta - NAVBAR_HEIGHT;
180
+ }
181
+
182
+ if (translateValue != currentTranslate) {
183
+ var navbarStyle = '\n transform: translateY(' + translateValue + 'px);\n ';
184
+ currentTranslate = translateValue;
185
+ navbarEl.setAttribute('style', navbarStyle);
186
+ }
187
+
188
+ if (currentY > THRESHOLD * 2) {
189
+ scrollFactor = 1;
190
+ } else if (currentY > THRESHOLD) {
191
+ scrollFactor = (currentY - THRESHOLD) / THRESHOLD;
192
+ } else {
193
+ scrollFactor = 0;
194
+ }
195
+
196
+ var translateFactor = 1 + translateValue / NAVBAR_HEIGHT;
197
+ specialShadow.style.opacity = scrollFactor;
198
+ specialShadow.style.transform = 'scaleY(' + translateFactor + ')';
199
+ }
200
+
201
+ translateHeader(window.scrollY, false);
202
+
203
+ var ticking = false;
204
+ var lastY = 0;
205
+
206
+ window.addEventListener('scroll', function () {
207
+ var currentY = window.scrollY;
208
+
209
+ if (!ticking) {
210
+ window.requestAnimationFrame(function () {
211
+ upOrDown(lastY, currentY);
212
+ ticking = false;
213
+ lastY = currentY;
214
+ });
215
+ }
216
+
217
+ ticking = true;
218
+ });
219
+
220
+ // Popup Sharing
221
+
222
+ function popupSharing(url, provider) {
223
+ return window.open(url, 'Share to ' + provider, 'menubar=1,resizable=1,width=600,height=350')
224
+ }
225
+
226
+ var $onShare = Array.prototype.slice.call(document.querySelectorAll('.on-share'), 0);
227
+ if ($onShare.length > 0) {
228
+ $onShare.forEach(function ($el) {
229
+ $el.addEventListener('click', function () {
230
+ var url = $el.dataset.url;
231
+ var provider = $el.dataset.provider;
232
+ switch (provider) {
233
+ case 'facebook':
234
+ return popupSharing('https://www.facebook.com/sharer/sharer.php?u=' + url, provider);
235
+ case 'twitter':
236
+ return popupSharing('https://twitter.com/intent/tweet?url=' + url, provider);
237
+ case 'google':
238
+ return popupSharing('https://plus.google.com/share?url=' + url, provider);
239
+ case 'pinterest':
240
+ return popupSharing('http://pinterest.com/pin/create/button/?url=' + url, provider);
241
+ }
242
+ });
243
+ });
244
+ }
245
+
246
+ // Heading anchor
247
+
248
+ var contentEl = document.getElementsByClassName('content');
249
+ for (var el of contentEl) {
250
+ [].forEach.call(el.querySelectorAll('h1, h2, h3, h4, h5, h6'), (function (head) {
251
+ head.innerHTML = `
252
+ <a href="#${head.id}">
253
+ ${toHashTag(head.tagName.substring(1))}
254
+ </a>
255
+ <span>${head.innerText}</span>
256
+ `;
257
+ }));
258
+ }
259
+
260
+ function toHashTag(num) {
261
+ var hashTags = '';
262
+ for(var i = 0; i < num; i++) {
263
+ hashTags += '#';
264
+ }
265
+ return hashTags;
266
+ }
267
+ });