优化动态logo

This commit is contained in:
fzk
2024-08-28 11:23:06 +08:00
parent 0d9731c5cc
commit 7f8f6920de
5 changed files with 8 additions and 5 deletions
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

+3 -2
View File
@@ -1,5 +1,5 @@
import defaultUrl from "raw:~/assets/icon.png"
import activeUrl from "raw:~/assets/logo.png"
import activeUrl from "raw:~/assets/icon.png"
import defaultUrl from "raw:~/assets/logo.png"
import type { PlasmoMessaging } from "@plasmohq/messaging"
@@ -7,6 +7,7 @@ const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
const [tab] = await chrome.tabs.query({ currentWindow: true, active: true })
const { active } = req.body
console.log(active)
if (active) {
chrome.action.setIcon({ tabId: tab.id, path: activeUrl }, () => {})
} else {
+2 -2
View File
@@ -54,7 +54,7 @@ export default function Content() {
}
return (
<>
<div className="content">
{csdnIsShow ? <Csdn /> : <></>}
{zhihuIsShow ? <Zhihu /> : <></>}
{baiduIsShow ? <Baidu /> : <></>}
@@ -65,6 +65,6 @@ export default function Content() {
{phpIsShow ? <Php /> : <></>}
{customIsShow ? <Custom /> : <></>}
<Config />
</>
</div>
)
}
+3 -1
View File
@@ -3,7 +3,9 @@ import { useEffect } from "react"
import { useMessage } from "@plasmohq/messaging/hook"
import { useStorage } from "@plasmohq/storage/hook"
import { addCss } from "~tools"
import { addCss, setIcon } from "~tools"
setIcon(false)
export default function Custom() {
const [runCss] = useStorage<boolean>("custom-runCss")