From 680571d31f8475eaa8866d8288386534cd22cb2a Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Mon, 28 Mar 2022 11:30:37 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=95=AF=EF=B8=8F=20Mourning(3.21-mu5735):?= =?UTF-8?q?=20R.I.P?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exampleSite/assets/js/_custom.js | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 exampleSite/assets/js/_custom.js diff --git a/exampleSite/assets/js/_custom.js b/exampleSite/assets/js/_custom.js new file mode 100644 index 00000000..ae15ba37 --- /dev/null +++ b/exampleSite/assets/js/_custom.js @@ -0,0 +1,36 @@ +/** + * @author @Lruihao https://lruihao.cn + * @description Custom javascript for the hugo theme FixIt. + */ +const CustomJS = new (function () { + /** + * Rest in Peace. R.I.P 🕯️ + * @2022-3-28 [3.21-mu5735] 沉痛哀悼 132 名遇难同胞:东航航班失事,遇难者含旅客 123 人,机组 9 人 + * @returns {CustomJS} + */ + this.RIP = () => { + if (new Date() < new Date('2022-03-31')) { + document.querySelector('html').style.filter = 'grayscale(100%)'; + } + return this; + }; + /** + * Initialize. + * @returns {CustomJS} + */ + this.init = () => { + this.RIP(); + return this; + }; +})(); + +/** + * Immediate. + */ +(() => { + CustomJS.init(); + // It will be executed when the DOM tree is built. + document.addEventListener('DOMContentLoaded', () => { + // console.log('DOM content loaded!') + }); +})();