Last active
February 8, 2020 14:37
-
-
Save YCF/437cb5c16fe3e83b952b0d04a2573d79 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
body.grayDay { | |
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); | |
-webkit-filter: grayscale(100%); } | |
</style> | |
<script> | |
window.onload = function() { | |
var grayDay = [108, 207, 219, 404, 420, 512, 815, 909, 918, 1213]; | |
var today = new Date(); | |
var d = (today.getMonth() + 1) * 100 + today.getDate(); | |
grayDay.forEach(function(i) { | |
if (i == d) { | |
var classVal = document.getElementsByTagName('body')[0].getAttribute("class"); | |
classVal = classVal.concat(" grayDay"); | |
document.getElementsByTagName('body')[0].setAttribute("class", classVal); | |
} | |
}); | |
} | |
</script> |
sincerefly
commented
Feb 8, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment