hscc

The personnal website source code of Hugo Soucy. Creates from an homebrewed static website generator.
Log | Files | Refs

commit 498dbc680f30665433737cf821254f778013822f
parent 9be16f6ebedac1e891bf5e02ad84cd80d77f815a
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Sat, 21 Nov 2020 10:24:46 -0500

Add some js scripts

Diffstat:
Asrc/js/cutting-the-mustard.js | 20++++++++++++++++++++
Asrc/js/index.js | 4++++
2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/js/cutting-the-mustard.js b/src/js/cutting-the-mustard.js @@ -0,0 +1,20 @@ +(function () { + 'use strict'; + let ux_css; + + /* If the browser is for HTML5 then */ + if('querySelector' in document + && 'localStorage' in window + && 'addEventListener' in window) { + /* UX CSS */ + ux_css = document.createElement('link'); + ux_css.href = '/css/ux.min.css'; + ux_css.id = 'ux_css'; + ux_css.media = 'screen and (min-width: 20rem)'; + ux_css.rel = 'stylesheet'; + ux_css.type = 'text/css'; + + /* Insert the `ux_css` element */ + document.getElementById('ui_css').insertAdjacentElement('afterend', ux_css); + } +})(); diff --git a/src/js/index.js b/src/js/index.js @@ -0,0 +1,4 @@ +(function () { + 'use strict'; + // ... +})();