...
 
Commits (1)
......@@ -2,16 +2,19 @@
{%- include "header.html" %}
{%- include "menu.html" %}
<div class="container char-selection">
<div class="row">
{%- for char, label in chars.items()|sort(attribute=1) %}
<a href="{{ char }}">
{%- if char != "CMN" %}
<img src="assets/chars/{{ char|lower }}.png" class="char-img" alt="{{ char }}"/>
<img data-src="assets/chars/{{ char|lower }}.png" class="char-img lazy" alt="{{ char }}"/>
{%- endif %}
<span class="char-label">{{ label }}</span>
</a>
{%- endfor %}
</div>
</div>
<script>
var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.LazyLoad=t()}(this,function(){"use strict";function e(e,t,n){return!(i(e,t,n)||l(e,t,n)||r(e,t,n)||a(e,t,n))}var t=function(){return{elements_selector:"img",container:window,threshold:300,throttle:150,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_initial:"initial",skip_invisible:!0,callback_load:null,callback_error:null,callback_set:null,callback_processed:null,callback_enter:null,to_webp:!1}},n=function(e,t){e&&e(t)},o=function(e){return e.getBoundingClientRect().top+window.pageYOffset-e.ownerDocument.documentElement.clientTop},i=function(e,t,n){return(t===window?window.innerHeight+window.pageYOffset:o(t)+t.offsetHeight)<=o(e)-n},s=function(e){return e.getBoundingClientRect().left+window.pageXOffset-e.ownerDocument.documentElement.clientLeft},r=function(e,t,n){var o=window.innerWidth;return(t===window?o+window.pageXOffset:s(t)+o)<=s(e)-n},l=function(e,t,n){return(t===window?window.pageYOffset:o(t))>=o(e)+n+e.offsetHeight},a=function(e,t,n){return(t===window?window.pageXOffset:s(t))>=s(e)+n+e.offsetWidth},c=function(e,t){var n,o=new e(t);try{n=new CustomEvent("LazyLoad::Initialized",{detail:{instance:o}})}catch(e){(n=document.createEvent("CustomEvent")).initCustomEvent("LazyLoad::Initialized",!1,!1,{instance:o})}window.dispatchEvent(n)},u=function(e,t){return e.getAttribute("data-"+t)},d=function(e,t,n){return e.setAttribute("data-"+t,n)},f=function(e){return d(e,"was-processed","true")},_=function(e){return"true"===u(e,"was-processed")},h=function(e,t){return t?e.replace(/\.(jpe?g|png)/gi,".webp"):e},p="undefined"!=typeof window,m=p&&!("onscroll"in window)||/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),g=p&&"classList"in document.createElement("p"),v=p&&function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))&&0===e.toDataURL("image/webp").indexOf("data:image/webp")}(),w=function(e,t,n,o){for(var i,s=0;i=e.children[s];s+=1)if("SOURCE"===i.tagName){var r=u(i,n);b(i,t,r,o)}},b=function(e,t,n,o){n&&e.setAttribute(t,h(n,o))},y=function(e,t){var n=v&&t.to_webp,o=u(e,t.data_src);if(o){var i=h(o,n);e.style.backgroundImage='url("'+i+'")'}},E={IMG:function(e,t){var n=v&&t.to_webp,o=t.data_srcset,i=e.parentNode;i&&"PICTURE"===i.tagName&&w(i,"srcset",o,n);var s=u(e,t.data_sizes);b(e,"sizes",s);var r=u(e,o);b(e,"srcset",r,n);var l=u(e,t.data_src);b(e,"src",l,n)},IFRAME:function(e,t){var n=u(e,t.data_src);b(e,"src",n)},VIDEO:function(e,t){var n=t.data_src,o=u(e,n);w(e,"src",n),b(e,"src",o)}},L=function(e,t){var n=e.tagName,o=E[n];o?o(e,t):y(e,t)},T=function(e,t){g?e.classList.add(t):e.className+=(e.className?" ":"")+t},S=function(e,t){g?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},O=function(e){this._settings=_extends({},t(),e),this._queryOriginNode=this._settings.container===window?document:this._settings.container,this._previousLoopTime=0,this._loopTimeout=null,this._boundHandleScroll=this.handleScroll.bind(this),this._isFirstLoop=!0,window.addEventListener("resize",this._boundHandleScroll),this.update()};return O.prototype={_reveal:function(e,t){if(t||!_(e)){var o=this._settings,i=function t(){o&&(e.removeEventListener("load",s),e.removeEventListener("error",t),S(e,o.class_loading),T(e,o.class_error),n(o.callback_error,e))},s=function t(){o&&(S(e,o.class_loading),T(e,o.class_loaded),e.removeEventListener("load",t),e.removeEventListener("error",i),n(o.callback_load,e))};n(o.callback_enter,e),["IMG","IFRAME","VIDEO"].indexOf(e.tagName)>-1&&(e.addEventListener("load",s),e.addEventListener("error",i),T(e,o.class_loading)),L(e,o),n(o.callback_set,e)}},_loopThroughElements:function(t){var o=this._settings,i=this._elements,s=i?i.length:0,r=void 0,l=[],a=this._isFirstLoop;for(r=0;r<s;r++){var c=i[r];o.skip_invisible&&null===c.offsetParent||(m||t||e(c,o.container,o.threshold))&&(a&&T(c,o.class_initial),this.load(c),l.push(r),f(c))}for(;l.length;)i.splice(l.pop(),1),n(o.callback_processed,i.length);0===s&&this._stopScrollHandler(),a&&(this._isFirstLoop=!1)},_purgeElements:function(){var e=this._elements,t=e.length,n=void 0,o=[];for(n=0;n<t;n++){var i=e[n];_(i)&&o.push(n)}for(;o.length>0;)e.splice(o.pop(),1)},_startScrollHandler:function(){this._isHandlingScroll||(this._isHandlingScroll=!0,this._settings.container.addEventListener("scroll",this._boundHandleScroll))},_stopScrollHandler:function(){this._isHandlingScroll&&(this._isHandlingScroll=!1,this._settings.container.removeEventListener("scroll",this._boundHandleScroll))},handleScroll:function(){var e=this._settings.throttle;if(0!==e){var t=Date.now(),n=e-(t-this._previousLoopTime);n<=0||n>e?(this._loopTimeout&&(clearTimeout(this._loopTimeout),this._loopTimeout=null),this._previousLoopTime=t,this._loopThroughElements()):this._loopTimeout||(this._loopTimeout=setTimeout(function(){this._previousLoopTime=Date.now(),this._loopTimeout=null,this._loopThroughElements()}.bind(this),n))}else this._loopThroughElements()},loadAll:function(){this._loopThroughElements(!0)},update:function(){this._elements=Array.prototype.slice.call(this._queryOriginNode.querySelectorAll(this._settings.elements_selector)),this._purgeElements(),this._loopThroughElements(),this._startScrollHandler()},destroy:function(){window.removeEventListener("resize",this._boundHandleScroll),this._loopTimeout&&(clearTimeout(this._loopTimeout),this._loopTimeout=null),this._stopScrollHandler(),this._elements=null,this._queryOriginNode=null,this._settings=null},load:function(e,t){this._reveal(e,t)}},p&&function(e,t){if(t)if(t.length)for(var n,o=0;n=t[o];o+=1)c(e,n);else c(e,t)}(O,window.lazyLoadOptions),O});
new LazyLoad({elements_selector: ".lazy"});
</script>
{%- include "footer.html" %}
\ No newline at end of file