PageSourceSearch

https://www.wenkenhof.ch/extras/js/2023-05-22/animations.js

js wenkenhof.ch collected 2026-10-08 02:52:46 UTC 29,096 bytes, 772 lines download raw bytes

vendor: 5,446 bytes, lines 1-3
1/*! modernizr 3.5.0 (Custom Build) | MIT *
2 * https://modernizr.com/download/?-cssanimations-csstransforms3d-csstransitions-eventlistener-flexbox-objectfit-opacity-queryselector !*/
3 !function(e,t,n){function r(e,t){return typeof e===t}function i(){var e,t,n,i,s,o,a;for(var l in g)if(g.hasOwnProperty(l)){if(e=[],t=g[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(i=r(t.fn,"function")?t.fn():t.fn,s=0;s<e.length;s++)o=e[s],a=o.split("."),1===a.length?Modernizr[a[0]]=i:(!Modernizr[a[0]]||Modernizr[a[0]]instanceof Boolean||(Modernizr[a[0]]=new Boolean(Modernizr[a[0]])),Modernizr[a[0]][a[1]]=i),S.push((i?"":"no-")+a.join("-"))}}function s(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function o(e,t){return!!~(""+e).indexOf(t)}function a(e,t){return function(){return e.apply(t,arguments)}}function l(e,t,n){var i;for(var s in e)if(e[s]in t)return n===!1?e[s]:(i=t[e[s]],r(i,"function")?a(i,n||t):i);return!1}function f(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):E?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function u(){var e=t.body;return e||(e=f(E?"svg":"body"),e.fake=!0),e}function d(e,n,r,i){var s,o,a,l,d="modernizr",p=f("div"),c=u();if(parseInt(r,10))for(;r--;)a=f("div"),a.id=i?i[r]:d+(r+1),p.appendChild(a);return s=f("style"),s.type="text/css",s.id="s"+d,(c.fake?c:p).appendChild(s),c.appendChild(p),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(t.createTextNode(e)),p.id=d,c.fake&&(c.style.background="",c.style.overflow="hidden",l=x.style.overflow,x.style.overflow="hidden",x.appendChild(c)),o=n(p,e),c.fake?(c.parentNode.removeChild(c),x.style.overflow=l,x.offsetHeight):p.parentNode.removeChild(p),!!o}function p(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function c(t,n,r){var i;if("getComputedStyle"in e){i=getComputedStyle.call(e,t,n);var s=e.console;if(null!==i)r&&(i=i.getPropertyValue(r));else if(s){var o=s.error?"error":"log";s[o].call(s,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else i=!n&&t.currentStyle&&t.currentStyle[r];return i}function m(t,r){var i=t.length;if("CSS"in e&&"supports"in e.CSS){for(;i--;)if(e.CSS.supports(p(t[i]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var s=[];i--;)s.push("("+p(t[i])+":"+r+")");return s=s.join(" or "),d("@supports ("+s+") { #modernizr { position: absolute; } }",function(e){return"absolute"==c(e,null,"position")})}return n}function v(e,t,i,a){function l(){d&&(delete q.style,delete q.modElem)}if(a=r(a,"undefined")?!1:a,!r(i,"undefined")){var u=m(e,i);if(!r(u,"undefined"))return u}for(var d,p,c,v,y,h=["modernizr","tspan","samp"];!q.style&&h.length;)d=!0,q.modElem=f(h.shift()),q.style=q.modElem.style;for(c=e.length,p=0;c>p;p++)if(v=e[p],y=q.style[v],o(v,"-")&&(v=s(v)),q.style[v]!==n){if(a||r(i,"undefined"))return l(),"pfx"==t?v:!0;try{q.style[v]=i}catch(g){}if(q.style[v]!=y)return l(),"pfx"==t?v:!0}return l(),!1}function y(e,t,n,i,s){var o=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+T.join(o+" ")+o).split(" ");return r(t,"string")||r(t,"undefined")?v(a,t,i,s):(a=(e+" "+P.join(o+" ")+o).split(" "),l(a,t,n))}function h(e,t,r){return y(e,n,n,t,r)}var g=[],C={_version:"3.5.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){g.push({name:e,fn:t,options:n})},addAsyncTest:function(e){g.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=C,Modernizr=new Modernizr,Modernizr.addTest("eventlistener","addEventListener"in e),Modernizr.addTest("queryselector","querySelector"in t&&"querySelectorAll"in t);var S=[],x=t.documentElement,w="CSS"in e&&"supports"in e.CSS,_="supportsCSS"in e;Modernizr.addTest("supports",w||_);var b="Moz O ms Webkit",T=C._config.usePrefixes?b.split(" "):[];C._cssomPrefixes=T;var z=function(t){var r,i=A.length,s=e.CSSRule;if("undefined"==typeof s)return n;if(!t)return!1;if(t=t.replace(/^@/,""),r=t.replace(/-/g,"_").toUpperCase()+"_RULE",r in s)return"@"+t;for(var o=0;i>o;o++){var a=A[o],l=a.toUpperCase()+"_"+r;if(l in s)return"@-"+a.toLowerCase()+"-"+t}return!1};C.atRule=z;var P=C._config.usePrefixes?b.toLowerCase().split(" "):[];C._domPrefixes=P;var E="svg"===x.nodeName.toLowerCase(),k=C.testStyles=d,j={elem:f("modernizr")};Modernizr._q.push(function(){delete j.elem});var q={style:j.elem.style};Modernizr._q.unshift(function(){delete q.style}),C.testAllProps=y,C.testAllProps=h,Modernizr.addTest("cssanimations",h("animationName","a",!0)),Modernizr.addTest("flexbox",h("flexBasis","1px",!0)),Modernizr.addTest("csstransforms3d",function(){var e=!!h("perspective","1px",!0),t=Modernizr._config.usePrefixes;if(e&&(!t||"webkitPerspective"in x.style)){var n,r="#modernizr{width:0;height:0}";Modernizr.supports?n="@supports (perspective: 1px)":(n="@media (transform-3d)",t&&(n+=",(-webkit-transform-3d)")),n+="{#modernizr{width:7px;height:18px;margin:0;padding:0;border:0}}",k(r+n,function(t){e=7===t.offsetWidth&&18===t.offsetHeight})}return e}),Modernizr.addTest("csstransitions",h("transition","all",!0));var L=C.prefixed=function(e,t,n){return 0===e.indexOf("@")?z(e):(-1!=e.indexOf("-")&&(e=s(e)),t?y(e,t,n
3):y(e,"pfx"))};Modernizr.addTest("objectfit",!!L("objectFit"),{aliases:["object-fit"]});var A=C._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];C._prefixes=A,Modernizr.addTest("opacity",function(){var e=f("a").style;return e.cssText=A.join("opacity:.55;"),/^0.55$/.test(e.opacity)}),i(),delete C.addTest,delete C.addAsyncTest;for(var N=0;N<Modernizr._q.length;N++)Modernizr._q[N]();e.Modernizr=Modernizr}(window,document);
4
5// override to modify scroll offset on narrow devices for pages
6// that have a parallax image at the beginning
7CmsboxNavigationScroll._scroll_animated = function(page_or_element, duration, event) {
8	var self = this;
9	var element = page_or_element;
10	var offset = 0 - self._fixed_offset - self._elastic_offset(element);
11	if(element.querySelector('.rellax') && window.innerWidth < 1024) {
12		element = page_or_element.querySelector('h1');
13		offset = -window.innerHeight / 4;
14	}
15	Effect.ScrollTo(element, {
16		offset: offset,
17		duration: duration,
18		transition: self._transition,
19		afterFinish: function() {
20			self._on_scroll_to_page(self._page(page_or_element), event);
21			self._jumping = false;
22		}
23	});
24};
25CmsboxNavigationScroll._scroll = function(page_or_element, event) {
26	var self = this;
27	var element = page_or_element;
28	var offset = Element.cumulativeOffset(element);
29	if(element.querySelector('.rellax') && window.innerWidth < 1024) {
30		element = page_or_element.querySelector('h1');
31		offset = Element.cumulativeOffset(element);
32		offset[1] -= window.innerHeight / 4;
33	}
34	window.scrollTo(offset[0], offset[1] - self._fixed_offset - self._elastic_offset(element, offset));
35	self._on_scroll_to_page(self._page(page_or_element), event);
36	self._jumping = false;
37  }
38
39Cmsbox.animate = function(node, classNames, animationName, options) {
40	var eventNames = {
41		'WebkitTransition' : 'webkitAnimationEnd',
42		'MozTransition': 'mozAnimationEnd',
43		'OperaAnimation': 'oanimationend',
44		'MSAnimation': 'MSAnimationEnd',
45		'animation' : 'animationend'
46	};
47	var eventName = eventNames[ Modernizr.prefixed('animation') ];
48	this.basicAnimate(node, classNames, animationName, eventName, options || {});
49};
50Cmsbox.transition = function(node, classNames, options) {
51	var eventNames = {
52		'WebkitTransition' : 'webkitTransitionEnd',
53		'MozTransition' : 'transitionend',
54		'OperaTransition': 'oTransitionEnd',
55		'msTransitionEnd': 'msTransitionEnd',
56		'transition' : 'transitionend'
57	};
58	var eventName = eventNames[ Modernizr.prefixed('transition') ];
59	this.basicAnimate(node, classNames, null, eventName, options || {});
60};
61Cmsbox.basicAnimate = function(node, classNames, animationName, endEventName, options) {
62	if(!CBAnimations.animationsEnabled) {
63		return;
64	}
65	var delay = 'delay' in options ? options.delay : 0;
66	var beforeCallback = 'beforeCallback' in options ? options.beforeCallback : null;
67	var afterCallback = 'afterCallback' in options ? options.afterCallback : null;
68
69	var handlers = [];
70	var animator = function() {
71		if(beforeCallback) {
72			beforeCallback(node);
73		}
74		classNames.forEach(function(className) {
75			node.classList.add(className);
76		});
77	};
78	if(delay > 0) {
79		window.setTimeout(animator, delay);
80	} else {
81		animator();
82	}
83	var currentHandler = {
84		executor: function(event) {
85			handlers.forEach(function(storedHandler) {
86				// only check this for animations, not for transitions; transitions have no name
87				// it would be possible to check `transitionName` but that only specifies the
88				// animated property (e.g. `background-color`), which may be ambiguous
89				if(storedHandler.animationName && event.animationName != storedHandler.animationName) {
90					return;
91				}
92				storedHandler.node.removeEventListener(storedHandler.eventName, storedHandler.executor);
93				if(event.type == storedHandler.eventName && storedHandler.afterCallback) {
94					storedHandler.afterCallback(storedHandler.node);
95				}
96			});
97		},
98		node: node,
99		classNames: classNames,
100		eventName: endEventName,
101		animationName: animationName,
102		afterCallback: afterCallback
103	};
104	handlers.push(currentHandler);
105	node.addEventListener(endEventName, currentHandler.executor);
106};
107
108CBAnimations = function() {
109	document.addEventListener('DOMContentLoaded', function() {
110		if(!(Modernizr.eventlistener && Modernizr.queryselector && Modernizr.cssanimations &&
111			Modernizr.flexbox && Modernizr.objectfit && Modernizr.opacity &&
112			Modernizr.csstransforms3d && Modernizr.csstransitions)) {
113		document.body.classList.add('notsupported');
114		return;
115	}
116		document.body.classList.add('loading');
117	});
118	window.addEventListener('load', this.setup.bind(this));
119	CBAnimations.animationsEnabled = true;
120};
121CBAnimations.prototype = {
122	invisibleClassName: 'hide-after-animation',
123	parallaxClassName: 'rellax',
124	disableParallaxClassName: 'no-parallax',
125	fixedContentClassName: 'fixcontent',
126	textLikeElementsSelector: '.cb-page-title, .maincontent .part.text, .maincontent .part.goto , .maincontent .part.site, .maincontent .part.show',
127	downLinkSelector: '.maincontent .part.doit a.open',
128	pageSelector: '.cb-page',
129	pageLoadedClassName: 'loaded',
130	breakPoint: 1024,
131	rellax: null,
132
133	setup: function() {
134		this.showPageWhenLoaded();
135		if(document.body.id != 'view' ||
136				/MSIE [6-9]/.test(navigator.userAgent)) {
137			return;
138		}
139		if(window.innerWidth < this.breakPoint ||
140				'disableAnimations' in window) {
141			CBAnimations.animationsEnabled = false;
142		}
143		this.setupParallax();
144		this.setupAnimations();
145		//this.setupImpressionsCaption();
146		this.installResizeHandler();
147	},
148	setupParallax: function() {
149		var self = this;
150		if(document.querySelector('.' + self.parallaxClassName)) {
151			if(self.rellax) {
152				self.rellax.destroy();
153			}
154			self.rellax = new Rellax(
155				'.' + self.parallaxClassName,
156				{
157					speed: window.innerWidth < 1024 ? -1 : 10,
158					center: true
159				}
160			);
161		}
162	},
163	setupAnimations: function() {
164		if(document.querySelector('.cb-page-layout4, .cb-page-layout7')) {
165			this.animateImpressions();
166		} else if(document.querySelector('.cb-page-layout5, .cb-page-layout6')) {
167			this.animateSinglePage();
168		} else {
169			this.animateOnePage();
170		}
171	},
172	animateOnePage: function() {
173		this.animateBackgroundColor();
174		this.disableFixedPositionForParallax();
175		this.hideAnimatedElements();
176		this.animateTextLikeElements();
177		this.animateDownLinks();
178		this.animateFixedImages();
179	},
180	setupImpressionsCaption: function() {
181		document.querySelectorAll('.cb-page-layout4').forEach(function(page, index) {
182			if(index = 1) {
183				document.querySelector('.legend').innerText = page.querySelector('.pict img').title;
184			}
185			new Waypoint({
186				element: page,
187				handler: function(direction) {
188					if (direction !== 'down') {
189						return;
190					}
191					document.querySelector('.legend').innerText = page.querySelector('.pict img').title;
192				},
193				offset: '30%'
194			});
195			new Waypoint({
196				element: page,
197				handler: function(direction) {
198					if (direction !== 'up') {
199						return;
200					}
201					document.querySelector('.legend').innerText = page.querySelector('.pict img').title;
202				},
203				offset: '-40%'
204			});
205		});
206	},
207
208	// animation functions
209	animateBackgroundColor: function() {
210		var createWayPoints = function(page) {
211			var self = this;
212			new Waypoint({
213				element: page,
214				handler: function(direction) {
215					if (direction !== 'down') {
216						return;
217					}
218					self.animateBackgroundColorOf(this.element);
219				},
220				offset: '100%'
221			});
222			new Waypoint({
223				element: page,
224				handler: function(direction) {
225					if (direction !== 'up') {
226						return;
227					}
228					var pages = [].slice.call(this.element.parentNode.querySelectorAll('.cb-page'));
229					var previousPage = pages[Math.max(0, pages.indexOf(this.element) - 1)];
230					self.animateBackgroundColorOf(previousPage);
231				},
232				offset: '100%'
233			});
234		};
235
236		document.querySelectorAll(this.pageSelector).forEach(createWayPoints, this);
237	},
238	animateTextLikeElements: function() {
239		var createWayPoints = function(element) {
240			var self = this;
241			if (element.closest('.cb-invisible')) {
242				element.classList.remove(self.invisibleClassName)
243				return
244			}
245			new Waypoint({
246				element: element,
247				handler: function(direction) {
248					if (direction !== 'down') {
249						return;
250					}
251					Cmsbox.animate(this.element, ['animated', 'fadeInUp'], 'fadeInUp',
252						{
253							beforeCallback: function(node) {
254								node.classList.remove('animated', 'fadeOutDown', 'fadeInDown');
255							},
256							afterCallback: function(node) {
257								node.classList.remove('animated', 'fadeInUp', self.invisibleClassName);
258							}
259						}
260					);
261				},
262				offset: function() {
263					return window.innerHeight - 50;
264				}
265			});
266			new Waypoint({
267				element: element,
268				handler: function(direction) {
269					if (direction !== 'down') {
270						return;
271					}
272					Cmsbox.animate(this.element, ['animated', 'fadeOutUp'], 'fadeOutUp',
273						{
274							beforeCallback: function(node) {
275								node.classList.remove('animated', 'fadeOutDown', 'fadeInDown');
276							},
277							afterCallback: function(node) {
278								node.classList.remove('animated', 'fadeOutUp');
279								node.classList.add(self.invisibleClassName);
280							}
281						}
282					);
283				},
284				offset: function() {
285					return -this.element.getHeight() + this.element.getHeight() / 3;
286				}
287			});
288			new Waypoint({
289				element: element,
290				handler: function(direction) {
291					if (direction !== 'up') {
292						return;
293					}
294					Cmsbox.animate(this.element, ['animated', 'fadeInDown'], 'fadeInDown',
295						{
296							beforeCallback: function(node) {
297								node.classList.remove('animated', 'fadeOutUp', 'fadeInUp');
298							},
299							afterCallback: function(node) {
300								node.classList.remove('animated', 'fadeInDown', self.invisibleClassName);
301							}
302						}
303					);
304				},
305				offset: function() {
306					return -this.element.getHeight() + this.element.getHeight() / 3;
307				}
308			});
309			new Waypoint({
310				element: element,
311				handler: function(direction) {
312					if (direction !== 'up') {
313						return;
314					}
315					Cmsbox.animate(this.element, ['animated', 'fadeOutDown'], 'fadeOutDown',
316						{
317							beforeCallback: function(node) {
318								node.classList.remove('animated', 'fadeOutUp', 'fadeInUp');
319							},
320							afterCallback: function(node) {
321								node.classList.remove('animated', 'fadeOutDown');
322								node.classList.add(self.invisibleClassName);
323							}
324						}
325					);
326				},
327				offset: function() {
328					return window.innerHeight - 50;
329				}
330			});
331		}
332
333		document.querySelectorAll(this.textLikeElementsSelector).forEach(createWayPoints, this);
334	},
335	animateDownLinks: function() {
336		var createWayPoints = function(element) {
337			var self = this;
338			new Waypoint({
339				element: element,
340				handler: function(direction) {
341					if (direction !== 'down') {
342						return;
343					}
344					Cmsbox.animate(this.element, ['animated', 'bounceInDownLink'], 'bounceInDownLink',
345						{
346							beforeCallback: function(node) {
347								node.classList.remove('animated', 'fadeOutDown');
348							},
349							afterCallback: function(node) {
350								node.classList.remove('animated', 'bounceInDownLink', self.invisibleClassName);
351							}
352						}
353					);
354				},
355				offset: function() {
356					return window.innerHeight - 50;
357				}
358			});
359			new Waypoint({
360				element: element,
361				handler: function(direction) {
362					if (direction !== 'down') {
363						return;
364					}
365					Cmsbox.animate(this.element, ['animated', 'fadeOutUp'], 'fadeOutUp',
366						{
367							beforeCallback: function(node) {
368								node.classList.remove('animated', 'bounceInDownLink');
369							},
370							afterCallback: function(node) {
371								node.classList.remove('animated', 'fadeOutUp');
372								node.classList.add(self.invisibleClassName);
373							}
374						}
375					);
376				},
377				offset: 50
378			});
379			new Waypoint({
380				element: element,
381				handler: function(direction) {
382					if (direction !== 'up') {
383						return;
384					}
385					Cmsbox.animate(this.element, ['animated', 'bounceInDownLink'], 'bounceInDownLink',
386						{
387							beforeCallback: function(node) {
388								node.classList.remove('animated', 'fadeOutUp');
389							},
390							afterCallback: function(node) {
391								node.classList.remove('animated', 'bounceInDownLink', self.invisibleClassName);
392							}
393						}
394					);
395				},
396				offset: 50
397			});
398			new Waypoint({
399				element: element,
400				handler: function(direction) {
401					if (direction !== 'up') {
402						return;
403					}
404					Cmsbox.animate(this.element, ['animated', 'fadeOutDown'], 'fadeOutDown',
405						{
406							beforeCallback: function(node) {
407								node.classList.remove('animated', 'bounceInDownLink');
408							},
409							afterCallback: function(node) {
410								node.classList.remove('animated', 'fadeOutDown');
411								node.classList.add(self.invisibleClassName);
412							}
413						}
414					);
415				},
416				offset: function() {
417					return window.innerHeight - 50;
418				}
419			});
420		};
421
422		document.querySelectorAll(this.downLinkSelector).forEach(createWayPoints, this);
423	},
424	animateFixedImages: function() {
425		var self = this;
426		var createWayPoints = function(page) {
427			var imageContainer = page.querySelector('.' + this.fixedContentClassName + '.' + this.disableParallaxClassName);
428			if(!imageContainer) {
429				return;
430			}
431			new Waypoint({
432				element: page,
433				handler: function(direction) {
434					if (direction !== 'down') {
435						return;
436					}
437					var className = 'fadeInRight';
438					if(this.element.classList.contains('cb-page-layout2')) {
439						className = 'fadeInLeft';
440					}
441					Cmsbox.animate(imageContainer, ['animated', className], className,
442						{
443							beforeCallback: function(node) {
444								node.classList.remove(self.invisibleClassName, 'animated', 'fadeOutLeft', 'fadeOutRight');
445							},
446							afterCallback: function(node) {
447								node.classList.remove('animated', className);
448							}
449						}
450					);
451				},
452				offset: function() {
453					return window.innerHeight / 2;
454				}
455			});
456			new Waypoint({
457				element: page,
458				handler: function(direction) {
459					if (direction !== 'down') {
460						return;
461					}
462					var className = 'fadeOutRight';
463					if(this.element.classList.contains('cb-page-layout2')) {
464						className = 'fadeOutLeft';
465					}
466					Cmsbox.animate(imageContainer, ['animated', className], className,
467						{
468							beforeCallback: function(node) {
469								node.classList.remove('animated', 'fadeInLeft', 'fadeInRight');
470							},
471							afterCallback: function(node) {
472								node.classList.remove('animated', className);
473								node.classList.add(self.invisibleClassName);
474							}
475						}
476					);
477				},
478				offset: function() {
479					return -window.innerHeight / 2;
480				}
481			});
482			new Waypoint({
483				element: page,
484				handler: function(direction) {
485					if (direction !== 'up') {
486						return;
487					}
488					var className = 'fadeInRight';
489					if(this.element.classList.contains('cb-page-layout2')) {
490						className = 'fadeInLeft';
491					}
492					Cmsbox.animate(imageContainer, ['animated', className], className,
493						{
494							beforeCallback: function(node) {
495								node.classList.remove(self.invisibleClassName, 'animated', 'fadeOutLeft', 'fadeOutRight');
496							},
497							afterCallback: function(node) {
498								node.classList.remove('animated', className);
499							}
500						}
501					);
502				},
503				offset: function() {
504					return -window.innerHeight / 2;
505				}
506			});
507			new Waypoint({
508				element: page,
509				handler: function(direction) {
510					if (direction !== 'up') {
511						return;
512					}
513					var className = 'fadeOutRight';
514					if(this.element.classList.contains('cb-page-layout2')) {
515						className = 'fadeOutLeft';
516					}
517					Cmsbox.animate(imageContainer, ['animated', className], className,
518						{
519							beforeCallback: function(node) {
520								node.classList.remove('animated', 'fadeInLeft', 'fadeInRight');
521							},
522							afterCallback: function(node) {
523								node.classList.remove('animated', className);
524								node.classList.add(self.invisibleClassName);
525							}
526						}
527					);
528				},
529				offset: function() {
530					return window.innerHeight / 2;
531				}
532			});
533		};
534
535		document.querySelectorAll(this.pageSelector).forEach(createWayPoints, this);
536	},
537	animateSinglePage: function() {
538		var self = this;
539		var page = document.querySelector('.cb-page');
540		page.querySelectorAll('.cb-page-title, .maincontent .part, .fixcontent').forEach(function(element) {
541			element.classList.add(self.invisibleClassName);
542		});
543		new Waypoint({
544			element: page,
545			handler: function(direction) {
546				if (direction === 'down') {
547					this.element.querySelectorAll('.cb-page-title, .maincontent .part').forEach(function(node, index) {
548						Cmsbox.animate(node, ['animated', 'fadeInUp'], 'fadeInUp',
549							{
550								afterCallback: function(node) {
551									node.classList.remove('animated', 'fadeInUp', self.invisibleClassName);
552								}
553							}
554						);
555					});
556				}
557			},
558			offset: '50%'
559		});
560		new Waypoint({
561			element: page,
562			handler: function(direction) {
563				if (direction === 'down') {
564					var className = 'fadeInRight';
565					if(page.classList.contains('cb-page-layout2')) {
566						className = 'fadeInLeft';
567					}
568					[].slice.call(this.element.querySelectorAll('.' + self.fixedContentClassName)).reverse().forEac
568h(function(node, index) {
569						Cmsbox.animate(node, ['animated', className], className,
570							{
571								beforeCallback: function(node) {
572									node.classList.remove(self.invisibleClassName);
573								},
574								afterCallback: function(node) {
575									node.classList.remove('animated', className);
576								}
577							}
578						);
579					});
580				}
581			},
582			offset: '50%'
583		});
584	},
585	animateImpressions: function() {
586		document.querySelectorAll('.cb-page').forEach(function(page) {
587			var self = this;
588			page.classList.add(self.invisibleClassName);
589			new Waypoint({
590				element: page,
591				handler: function(direction) {
592					if(direction !== 'down') {
593						return;
594					}
595					Cmsbox.animate(this.element, ['animated', 'fadeIn'], 'fadeIn',
596						{
597							beforeCallback: function(node) {
598								node.classList.remove('animated', 'fadeOut');
599							},
600							afterCallback: function(node) {
601								node.classList.remove('animated', 'fadeIn', self.invisibleClassName);
602							}
603						}
604					);
605				},
606				offset: function() {
607					return window.innerHeight / 2;
608				}
609			});
610			new Waypoint({
611				element: page,
612				handler: function(direction) {
613					if(direction !== 'down') {
614						return;
615					}
616					Cmsbox.animate(this.element, ['animated', 'fadeOut'], 'fadeOut',
617						{
618							beforeCallback: function(node) {
619								node.classList.remove('animated', 'fadeIn');
620							},
621							afterCallback: function(node) {
622								node.classList.remove('animated', 'fadeOut');
623								node.classList.add(self.invisibleClassName);
624							}
625						}
626					);
627				},
628				offset: function() {
629					return -window.innerHeight / 2;
630				}
631			});
632			new Waypoint({
633				element: page,
634				handler: function(direction) {
635					if(direction !== 'up') {
636						return;
637					}
638					Cmsbox.animate(this.element, ['animated', 'fadeOut'], 'fadeOut',
639						{
640							beforeCallback: function(node) {
641								node.classList.remove('animated', 'fadeIn');
642							},
643							afterCallback: function(node) {
644								node.classList.remove('animated', 'fadeOut');
645								node.classList.add(self.invisibleClassName);
646							}
647						}
648					);
649				},
650				offset: function() {
651					return window.innerHeight / 2;
652				}
653			});
654			new Waypoint({
655				element: page,
656				handler: function(direction) {
657					if(direction !== 'up') {
658						return;
659					}
660					Cmsbox.animate(this.element, ['animated', 'fadeIn'], 'fadeIn',
661						{
662							beforeCallback: function(node) {
663								node.classList.remove('animated', 'fadeOut');
664							},
665							afterCallback: function(node) {
666								node.classList.remove('animated', 'fadeIn', self.invisibleClassName);
667							}
668						}
669					);
670				},
671				offset: function() {
672					return -window.innerHeight / 2;
673				}
674			});
675		}, this);
676	},
677
678	animateBackgroundColorOf: function(element) {
679		const colors = Object.entries({
680			'cb-page-color-c1': 'bg-is-c1',
681			'cb-page-color-c2': 'bg-is-c2',
682			'cb-page-color-c3': 'bg-is-c3'
683		}).map(([ pageClassName, colorClassName ]) => ({ pageClassName, colorClassName }))
684		const colorIndex = colors.findIndex(({ pageClassName }) => element.classList.contains(pageClassName))
685		const matchingColor = colors.splice(colorIndex, 1)[0]
686
687		Cmsbox.transition(
688			document.querySelector('.background-color'),
689			[ matchingColor.colorClassName ],
690			{
691				beforeCallback: function(node) {
692					node.classList.remove(...colors.map(color => color.colorClassName));
693				}
694			}
695		);
696	},
697
698	// helper functions
699	showPageWhenLoaded: function() {
700		document.body.classList.add(this.pageLoadedClassName);
701		document.body.classList.remove('loading');
702	},
703	disableFixedPositionForParallax: function() {
704		document.querySelectorAll('.' + this.fixedContentClassName).forEach(function(node) {
705			if(!node.querySelector('.' + this.parallaxClassName)) {
706				node.classList.add(this.disableParallaxClassName);
707			}
708		}, this);
709	},
710	hideAnimatedElements: function() {
711		document.querySelectorAll(this.textLikeElementsSelector + ', .' + this.fixedContentClassName + '.' + this.disableParallaxClassName).forEach(function(element) {
712			element.classList.add(this.invisibleClassName);
713		}, this);
714	},
715	installResizeHandler: function() {
716		var self = this;
717		window.addEventListener('resize', function(event) {
718			CBAnimations.animationsEnabled = window.innerWidth >= self.breakPoint &&
719				!('disableAnimations' in window);
720			if(self.resizeTimeout) {
721				clearTimeout(self.resizeTimeout);
722			}
723			self.resizeTimeout = setTimeout(
724				function() {
725					if(CBAnimations.animationsEnabled) {
726						Waypoint.refreshAll();
727					} else {
728						// ensure that styling the background with CSS is not crippled by other classes
729						document.querySelector('.background-color').classList.remove('bg-is-c1', 'bg-is-c2', 'bg-is-c3');
730					}
731					self.setupParallax();
732				},
733				// This large timeout is a workaround. For some reason, when refreshing waypoints while
734				// other thigs are going on, the `top` property of getBoundingClientRect() will
735				// hold a value that is much too large. Hence, the waypoints will trigger at a very different
736				// position. I haven't been able to figure out the exact cause.
737				1000
738			);
739			document.querySelectorAll('.' + self.fixedContentClassName + '.' + self.disableParallaxClassName).forEach(function(container) {
740				var elementBounds = container.parentNode.parentNode.getBoundingClientRect();
741				if(elementBounds.top > window.innerHeight / 2 || elementBounds.top < -window.innerHeight / 2) {
742					container.classList.add(self.invisibleClassName);
743				} else {
744					container.classList.remove(self.invisibleClassName);
745				}
746			});
747			self.animateBackgroundColorOf(document.querySelector('.cb-page-selected'));
748			var callback = function(node) {
749				var clientRect = node.getBoundingClientRect();
750				if(clientRect.top <= window.innerHeight - 50 &&
751						clientRect.top >= -clientRect.height + clientRect.height / 3) {
752					node.classList.remove(self.invisibleClassName);
753				} else {
754					node.classList.add(self.invisibleClassName);
755				}
756			};
757			document.querySelector('.cb-page-selected').querySelectorAll(self.textLikeElementsSelector).forEach(callback);
758
759			callback = function(node) {
760				var clientRect = node.getBoundingClientRect();
761				if(clientRect.top <= window.innerHeight - 50 &&
762						clientRect.top >= 50) {
763					node.classList.remove(self.invisibleClassName);
764				} else {
765					node.classList.add(self.invisibleClassName);
766				}
767			};
768			document.querySelector('.cb-page-selected').querySelectorAll(self.downLinkSelector).forEach(callback);
769		});
770	}
771};
772new CBAnimations();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.