More optimizations

This commit is contained in:
Rico Sta. Cruz 2017-10-13 17:55:19 +08:00
parent abcc50a4ba
commit 2d38f00d49
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
8 changed files with 37 additions and 32 deletions

View File

@ -82,3 +82,4 @@ gtag('config','{{ site.data.google_analytics.id }}');
{% endif %}
<script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
<script>(function(H){H.className=H.className.replace(/\bNoJs\b/,'WithJs')})(document.documentElement)</script>

1
_js/helpers/noop.js Normal file
View File

@ -0,0 +1 @@
/* blank */

View File

@ -1,6 +1,7 @@
import wrapify from '../wrapify'
import ready from 'dom101/ready'
import onmount from 'onmount'
import addClass from 'dom101/add-class'
/**
* Behavior: Wrapping
@ -8,6 +9,9 @@ import onmount from 'onmount'
ready(() => {
const body = document.querySelector('[data-js-main-body]')
if (body) { wrapify(body) }
if (body) {
wrapify(body)
addClass(body, '-wrapified')
}
setTimeout(() => { onmount() })
})

View File

@ -1,5 +1,5 @@
<!doctype html>
<html lang='en'><head>
<html class='NoJs' lang='en'><head>
{% include 2017/head.html %}
{% include 2017/article-schema.html page=page %}

View File

@ -69,3 +69,18 @@ a:hover {
}
}
}
/*
* Hide markdown before it's wrapped.
*/
html.WithJs .MarkdownBody {
& {
opacity: 0;
}
&.-wrapified {
opacity: 1;
transition: opacity 250ms linear;
}
}

View File

@ -3,6 +3,7 @@
text-align: center;
position: relative;
height: 130px;
overflow: hidden;
}
/* Prelude */

View File

@ -47,6 +47,12 @@ module.exports = {
}
]
},
resolve: {
alias: {
// Never bundle jQuery
'jquery': join(__dirname, '..', '_js/helpers/noop.js')
}
},
stats: 'minimal',
plugins: [
// Optimize module ID's for vendor chunks

File diff suppressed because one or more lines are too long