-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathindex.html
More file actions
43 lines (43 loc) · 1.89 KB
/
index.html
File metadata and controls
43 lines (43 loc) · 1.89 KB
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
<!doctype html>
<html lang="en">
<head>
<!-- 必须要设置此 `meta` 标签才能使多端自适应 -->
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- 这里嵌入了 SVG 图标 -->
<link id="favicon" rel="icon" type="image/svg+xml" href="/logo.svg" />
<link rel="icon" type="image/svg+xml" href="/logo.svg" media="(prefers-color-scheme: light)" />
<link rel="icon" type="image/png" href="/logoDark.png" media="(prefers-color-scheme: dark)" />
<!-- 此meta标签用于隐藏referer,不隐藏会导致b站知道请求来源,导致图片访问403-->
<meta name="referrer" content="no-referrer" />
<title>b站历史记录</title>
<script>
(function() {
var link = document.getElementById('favicon');
if (!link) {
link = document.createElement('link');
link.id = 'favicon';
link.rel = 'icon';
document.head.appendChild(link);
}
var prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)');
function updateFavicon() {
var isDark = document.documentElement.classList.contains('dark') || (prefersDark && prefersDark.matches);
link.href = isDark ? '/logoDark.png' : '/logo.svg';
link.type = isDark ? 'image/png' : 'image/svg+xml';
}
updateFavicon();
if (prefersDark && prefersDark.addEventListener) {
prefersDark.addEventListener('change', updateFavicon);
} else if (prefersDark && prefersDark.addListener) {
prefersDark.addListener(updateFavicon);
}
var mo = new MutationObserver(updateFavicon);
mo.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] });
})();
</script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>