Verified Commit c93ef2f6 authored by Maxim Lebedev's avatar Maxim Lebedev 🔀

Improved performance by assets minify

parent 27fe7a5c
......@@ -3,5 +3,5 @@
font-family: 'Inter';
font-style: normal;
font-weight: 400;
src: url('/fonts/inter.ttf') format('truetype');
src: url('{{ (resources.Get "fonts/inter.ttf").RelPermalink }}') format('truetype');
}
var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function r(t){t.forEach(e)}function o(t){return"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function c(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}let l;function i(t){l=t}const u=[],s=[],d=[],f=[],h=Promise.resolve();let m=!1;function p(t){d.push(t)}let $=!1;const g=new Set;function b(){if(!$){$=!0;do{for(let t=0;t<u.length;t+=1){const e=u[t];i(e),y(e.$$)}for(u.length=0;s.length;)s.pop()();for(let t=0;t<d.length;t+=1){const e=d[t];g.has(e)||(g.add(e),e())}d.length=0}while(u.length);for(;f.length;)f.pop()();m=!1,$=!1,g.clear()}}function y(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(p)}}const _=new Set;function x(t,e){-1===t.$$.dirty[0]&&(u.push(t),m||(m=!0,h.then(b)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function v(a,c,u,s,d,f,h=[-1]){const m=l;i(a);const $=c.props||{},g=a.$$={fragment:null,ctx:null,props:f,update:t,not_equal:d,bound:n(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(m?m.$$.context:[]),callbacks:n(),dirty:h};let y=!1;var v,L;g.ctx=u?u(a,$,(t,e,...n)=>{const r=n.length?n[0]:e;return g.ctx&&d(g.ctx[t],g.ctx[t]=r)&&(g.bound[t]&&g.bound[t](r),y&&x(a,t)),e}):[],g.update(),y=!0,r(g.before_update),g.fragment=!!s&&s(g.ctx),c.target&&(c.hydrate?g.fragment&&g.fragment.l(function(t){return Array.from(t.childNodes)}(c.target)):g.fragment&&g.fragment.c(),c.intro&&((v=a.$$.fragment)&&v.i&&(_.delete(v),v.i(L))),function(t,n,a){const{fragment:c,on_mount:l,on_destroy:i,after_update:u}=t.$$;c&&c.m(n,a),p(()=>{const n=l.map(e).filter(o);i?i.push(...n):r(n),t.$$.on_mount=[]}),u.forEach(p)}(a,c.target,c.anchor),b()),i(m)}function L(e){let n,r,o,a=(e[2]?e[0]:e[1])+"";return{c(){var t,o;t="button",n=document.createElement(t),o=a,r=document.createTextNode(o),c(n,"class","button button_type_theme-switcher"),c(n,"role","switch"),c(n,"aria-checked",e[2])},m(t,a){var c,l,i,u;!function(t,e,n){t.insertBefore(e,n||null)}(t,n,a),function(t,e){t.appendChild(e)}(n,r),c=n,l="click",i=e[4],c.addEventListener(l,i,u),o=()=>c.removeEventListener(l,i,u)},p(t,[e]){7&e&&a!==(a=(t[2]?t[0]:t[1])+"")&&function(t,e){e=""+e,t.data!==e&&(t.data=e)}(r,a),4&e&&c(n,"aria-checked",t[2])},i:t,o:t,d(t){var e;t&&(e=n).parentNode.removeChild(e),o()}}}function w(t,e,n){let{enabledLabel:r="Dark theme"}=e,{disabledLabel:o="Light theme"}=e;var a="true"===localStorage.getItem("ThemeSwitch")||!localStorage.getItem("ThemeSwitch")&&matchMedia("(prefers-color-scheme: dark)").matches;let c=document.documentElement.style;return t.$set=t=>{"enabledLabel"in t&&n(0,r=t.enabledLabel),"disabledLabel"in t&&n(1,o=t.disabledLabel)},t.$$.update=()=>{4&t.$$.dirty&&localStorage.setItem("ThemeSwitch",a),4&t.$$.dirty&&c.setProperty("--filter",a?100:0)},[r,o,a,c,()=>n(2,a=!a)]}return{ThemeSwitcher:class extends class{$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(){}}{constructor(t){super(),v(this,t,w,L,a,{enabledLabel:0,disabledLabel:1})}}}}();
//# sourceMappingURL=bundle.js.map
var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function r(t){t.forEach(e)}function o(t){return"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function c(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}let l;function i(t){l=t}const u=[],s=[],d=[],f=[],h=Promise.resolve();let m=!1;function p(t){d.push(t)}let $=!1;const g=new Set;function b(){if(!$){$=!0;do{for(let t=0;t<u.length;t+=1){const e=u[t];i(e),y(e.$$)}for(u.length=0;s.length;)s.pop()();for(let t=0;t<d.length;t+=1){const e=d[t];g.has(e)||(g.add(e),e())}d.length=0}while(u.length);for(;f.length;)f.pop()();m=!1,$=!1,g.clear()}}function y(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(p)}}const _=new Set;function x(t,e){-1===t.$$.dirty[0]&&(u.push(t),m||(m=!0,h.then(b)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function v(a,c,u,s,d,f,h=[-1]){const m=l;i(a);const $=c.props||{},g=a.$$={fragment:null,ctx:null,props:f,update:t,not_equal:d,bound:n(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(m?m.$$.context:[]),callbacks:n(),dirty:h};let y=!1;var v,L;g.ctx=u?u(a,$,(t,e,...n)=>{const r=n.length?n[0]:e;return g.ctx&&d(g.ctx[t],g.ctx[t]=r)&&(g.bound[t]&&g.bound[t](r),y&&x(a,t)),e}):[],g.update(),y=!0,r(g.before_update),g.fragment=!!s&&s(g.ctx),c.target&&(c.hydrate?g.fragment&&g.fragment.l(function(t){return Array.from(t.childNodes)}(c.target)):g.fragment&&g.fragment.c(),c.intro&&((v=a.$$.fragment)&&v.i&&(_.delete(v),v.i(L))),function(t,n,a){const{fragment:c,on_mount:l,on_destroy:i,after_update:u}=t.$$;c&&c.m(n,a),p(()=>{const n=l.map(e).filter(o);i?i.push(...n):r(n),t.$$.on_mount=[]}),u.forEach(p)}(a,c.target,c.anchor),b()),i(m)}function L(e){let n,r,o,a=(e[2]?e[0]:e[1])+"";return{c(){var t,o;t="button",n=document.createElement(t),o=a,r=document.createTextNode(o),c(n,"class","button button_type_theme-switcher"),c(n,"role","switch"),c(n,"aria-checked",e[2])},m(t,a){var c,l,i,u;!function(t,e,n){t.insertBefore(e,n||null)}(t,n,a),function(t,e){t.appendChild(e)}(n,r),c=n,l="click",i=e[4],c.addEventListener(l,i,u),o=()=>c.removeEventListener(l,i,u)},p(t,[e]){7&e&&a!==(a=(t[2]?t[0]:t[1])+"")&&function(t,e){e=""+e,t.data!==e&&(t.data=e)}(r,a),4&e&&c(n,"aria-checked",t[2])},i:t,o:t,d(t){var e;t&&(e=n).parentNode.removeChild(e),o()}}}function w(t,e,n){let{enabledLabel:r="{{ i18n "theme_dark" }}"}=e,{disabledLabel:o="{{ i18n "theme_light" }}"}=e;var a="true"===localStorage.getItem("ThemeSwitch")||!localStorage.getItem("ThemeSwitch")&&matchMedia("(prefers-color-scheme: dark)").matches;let c=document.documentElement.style;return t.$set=t=>{"enabledLabel"in t&&n(0,r=t.enabledLabel),"disabledLabel"in t&&n(1,o=t.disabledLabel)},t.$$.update=()=>{4&t.$$.dirty&&localStorage.setItem("ThemeSwitch",a),4&t.$$.dirty&&c.setProperty("--filter",a?100:0)},[r,o,a,c,()=>n(2,a=!a)]}return{ThemeSwitcher:class extends class{$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(){}}{constructor(t){super(),v(this,t,w,L,a,{enabledLabel:0,disabledLabel:1})}}}}();
new app.ThemeSwitcher({ target: document.querySelector('.js-theme-switcher'), props: { enabledLabel: '{{ i18n "theme_dark" }}', disabledLabel: '{{ i18n "theme_light" }}' } });
{{- $themeSwitcher := resources.Get "js/theme-switcher.js" -}}
{{- $grid := resources.Get "js/grid.js" -}}
{{- $reel := resources.Get "js/reel.js" -}}
{{- $liteYouTube := resources.Get "js/lite-yt-embed.js" -}}
{{- $liteVimeo := resources.Get "js/lite-vimeo-embed.js" -}}
{{- $scripts := slice $themeSwitcher $grid $reel $liteVimeo $liteYouTube | resources.Concat "scripts.js" | minify | fingerprint -}}
<script src="{{ $scripts.Permalink | relURL }}"></script>
<script> new app.ThemeSwitcher({ target: document.querySelector('.js-theme-switcher'), props: { enabledLabel: {{ i18n "theme_dark" }}, disabledLabel: {{ i18n "theme_light" }} } }); </script>
{{- $themeSwitcher := resources.Get "js/theme-switcher.js" | minify -}}
{{- $grid := resources.Get "js/grid.js" | minify -}}
{{- $reel := resources.Get "js/reel.js" | minify -}}
{{- $liteYouTube := resources.Get "js/lite-yt-embed.js" | minify -}}
{{- $liteVimeo := resources.Get "js/lite-vimeo-embed.js" | minify -}}
{{- $scripts := slice $themeSwitcher $grid $reel $liteVimeo $liteYouTube | resources.Concat "scripts.js" | resources.ExecuteAsTemplate (print "script." .Lang ".js" ) . | minify | fingerprint -}}
<script src="{{ $scripts.RelPermalink | relURL }}"></script>
......@@ -18,6 +18,6 @@
{{- $liteYouTube := resources.Get "css/lite-yt-embed.css" -}}
{{- $liteVimeo := resources.Get "css/lite-vimeo-embed.css" -}}
{{- $styles := slice $fonts $variables $general $switcher $center $cover $stack $box $grid $sidebar $cluster $frame $reel $imposter $helpers $themeSwitcher $skipLinks $liteYouTube $liteVimeo | resources.Concat "styles.css" | minify | fingerprint -}}
<link href="{{ "/fonts/inter.ttf" | relURL }}" crossorigin="preload anonymous" rel="preload" type="font/ttf" as="font">
<link href="{{ $styles.Permalink | relURL }}" rel="preload stylesheet" media="print" type="text/css" as="style" onload="this.onload=null;this.media='all'">
<noscript><link href="{{ $styles.Permalink | relURL }}" rel="preload stylesheet" media="all" type="text/css" as="style"></noscript>
<link href="{{ (resources.Get "fonts/inter.ttf").RelPermalink }}" crossorigin="preload anonymous" rel="preload" type="font/ttf" as="font">
<link href="{{ $styles.RelPermalink | relURL }}" rel="preload stylesheet" media="print" type="text/css" as="style" onload="this.onload=null;this.media='all'">
<noscript><link href="{{ $styles.RelPermalink | relURL }}" rel="preload stylesheet" media="all" type="text/css" as="style"></noscript>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment