1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-10-28 21:35:49 -04:00

wrap dark mode stuff in an anonymous function like a big boy coder

This commit is contained in:
2020-04-26 19:00:46 -04:00
parent 0c4e4d9afb
commit 374a822ad4
5 changed files with 94 additions and 92 deletions

View File

@@ -2,6 +2,9 @@
// inspired by https://codepen.io/kevinpowell/pen/EMdjOV
(function() {
'use strict';
// lightbulb toggle re-appears now that we know user has JS enabled
const toggle = document.querySelector('button#dark-mode-toggle');
toggle.style.visibility = 'visible';
@@ -98,3 +101,4 @@ toggle.addEventListener('click', function() {
localStorage.setItem('dark_mode_pref', 'false');
}
}, true);
})();

View File

@@ -7,7 +7,7 @@
*
*/
var emoji = (function (
(function (
// WARNING: this file is generated automatically via
// `node scripts/build.js`
@@ -570,6 +570,4 @@ var emoji = (function (
return r.join(sep || '-');
}
}());
emoji.parse(document.body);
}()).parse(document.body);

View File

@@ -10,6 +10,7 @@
{{ block "main" . }}{{ end }}
</div>
{{ partialCached "page/footer" . }}
{{ partial "scripts/_bundle" . }}
{{ partial "scripts/shortcodes" . }}
{{ if eq hugo.Environment "production" }}
{{ partialCached "scripts/simple_analytics" . }}

View File

@@ -8,5 +8,4 @@
{{ partialCached "head/feeds" . -}}
{{ partialCached "head/webmention" . -}}
{{ partial "head/canonical" . -}}
{{ partial "scripts/_bundle" . }}
{{ partial "head/schema" . -}}

View File

@@ -1,2 +1,2 @@
<script async defer src="https://s.jarv.is/app.js" data-skip-dnt="true"></script>
<script async defer src="https://s.jarv.is/latest.js" data-skip-dnt="true"></script>
<noscript><img src="https://s.jarv.is/image.gif" alt=""></noscript>