docs: fix mourn tree shaking

This commit is contained in:
chenjiahan
2020-04-04 23:45:27 +08:00
parent 0346ecd96a
commit 9eb337bd0e
3 changed files with 16 additions and 6 deletions
+10 -4
View File
@@ -1,12 +1,18 @@
const now = new Date();
export default function () {
const now = new Date();
if (now.getFullYear() === 2020 && now.getMonth() === 3 && now.getDate() === 4) {
const filter = `
if (
now.getFullYear() === 2020 &&
now.getMonth() === 3 &&
now.getDate() === 4
) {
const filter = `
html{
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
}
`;
document.head.insertAdjacentHTML('beforeend', `<style>${filter}</style>`);
document.head.insertAdjacentHTML('beforeend', `<style>${filter}</style>`);
}
}