feat(assets): 将图片资源从 JPG/PNG 更新为 WebP 格式
- 将 MBTI 图标从 PNG 更改为 WebP 格式以优化加载性能 - 更新背景图片路径配置以使用 WebP 图片资源 - 移除对 sessionStorage 中图片 URL 列表的重复设置逻辑
@@ -171,7 +171,7 @@
|
||||
<span class="mbti-code gradient-text">INFJ</span>
|
||||
<span class="mbti-name" data-i18n="mbti.name">Advocate</span>
|
||||
<span class="mbti-icon">
|
||||
<img src="images/INFJ.png" alt="INFJ" style="width:32px;height:32px;border-radius:50%;border:2px solid rgba(255,255,255,0.4)"/>
|
||||
<img src="images/INFJ.webp" alt="INFJ" style="width:32px;height:32px;border-radius:50%;border:2px solid rgba(255,255,255,0.4)"/>
|
||||
</span>
|
||||
</div>
|
||||
<p class="mbti-desc" data-i18n="mbti.desc">"理想主义与道德感,果断决绝的行动力。深度洞察与创意,关怀与同理心。"</p>
|
||||
|
||||
BIN
images/INFJ.webp
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
images/bj/1.webp
Normal file
|
After Width: | Height: | Size: 691 KiB |
BIN
images/bj/2.webp
Normal file
|
After Width: | Height: | Size: 415 KiB |
BIN
images/bj/3.webp
Normal file
|
After Width: | Height: | Size: 488 KiB |
BIN
images/bj/4.webp
Normal file
|
After Width: | Height: | Size: 1.8 MiB |
BIN
images/bj/5.webp
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
images/bj/6.webp
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
images/bj/7.webp
Normal file
|
After Width: | Height: | Size: 786 KiB |
BIN
images/bj/8.webp
Normal file
|
After Width: | Height: | Size: 1.8 MiB |
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)
|
||||
|
||||