Skip to content

Commit 23ed010

Browse files
authored
Update Lazy Loading Background Color (#102)
* Update Lazy Loading Background Color * Cleanup
1 parent 0f19ec0 commit 23ed010

4 files changed

Lines changed: 16 additions & 10 deletions

File tree

src/css/lazy.css

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/html/lazy.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title></title>
7-
<link rel="stylesheet" type="text/css" href="../css/lazy.css">
87
</head>
98
<body>
109

src/html/popup.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
</div>
3232

3333
<div class="flex-fill text-center">
34-
<a class="link-body-emphasis text-decoration-none fs-4" title="Home Page" href="homepage_url">Link Extractor</a>
35-
<span class="small">
36-
<a class="link-body-emphasis text-decoration-none" title="Release Notes" href="version_url">
34+
<a class="link-body-emphasis text-decoration-none fs-4" title="Home Page" href="homepage_url">
35+
<img src="../images/logo32.png" alt="Logo" class="mb-1" style="height: 1.1em;">
36+
Link Extractor</a>
37+
<a class="link-body-emphasis text-decoration-none small" title="Release Notes" href="version_url">
3738
v<span class="version"></span></a>
38-
</span>
3939
</div>
4040

4141
<div class="">

src/js/lazy.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ link.rel = 'icon'
1010
link.href = `${url.origin}/favicon.ico`
1111
document.head.appendChild(link)
1212

13+
let theme = localStorage.getItem('theme')
14+
if (!theme || theme === 'auto') {
15+
theme = window.matchMedia('(prefers-color-scheme: dark)').matches
16+
? 'dark'
17+
: 'light'
18+
}
19+
if (theme === 'dark') {
20+
document.body.style.backgroundColor = '#1c1b21'
21+
} else {
22+
document.body.style.backgroundColor = '#fff'
23+
}
24+
1325
window.addEventListener('focus', () => {
1426
console.log('url:', url)
1527
window.location = url.href

0 commit comments

Comments
 (0)