-
-
Save ray1980/cc2fa2037c6d6f85e022f74849ef6561 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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment