4月4日网站变灰记录
- 基本都是通过
grayscale
来实现的 - 都不支持 IE 11
- 但在 IE 11 的情况下表现却各不相同
- B站、A站、淘宝、京东、百度、虎扑、开源中国
B 站
html.gray{-webkit-filter:grayscale(.95)}
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-oFlb7OzI-1586078009132)(https://i.loli.net/2020/04/04/NM8mHGFajogk7Jp.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-G2cEbQAu-1586078009141)(https://i.loli.net/2020/04/04/7NUOalkJzxqrSw3.png)]
A站
html .gray {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
-webkit-filter: grey;
filter: gray;
}
- 有多浏览器前缀考虑
- 实际上无法用 ie11 打开网站
- 不过和 B 站一样,去除无关内容,值得称赞
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-6BtQaFwS-1586078009143)(C:\Users\李燕no\Pictures\NzxrnwZHhoc85Ps.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-6Pew7vM0-1586078009144)(C:\Users\李燕no\Pictures\jQCL4T7OJiMGED9.png)]
淘宝
html{-webkit-filter: grayscale(100%); filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);}
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-FruYv6Mw-1586078009145)(https://i.loli.net/2020/04/04/xUonqWCDaKfuVw9.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-K9g5jnq2-1586078009146)(https://i.loli.net/2020/04/04/td9mWU7wkKLQueY.png)]
京东
/* 一段控制灰色失效的 JS 代码 */
$html.toggleClass('o2_gray', isDuringDate('2020/04/04 00:00:00', '2020/04/04 23:59:59'))
html.o2_gray {
-webkit-filter: grayscale(100%);
filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
}
- 可部分加载分类条目
- 但内容无法加载
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-H8xEiRTQ-1586078009147)(https://i.loli.net/2020/04/04/h9tx6CEjLKRIbuq.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-WO4xkOYE-1586078009148)(https://i.loli.net/2020/04/04/VCPOYRK3zaMghdI.png)]
百度
@font-face{font-family:cIconfont;src:url(https://dss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/font/iconfont-a37745d6f3.eot);src:url(https://dss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/font/iconfont-a37745d6f3.eot?#iefix) format('embedded-opentype'),url(https://dss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/font/iconfont-b021b3a4c4.woff2) format('woff2'),url(https://dss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/font/iconfont-2a209a281f.woff) format('woff'),url(https://dss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/font/iconfont-37639e7474.ttf) format('truetype'),url(https://dss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/font/iconfont-475b0dc226.svg#iconfont) format('svg')}
body.qm-activity #head_wrapper,body.qm-activity #s_menu_gurd,body.qm-activity #u1,body.qm-activity #u_sp,body.qm-activity .s-ctner-menus .s-menu-item-underline,body.qm-activity .s-news-rank-content,body.qm-activity .s-news-wrapper .s-news-list-wrapper .hot-point,body.qm-activity .s-news-wrapper .s-news-list-wrapper:nth-child(-n+3) img.s-news-img,body.qm-activity .s-top-left.s-isindex-wrap{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);-webkit-filter:grayscale(100%);-moz-filter:grayscale(100%);-ms-filter:grayscale(100%);-o-filter:grayscale(100%);filter:grayscale(100%);filter:gray}
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-TBmP8utM-1586078009149)(https://i.loli.net/2020/04/04/hXR1k8l2CysBExo.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-1vEisSJS-1586078009149)(https://i.loli.net/2020/04/04/kEcwlCZNa9iAHVX.png)]
虎扑
<html style="filter: grayscale(100%);>
</html>
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-KFaX62Za-1586078009150)(https://i.loli.net/2020/04/04/MlrJaYhTjAEFXZ2.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-2A63s7gY-1586078009152)(https://i.loli.net/2020/04/04/qdfXvuVaToQ7sKy.png)]
开源中国
body {
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
-webkit-filter: grayscale(1);
}
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ljV1dra0-1586078009153)(https://i.loli.net/2020/04/04/f76b8CxyS9nHldY.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-2OPNVAeD-1586078009154)(https://i.loli.net/2020/04/04/ztYU1orXiOV4hkE.png)]
总结
- 百度和淘宝两个老牌互联网公司对兼容的重视可见一斑
- B站和A站等二次元视频网站也都删除了其他无关内容
- 老牌视频网站腾讯、爱奇艺表现良好
- 但优酷在 IE 11 的情况会加载其他内容
- 京东在 IE 11 的表现让人非常失望
- 至于 A 站在 IE 11 无任何反应的情况,希望相关技术人员能重视一下吧
效率和兼容可能会有很大程度上的冲突,但出发点都是对抗击新冠肺炎疫情斗争而牺牲的烈士和逝世同胞寄托哀思。