-
Notifications
You must be signed in to change notification settings - Fork 0
/
bing_wallpaper_daily.html
148 lines (137 loc) · 4.93 KB
/
bing_wallpaper_daily.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>必应每日壁纸</title>
<style>
body {
background-image: url("https://bing.shangzhenyang.com/api/1080p");
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
}
a {
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
background-color: inherit;
border: 1px solid rgba(255, 255, 255, .2);
border-radius: 5px;
max-width: calc(100% - 30px);
padding: 10px 15px;
position: fixed;
text-decoration: none;
color: white;
margin: 20px;
font-size: 10px;
user-select: none;
}
footer {
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
background-color: inherit;
border: 1px solid rgba(255, 255, 255, .2);
border-radius: 5px;
max-width: calc(100% - 30px);
padding: 10px 15px;
position: fixed;
text-decoration: none;
color: white;
margin: 20px;
font-size: 14px;
bottom: 15px;
cursor: pointer;
right: 15px;
right: calc(env(safe-area-inset-right) + 15px);
text-align: right;
text-decoration: none;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none
}
#title {
font-weight: bold;
font-size: 20px;
padding: 5px 0 5px 0;
}
</style>
</head>
<body>
<a href="https://bing.shangzhenyang.com/" target="_blank">获取必应原图</a>
<footer id="footer" class="text-box">
<div id="title"></div>
<div id="copyright"></div>
<div>此图像的使用仅限于壁纸。</div>
<div>Bing 是微软的商标。 该网站不隶属于 Microsoft。</div>
</footer>
<script>
(function () {
const t = document.createElement("link").relList;
if (t && t.supports && t.supports("modulepreload"))
return;
for (const e of document.querySelectorAll('link[rel="modulepreload"]'))
i(e);
new MutationObserver(e => {
for (const r of e)
if (r.type === "childList")
for (const s of r.addedNodes)
s.tagName === "LINK" && s.rel === "modulepreload" && i(s)
}
).observe(document, {
childList: !0,
subtree: !0
});
function n(e) {
const r = {};
return e.integrity && (r.integrity = e.integrity),
e.referrerPolicy && (r.referrerPolicy = e.referrerPolicy),
e.crossOrigin === "use-credentials" ? r.credentials = "include" : e.crossOrigin === "anonymous" ? r.credentials = "omit" : r.credentials = "same-origin",
r
}
function i(e) {
if (e.ep)
return;
e.ep = !0;
const r = n(e);
fetch(e.href, r)
}
}
)();
const d = "https://bing.shangzhenyang.com/api";
function l() {
window.open(d + "/1080p")
}
window.addEventListener("keydown", o => {
(o.ctrlKey || o.metaKey) && o.key === "s" && (o.preventDefault(),
l())
}
);
window.addEventListener("load", async () => {
const o = document.getElementById("copyright");
const title = document.getElementById("title");
if (o)
try {
const t = await fetch(d + "/json");
if (!t.ok)
throw new Error(t.status.toString());
const n = await t.json();
if (n) {
const i = n.images[0];
title.textContent = i.title
o.textContent = i.copyright
}
} catch (t) {
console.error(t),
t instanceof Error && (o.textContent = `Error: ${t.message}`)
}
}
);
var c;
(c = document.getElementById("bg-img")) == null || c.addEventListener("click", function () {
this.classList.toggle("blur")
});
var a;
(a = document.getElementById("footer")) == null || a.addEventListener("click", l);
</script>
</body>
</html>