公祭日等全局直接切换灰色

2022/11/7

使用百分比值(例如 75%)的滤镜,也接受该值是十进制(例如 0.75) 把所有图像都改为黑白(100% 灰色)

.gjr{
 -webkit-filter: grayscale(100%);
}
1
2
3
function addgjr(){
  //获取月份
  let month = new Date().getMonth()+1
  //获取日
  let day = new Date().getDate()
  if(month===12&&day===13){
    // 添加样式
  }
}
1
2
3
4
5
6
7
8
9
最后更新时间: 2023/1/12 15:59:09