diff --git a/css/style.css b/css/style.css index 8e0031d..54744ab 100644 --- a/css/style.css +++ b/css/style.css @@ -36,6 +36,12 @@ a:hover { transition: 0.5s; } +#section { + background-image: url(https://api.ixiaowai.cn/gqapi/gqapi.php), url(../img/background.jpg); + background-repeat: no-repeat; + background-position: center center; +} + /*页面样式*/ section { display: block; diff --git a/img/background.jpg b/img/background.jpg new file mode 100644 index 0000000..88e8279 Binary files /dev/null and b/img/background.jpg differ diff --git a/img/background.png b/img/background.png deleted file mode 100644 index f69190b..0000000 Binary files a/img/background.png and /dev/null differ diff --git a/js/main.js b/js/main.js index 0a7afa5..f17b96c 100644 --- a/js/main.js +++ b/js/main.js @@ -74,7 +74,7 @@ fetch('https://v1.hitokoto.cn') .catch(console.error) //获取天气 -fetch('https://www.tianqiapi.com/free/day?appid=43986679&appsecret=TksqGZT7') +fetch('https://www.tianqiapi.com/free/day?appid=43986679&appsecret=TksqGZT7&unescape=1') .then(response => response.json()) .then(data => { const wea = document.getElementById('wea_text') @@ -155,10 +155,12 @@ if (imgUrls == null) { } */ //临时更换图片 api +/* var $section = $('#section'); var url = "https://api.ixiaowai.cn/gqapi/gqapi.php"; $section.css("background", "url('" + url + "') center center no-repeat #666"); $section.css("background-size", "cover"); +*/ //加载动画 window.addEventListener('load', function () {