diff --git a/images/bj/10.jpg b/images/bj/10.jpg new file mode 100644 index 0000000..c52e0d0 Binary files /dev/null and b/images/bj/10.jpg differ diff --git a/images/bj/8.jpg b/images/bj/8.jpg new file mode 100644 index 0000000..b954599 Binary files /dev/null and b/images/bj/8.jpg differ diff --git a/images/bj/9.jpg b/images/bj/9.jpg new file mode 100644 index 0000000..b700e91 Binary files /dev/null and b/images/bj/9.jpg differ diff --git a/images/logo.png b/images/logo.png index fd3042e..f067715 100644 Binary files a/images/logo.png and b/images/logo.png differ diff --git a/index-2.html b/index-2.html index 8c83d4b..2886694 100644 --- a/index-2.html +++ b/index-2.html @@ -121,7 +121,7 @@

- +
+ style="background: url(https://blog-file.hehouhui.cn/bj/1.jpg) center center / cover no-repeat rgb(102, 102, 102);">
@@ -216,4 +216,14 @@ var _hmt = _hmt || []; s.parentNode.insertBefore(hm, s); })(); + + + + diff --git a/js/main.js b/js/main.js index 16a8468..283ea5c 100644 --- a/js/main.js +++ b/js/main.js @@ -44,23 +44,25 @@ $(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() + 1; if (imgUrls == null) { imgUrls = new Array(); index = 0; for (let i = 1; i < 8; i++) { - imgUrls.push("https://cdn.jsdelivr.net/gh/listener-He/Home/images/bj/"+i+".jpg"); + imgUrls.push("https://blog-file.hehouhui.cn/bj/"+i+".jpg"); } sessionStorage.setItem("imgUrls", JSON.stringify(imgUrls)); - sessionStorage.setItem("index", index); + // sessionStorage.setItem("index", index); } else { - if (index == 7) - index = 0; - else - index++; - sessionStorage.setItem("index", index); +// if (index == imgUrls.length) +// index = 0; +// else +// index++; +// sessionStorage.setItem("index", index); } - var imgUrl = imgUrls[index]; + var imgUrl = imgUrls[dayOfWeek]; $panel.css("background", "url('" + imgUrl + "') center center no-repeat #666"); $panel.css("background-size", "cover");