feat(assets): 将图片资源从 JPG/PNG 更新为 WebP 格式
- 将 MBTI 图标从 PNG 更改为 WebP 格式以优化加载性能 - 更新背景图片路径配置以使用 WebP 图片资源 - 移除对 sessionStorage 中图片 URL 列表的重复设置逻辑
This commit is contained in:
14
js/config.js
14
js/config.js
@@ -18,13 +18,13 @@ const SiteConfig = {
|
||||
|
||||
background: {
|
||||
imagePaths: [
|
||||
"/images/bj/1.jpg",
|
||||
"/images/bj/2.jpg",
|
||||
"/images/bj/3.jpg",
|
||||
"/images/bj/4.jpg",
|
||||
"/images/bj/5.jpg",
|
||||
"/images/bj/6.jpg",
|
||||
"/images/bj/7.jpg"
|
||||
"/images/bj/1.webp",
|
||||
"/images/bj/2.webp",
|
||||
"/images/bj/3.webp",
|
||||
"/images/bj/4.webp",
|
||||
"/images/bj/5.webp",
|
||||
"/images/bj/6.webp",
|
||||
"/images/bj/7.webp"
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
@@ -50,17 +50,15 @@ $(document).ready(function () {
|
||||
* 自定义壁纸
|
||||
*/
|
||||
var imgUrls = JSON.parse(sessionStorage.getItem("imgUrls"));
|
||||
var index = sessionStorage.getItem("index");
|
||||
var $panel = $('#panel');
|
||||
var date = new Date();
|
||||
var dayOfWeek = date.getDay();
|
||||
if (imgUrls == null) {
|
||||
imgUrls = [];
|
||||
index = 0;
|
||||
SiteConfig.background.imagePaths.forEach(path => {
|
||||
imgUrls.push(path);
|
||||
});
|
||||
sessionStorage.setItem("imgUrls", JSON.stringify(imgUrls));
|
||||
//sessionStorage.setItem("imgUrls", JSON.stringify(imgUrls));
|
||||
// sessionStorage.setItem("index", index);
|
||||
} else {
|
||||
// if (index == imgUrls.length)
|
||||
|
||||
Reference in New Issue
Block a user