-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilm.html
631 lines (610 loc) · 26.3 KB
/
film.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
<!DOCTYPE html><html lang="en">
<head><meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"><title>Film - Harry Kilian</title>
<meta name="description" content="Personal blog to post experiments.
">
<link rel="canonical" href="http://localhost:4000/film.html"><link rel="alternate" type="application/rss+xml" title="Harry Kilian" href="http://localhost:4000/feed.xml">
<!-- for Safari on iOS https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/app-icon/ --><link rel="apple-touch-icon" sizes="180x180" href="/assets/images/logo/icon-180x180.png"><link rel="apple-touch-icon" sizes="167x167" href="/assets/images/logo/icon-167x167.png"><link rel="apple-touch-icon" sizes="152x152" href="/assets/images/logo/icon-152x152.png"><link rel="apple-touch-icon" sizes="120x120" href="/assets/images/logo/icon-120x120.png"><link rel="shortcut icon" href="/assets/images/logo/icon-120x120.png">
<!-- for Chrome on Android https://developer.chrome.com/multidevice/android/installtohomescreen -->
<meta name="mobile-web-app-capable" content="yes"><link rel="icon" sizes="192x192" href="/assets/images/logo/icon-192x192.png">
<!-- for Edge on Windows 10 https://msdn.microsoft.com/en-us/library/dn255024(v=vs.85).aspx --><meta name="msapplication-TileImage" content="/assets/images/logo/icon-144x144.png"><meta name="msapplication-square310x310logo" content="/assets/images/logo/icon-310x310.png"><meta name="msapplication-wide310x150logo" content="/assets/images/logo/icon-310x150.png"><meta name="msapplication-square150x150logo" content="/assets/images/logo/icon-150x150.png"><meta name="msapplication-square70x70logo" content="/assets/images/logo/icon-70x70.png">
<meta name="msapplication-TileColor" content="#eeeeee">
<link rel="stylesheet" href="/assets/css/blog.css">
<script>(function() {
window.isArray = function(val) {
return Object.prototype.toString.call(val) === '[object Array]';
};
window.isString = function(val) {
return typeof val === 'string';
};
window.decodeUrl = function(str) {
return str ? decodeURIComponent(str.replace(/\+/g, '%20')) : '';
};
window.hasEvent = function(event) {
return 'on'.concat(event) in window.document;
};
window.pageLoad = (function () {
var loaded = false, cbs = [];
window.addEventListener('load', function () {
var i, cb; loaded = true;
if (cbs.length > 0) {
for (i = 0; i < cbs.length; i++) {
cb = cbs[i]; cb();
}
}
});
return {
then: function(cb) {
cb && (loaded ? cb() : (cbs.push(cb)));
}
};
})();
})();(function() {
window.throttle = function(func, wait) {
var args, result, thisArg, timeoutId, lastCalled = 0;
function trailingCall() {
lastCalled = new Date;
timeoutId = null;
result = func.apply(thisArg, args);
}
return function() {
var now = new Date,
remaining = wait - (now - lastCalled);
args = arguments;
thisArg = this;
if (remaining <= 0) {
clearTimeout(timeoutId);
timeoutId = null;
lastCalled = now;
result = func.apply(thisArg, args);
} else if (!timeoutId) {
timeoutId = setTimeout(trailingCall, remaining);
}
return result;
};
};
})();(function() {
var Set = (function() {
var add = function(item) {
var i, data = this._data;
for (i = 0; i < data.length; i++) {
if (data[i] === item) {
return;
}
}
this.size ++;
data.push(item);
return data;
};
var Set = function(data) {
this.size = 0;
this._data = [];
var i;
if (data.length > 0) {
for (i = 0; i < data.length; i++) {
add.call(this, data[i]);
}
}
};
Set.prototype.add = add;
Set.prototype.get = function(index) { return this._data[index]; };
Set.prototype.has = function(item) {
var i, data = this._data;
for (i = 0; i < data.length; i++) {
if (this.get(i) === item) {
return true;
}
}
return false;
};
Set.prototype.is = function(map) {
if (map._data.length !== this._data.length) { return false; }
var i, j, flag, tData = this._data, mData = map._data;
for (i = 0; i < tData.length; i++) {
for (flag = false, j = 0; j < mData.length; j++) {
if (tData[i] === mData[j]) {
flag = true;
break;
}
}
if (!flag) { return false; }
}
return true;
};
Set.prototype.values = function() {
return this._data;
};
return Set;
})();
window.Lazyload = (function(doc) {
var queue = {js: [], css: []}, sources = {js: {}, css: {}}, context = this;
var createNode = function(name, attrs) {
var node = doc.createElement(name), attr;
for (attr in attrs) {
if (attrs.hasOwnProperty(attr)) {
node.setAttribute(attr, attrs[attr]);
}
}
return node;
};
var end = function(type, url) {
var s, q, qi, cbs, i, j, cur, val, flag;
if (type === 'js' || type ==='css') {
s = sources[type], q = queue[type];
s[url] = true;
for (i = 0; i < q.length; i++) {
cur = q[i];
if (cur.urls.has(url)) {
qi = cur, val = qi.urls.values();
qi && (cbs = qi.callbacks);
for (flag = true, j = 0; j < val.length; j++) {
cur = val[j];
if (!s[cur]) {
flag = false;
}
}
if (flag && cbs && cbs.length > 0) {
for (j = 0; j < cbs.length; j++) {
cbs[j].call(context);
}
qi.load = true;
}
}
}
}
};
var load = function(type, urls, callback) {
var s, q, qi, node, i, cur,
_urls = typeof urls === 'string' ? new Set([urls]) : new Set(urls), val, url;
if (type === 'js' || type ==='css') {
s = sources[type], q = queue[type];
for (i = 0; i < q.length; i++) {
cur = q[i];
if (_urls.is(cur.urls)) {
qi = cur;
break;
}
}
val = _urls.values();
if (qi) {
callback && (qi.load || qi.callbacks.push(callback));
callback && (qi.load && callback());
} else {
q.push({
urls: _urls,
callbacks: callback ? [callback] : [],
load: false
});
for (i = 0; i < val.length; i++) {
node = null, url = val[i];
if (s[url] === undefined) {
(type === 'js' ) && (node = createNode('script', { src: url }));
(type === 'css') && (node = createNode('link', { rel: 'stylesheet', href: url }));
if (node) {
node.onload = (function(type, url) {
return function() {
end(type, url);
};
})(type, url);
(doc.head || doc.body).appendChild(node);
s[url] = false;
}
}
}
}
}
};
return {
js: function(url, callback) {
load('js', url, callback);
},
css: function(url, callback) {
load('css', url, callback);
}
};
})(this.document);
})();</script>
</head>
<body>
<div class="m-page-stage js-page-stage">
<div class="m-page-content"><header class="m-page-header">
<div class="main clearfix">
<div class='site-logo'><a title="Personal blog to post experiments.
" href="/">Harry Kilian</a></div>
<nav>
<ul><li><a href="/games.html">Games</a></li><li><a href="/film.html">Film</a></li><li><a href="/modelmaking.html">Model Making</a></li><li><a href="/about.html">About</a></li><li><a href="/all.html">All</a></li>
</ul>
</nav>
</div>
</header>
<div class="m-page-main"><div class="m-post">
<div class="main clearfix js-main">
<div class="col-2 js-col-2">
<aside class="js-article-aside"><div class="m-toc js-toc"></div></aside>
</div>
<div class="col-1">
<article class="js-article" itemscope itemtype="http://schema.org/BlogPosting">
<meta itemprop="mainEntityOfPage" itemscope itemType="https://schema.org/WebPage"/>
<header class="main-header"><h1 itemprop="headline" itemprop="name headline">Film</h1><div class="m-article-info clearfix"><meta itemprop="author" itemscope itemtype="https://schema.org/Person"><meta itemprop="name" content="Harry Kilian"/></meta><div class="other-wrapper"><div class="date-wrapper"><time class="article-meta" datetime=""
itemprop="datePublished">
</time></div>
</div>
</div>
</header>
<div class="m-article-content js-article-content" itemprop="articleBody"><h2 id="life">Life</h2>
<p><img src="/assets/projects/thumbs/life-poster.png" alt="screenshot" height="190px" width="190px" class="rounded" />
<img src="/assets/projects/thumbs/lifewindows.png" alt="screenshot" height="190px" width="190px" class="rounded" />
<img src="/assets/projects/thumbs/lifepods.png" alt="screenshot" height="190px" width="190px" class="rounded" />
<img src="/assets/projects/thumbs/lifecapsule.png" alt="screenshot" height="190px" width="190px" class="rounded" /></p>
<p>Most of my 2016 was spent in the fabrications department of ‘Life’. The film is set in the near future on-board the international space station.
We were tasked with building the set and props for what that might look like. Drawing inspiration from the existing space station but adding elements you might expect in a sci-fi.</p>
<h2 id="fantastic-beasts-and-where-to-find-them">Fantastic Beasts and Where To Find Them</h2>
<p><img src="/assets/projects/thumbs/beasts-poster.png" alt="screenshot" height="190px" width="190px" class="rounded" />
<img src="/assets/projects/thumbs/beasts-wreck.png" alt="screenshot" height="190px" width="190px" class="rounded" />
<img src="/assets/projects/thumbs/beasts-elevator.png" alt="screenshot" height="190px" width="190px" class="rounded" />
<img src="/assets/projects/thumbs/beasts-tower.png" alt="screenshot" height="190px" width="190px" class="rounded" /></p>
<p>For a year I worked in the special effects department for Warner Brothers on ‘Fantastic Beasts’.
Among many things we built a working elevator for the interior of the Magical Congress.
We built hundreds of destructable props for the scenes featuring the Niffler and Occamy.
We also built several prop cars for the final destruction scene, where Credence destroys part of the city and a 40ft collapsing tower for when the Erumpent escapes the zoo.</p>
<h2 id="the-legend-of-tarzan">The Legend Of Tarzan</h2>
<p><img src="/assets/projects/thumbs/tarzan-poster.png" alt="screenshot" height="190px" width="190px" class="rounded" />
<img src="/assets/projects/thumbs/tarzan-jane.png" alt="screenshot" height="190px" width="190px" class="rounded" />
<img src="/assets/projects/thumbs/tarzan-forest.png" alt="screenshot" height="190px" width="190px" class="rounded" />
<img src="/assets/projects/thumbs/tarzan-crew.png" alt="screenshot" height="190px" width="190px" class="rounded" />.</p>
<p>I worked on ‘The Legend Of Tarzan’ for a period of about 6 months in the props and plants department.
The large majority of ‘Tarzan’ was shot inside the stages at the Warner Brothers studios in Leavesden, so we had to create an entirely fake, but convincing jungle.</p>
</div>
<footer><meta itemprop="dateModified" content=""></footer>
</article>
<div class="article-previous-next clearfix"></div></div>
</div>
</div></div>
</div>
</div><div class="m-page-footer js-page-footer">
<div class="main">
<aside><div class="follow-me">
<ul itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="Harry Kilian"><link itemprop="url" href="http://localhost:4000/"><li title="Follow me on Twitter.">
<a class="floating-action-round-button twitter" itemprop="sameAs" href="https://twitter.com/gooses_" target="_blank">
<div class="icon"><svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path d="M1024.032 194.432c-37.664 16.704-78.176 28-120.672 33.088 43.36-26.016 76.672-67.168 92.384-116.224-40.608 24.064-85.568 41.568-133.408 50.976-38.336-40.832-92.928-66.336-153.344-66.336-116.032 0-210.08 94.048-210.08 210.08 0 16.48 1.856 32.512 5.44 47.872-174.592-8.768-329.408-92.416-433.024-219.52-18.08 31.04-28.448 67.104-28.448 105.632 0 72.896 37.088 137.184 93.472 174.88-34.432-1.088-66.816-10.528-95.168-26.272-0.032 0.864-0.032 1.76-0.032 2.656 0 101.792 72.416 186.688 168.512 205.984-17.632 4.8-36.192 7.36-55.36 7.36-13.536 0-26.688-1.312-39.52-3.776 26.72 83.456 104.32 144.192 196.256 145.888-71.904 56.352-162.496 89.92-260.928 89.92-16.96 0-33.664-0.992-50.112-2.944 92.96 59.616 203.392 94.4 322.048 94.4 386.432 0 597.728-320.128 597.728-597.76 0-9.12-0.192-18.176-0.608-27.168 41.056-29.632 76.672-66.624 104.832-108.736z" />
</svg>
</div>
</a>
</li><li title="Follow me on Github.">
<a class="floating-action-round-button github" itemprop="sameAs" href="https://github.com/hkilian" target="_blank">
<div class="icon"><svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path class="svgpath" data-index="path_0" fill="#272636" d="M0 525.2c0 223.6 143.3 413.7 343 483.5 26.9 6.8 22.8-12.4 22.8-25.4l0-88.7c-155.3 18.2-161.5-84.6-172-101.7-21.1-36-70.8-45.2-56-62.3 35.4-18.2 71.4 4.6 113.1 66.3 30.2 44.7 89.1 37.2 119 29.7 6.5-26.9 20.5-50.9 39.7-69.6C248.8 728.2 181.7 630 181.7 513.2c0-56.6 18.7-108.7 55.3-150.7-23.3-69.3 2.2-128.5 5.6-137.3 66.5-6 135.5 47.6 140.9 51.8 37.8-10.2 80.9-15.6 129.1-15.6 48.5 0 91.8 5.6 129.8 15.9 12.9-9.8 77-55.8 138.8-50.2 3.3 8.8 28.2 66.7 6.3 135 37.1 42.1 56 94.6 56 151.4 0 117-67.5 215.3-228.8 243.7 26.9 26.6 43.6 63.4 43.6 104.2l0 128.8c0.9 10.3 0 20.5 17.2 20.5C878.1 942.4 1024 750.9 1024 525.3c0-282.9-229.3-512-512-512C229.1 13.2 0 242.3 0 525.2L0 525.2z" />
</svg>
</div>
</a>
</li><li title="Follow me on Linkedin.">
<a class="floating-action-round-button linkedin" itemprop="sameAs" href="https://www.linkedin.com/in/harry-kilian-9b000930" target="_blank">
<div class="icon"><svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path d="M260.096 155.648c0 27.307008-9.899008 50.516992-29.696 69.632-19.796992 19.115008-45.396992 28.672-76.8 28.672-30.036992 0-54.612992-9.556992-73.728-28.672-19.115008-19.115008-28.672-42.324992-28.672-69.632 0-28.672 9.556992-52.224 28.672-70.656 19.115008-18.432 44.372992-27.648 75.776-27.648 31.403008 0 56.32 9.216 74.752 27.648 18.432 18.432 28.331008 41.984 29.696 70.656 0 0 0 0 0 0m-202.752 808.96c0 0 0-632.832 0-632.832 0 0 196.608 0 196.608 0 0 0 0 632.832 0 632.832 0 0-196.608 0-196.608 0 0 0 0 0 0 0m313.344-430.08c0-58.708992-1.364992-126.292992-4.096-202.752 0 0 169.984 0 169.984 0 0 0 10.24 88.064 10.24 88.064 0 0 4.096 0 4.096 0 40.96-68.267008 105.812992-102.4 194.56-102.4 68.267008 0 123.220992 22.868992 164.864 68.608 41.643008 45.739008 62.464 113.664 62.464 203.776 0 0 0 374.784 0 374.784 0 0-196.608 0-196.608 0 0 0 0-350.208 0-350.208 0-91.476992-33.451008-137.216-100.352-137.216-47.787008 0-81.236992 24.576-100.352 73.728-4.096 8.192-6.144 24.576-6.144 49.152 0 0 0 364.544 0 364.544 0 0-198.656 0-198.656 0 0 0 0-430.08 0-430.08 0 0 0 0 0 0" />
</svg></div>
</a>
</li></ul></div>
</aside>
<footer class="site-info">
<p>© Harry Kilian 2015 - 2017</p>
<p>Powered by <a title="Jekyll is a simple, blog-aware, static site generator." href="http://jekyllrb.com/">Jekyll</a> & <a
title="TeXt is a succinct theme for blogging." href="https://github.com/kitian616/jekyll-TeXt-theme">TeXt Theme</a>.</p>
</footer>
</div>
</div><script>(function () {
var $body = document.body;
function classnames(classes) {
var i, cur, _classes = '';
if (window.isString(classes)) {
_classes = classes;
} else if (window.isArray(classes)) {
for (i = 0; i < classes.length; i++) {
cur = classes[i];
if (window.isString(cur)) {
_classes = _classes.concat(_classes ? ' ' + cur : cur);
}
}
} else {
return '';
}
return _classes;
}
function addClass(dom, classname) {
dom.setAttribute('class', classnames([dom.getAttribute('class'), classname]));
}
if (window.hasEvent('touchstart')) {
addClass($body, 'is-touch');
document.addEventListener('touchstart', function(){}, false);
} else {
addClass($body, 'not-touch');
}
})();</script><script>
(function() {
var TEXT_VARIABLES = {
sources: {
jquery: 'https://cdn.bootcss.com/jquery/3.1.1/jquery.min.js',
leancloud_js_sdk: '//cdn1.lncld.net/static/js/3.4.1/av-min.js',
chart: 'https://cdn.bootcss.com/Chart.js/2.7.1/Chart.bundle.min.js',
gitalk: {
js: 'https://cdn.bootcss.com/gitalk/1.2.2/gitalk.min.js',
css: 'https://cdn.bootcss.com/gitalk/1.2.2/gitalk.min.css'
},
mathjax: 'https://cdn.bootcss.com/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML',
mermaid: 'https://cdn.bootcss.com/mermaid/7.1.2/mermaid.min.js'
},
site: {
toc: {
selectors: 'h1,h2,h3'
}
}
};
window.TEXT_VARIABLES = TEXT_VARIABLES;
})();
</script><script>(function() {
var SOURCES = window.TEXT_VARIABLES.sources;
function scrollAnimateTo(destination, duration, callback) {
var $body = $('html, body'), bodyScrollTop = $body.scrollTop();
if(bodyScrollTop === destination) { return; }
$body.animate({ scrollTop: destination }, duration, callback);
}
window.scrollTopAnchor = function(anchor, callback) {
scrollAnimateTo($(anchor).offset().top, 400, function() {
window.history.replaceState(null, '', window.location.href.split('#')[0] + anchor);
callback && callback();
});
};
window.Lazyload.js(SOURCES.jquery, function() {
var $articleContent = $('.m-post, .m-page').find('.m-article-content'), $this;
$articleContent.children('.highlight').each(function() {
$this = $(this);
$this.attr('data-lang', $this.find('code').attr('data-lang'));
});
$articleContent.children('h1, h2, h3, h4, h5, h6').each(function() {
$this = $(this);
$this.append($('<a class="anchor" aria-hidden="true"></a>').html('<svg fill="#000000" width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>'));
});
$articleContent.on('click', '.anchor', function() {
window.scrollTopAnchor('#' + $(this).parent().attr('id'));
});
});
})();(function() {
var SOURCES = window.TEXT_VARIABLES.sources;
window.Lazyload.js(SOURCES.jquery, function() {
var $window = $(window), $document = $(window.document), $root;
var rootTop, rootLeft, rootHeight, scrollBottom, rootBottomTop, lastScrollTop;
var offsetBottom = 0, disabled = false, hasInit = false;
function setOptions(options) {
var _options = options || {};
_options.offsetBottom && (offsetBottom = _options.offsetBottom);
_options.disabled !== undefined && (disabled = _options.disabled);
calc(true);
}
function initData() {
top();
var rootOffset = $root.offset();
rootHeight = $root.outerHeight();
rootTop = rootOffset.top;
rootLeft = rootOffset.left;
}
function calc(needInitData) {
needInitData && initData();
scrollBottom = $document.outerHeight() - offsetBottom - rootHeight;
rootBottomTop = scrollBottom - rootTop;
}
function top() {
$root.removeClass('fixed').css({
left: 0,
top: 0
});
}
function fixed() {
$root.addClass('fixed').css({
left: rootLeft + 'px',
top: 0
});
}
function bottom() {
$root.removeClass('fixed').css({
left: 0,
top: rootBottomTop + 'px'
});
}
function setState(force) {
force !== true && (force = false);
var scrollTop = $window.scrollTop();
if (scrollTop >= rootTop && scrollTop <= scrollBottom) {
(!force && lastScrollTop >= rootTop && lastScrollTop <= scrollBottom) || fixed();
} else if (scrollTop < rootTop) {
(!force && lastScrollTop < rootTop) || top();
} else {
(!force && lastScrollTop > scrollBottom) || bottom();
}
lastScrollTop = scrollTop;
}
function init() {
if(!hasInit) {
var interval, timeout;
calc(true); setState();
// run calc every 1.5 seconds
interval = setInterval(function() {
calc();
}, 1500);
timeout = setTimeout(function() {
clearInterval(interval);
}, 50000);
window.pageLoad.then(function() {
clearInterval(interval);
clearTimeout(timeout);
});
$window.on('scroll', function() {
disabled || setState();
});
$window.on('resize', window.throttle(function() {
disabled || (calc(true), setState(true));
}, 100));
hasInit = true;
}
}
function affix(options) {
$root = this;
setOptions(options);
if (!disabled) {
init();
}
$window.on('resize', window.throttle(function() {
init();
}, 200));
return {
setOptions: setOptions
};
}
$.fn.affix = affix;
});
})();(function() {
var SOURCES = window.TEXT_VARIABLES.sources;
window.Lazyload.js(SOURCES.jquery, function() {
var $window = $(window), $root, $tocUl = $('<ul></ul>'), $tocLi, $headings, $activeLast, $activeCur;
var selectors = 'h1,h2,h3', container = 'body', disabled = false;
var headingsPos, scrolling = false, rendered = false, hasInit = false;
function setOptions(options) {
var _options = options || {};
_options.selectors && (selectors = _options.selectors);
_options.container && (container = _options.container);
_options.disabled !== undefined && (disabled = _options.disabled);
$headings = $(container).find(selectors);
calc();
}
function calc() {
headingsPos = [];
$headings.each(function() {
headingsPos.push(Math.floor($(this).offset().top));
});
}
function setState(element, disabled) {
var scrollTop = $window.scrollTop(), i;
if (disabled || !headingsPos || headingsPos.length < 1) { return; }
if (element) {
$activeCur = element;
} else {
for (i = 0; i < headingsPos.length; i++) {
if (scrollTop >= headingsPos[i]) {
$activeCur = $tocLi.eq(i);
} else {
$activeCur || ($activeCur = $tocLi.eq(i));
break;
}
}
}
$activeLast && $activeLast.removeClass('toc-active');
($activeLast = $activeCur).addClass('toc-active');
}
function render() {
if(!rendered) {
$root.append($tocUl);
$headings.each(function() {
var $this = $(this);
$tocUl.append($('<li></li>').addClass('toc-' + $this.prop('tagName').toLowerCase())
.append($('<a></a>').text($this.text()).attr('href', '#' + $this.prop('id'))));
});
$tocLi = $tocUl.children('li');
$tocUl.on('click', 'a', function(e) {
e.preventDefault();
var $this = $(this);
scrolling = true;
setState($this.parent());
window.scrollTopAnchor($this.attr('href'), function() {
scrolling = false;
});
});
}
rendered = true;
}
function init() {
var interval, timeout;
if(!hasInit) {
render(); calc(); setState(null, scrolling);
// run calc every 1.5 seconds
interval = setInterval(function() {
calc();
}, 1500);
timeout = setTimeout(function() {
clearInterval(interval);
}, 50000);
window.pageLoad.then(function() {
clearInterval(interval);
clearTimeout(timeout);
});
$window.on('scroll', function() {
disabled || setState(null, scrolling);
});
$window.on('resize', window.throttle(function() {
if (!disabled) {
render(); calc(); setState(null, scrolling);
}
}, 100));
}
hasInit = true;
}
function toc(options) {
$root = this;
setOptions(options);
if (!disabled) {
init();
}
$window.on('resize', window.throttle(function() {
init();
}, 200));
return {
setOptions: setOptions
};
}
toc.setOptions = setOptions;
$.fn.toc = toc;
});
})();(function() {
var SOURCES = window.TEXT_VARIABLES.sources;
var TOC_SELECTOR = window.TEXT_VARIABLES.site.toc.selectors;
window.Lazyload.js(SOURCES.jquery, function() {
var $window = $(window);
var $pageStage = $('.js-page-stage');
var $pageFooter = $('.js-page-footer');
var $articleContent = $('.js-article-content');
var $articleAside = $('.js-article-aside');
var $toc = $('.js-toc');
var $col2 = $('.js-col-2');
var toc, affix;
var hasToc = $articleContent.find(TOC_SELECTOR).length > 0;
var tocDisabled = false;
function disabled() {
return $col2.css('display') === 'none' || !hasToc;
}
$window.on('resize', window.throttle(function() {
tocDisabled = disabled();
toc && toc.setOptions({
disabled: tocDisabled
});
affix && affix.setOptions({
disabled: tocDisabled
});
}, 100));
if (hasToc) {
!$pageStage.hasClass('has-toc') && $pageStage.addClass('has-toc');
}
tocDisabled = disabled();
setTimeout(function() {
toc = $toc.toc({
selectors: TOC_SELECTOR,
container: $articleContent,
disabled: tocDisabled
});
affix = $articleAside.affix({
offsetBottom: $pageFooter.outerHeight(),
disabled: tocDisabled
});
}, 1000);
});
})();</script></body>
</html>