commit 53ce1dfa304137ff9f19f27d8a7b28c975e6ce88 Author: 编码猿 Date: Tue Feb 4 19:16:43 2025 +0800 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..403adbc --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +.DS_Store +node_modules +/dist + + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/.pydio b/.pydio new file mode 100644 index 0000000..a6201ee --- /dev/null +++ b/.pydio @@ -0,0 +1 @@ +54e4188a-2736-43f2-91ff-98b8dd7797c1 \ No newline at end of file diff --git a/book.png b/book.png new file mode 100644 index 0000000..09cac1b Binary files /dev/null and b/book.png differ diff --git a/css/.pydio b/css/.pydio new file mode 100644 index 0000000..3a1ac1a --- /dev/null +++ b/css/.pydio @@ -0,0 +1 @@ +7f60b74b-4c15-43d6-a59c-a010009eb840 \ No newline at end of file diff --git a/css/clear.css b/css/clear.css new file mode 100644 index 0000000..979befd --- /dev/null +++ b/css/clear.css @@ -0,0 +1,12 @@ +body,h1,h2,h3,h4,h5,h6,p,ul,li{ + margin: 0; + padding: 0; + list-style: none; +} +a { + text-decoration: none; +} +input { + outline: none; + border: none; +} \ No newline at end of file diff --git a/css/index.css b/css/index.css new file mode 100644 index 0000000..214a049 --- /dev/null +++ b/css/index.css @@ -0,0 +1,112 @@ +.night { + background: rgb(24, 26, 27); +} + +.night .search input{ + background: rgb(24, 26, 27); + border-color: rgb(56, 61, 63); + color: rgba(232, 230, 227, 0.87); +} + +.themeChange { + position: fixed; + right: 30px; + top: 30px; +} +.themeChange img { + width: 30px; + height: 30px; +} + +.bmy_tab { + width: 100vw; +} +.logo { + margin: 0 auto; + margin-top: 14%; + display: block; +} +.search { + margin: 0 auto; + width: 584px; + height: 50px; + border-radius: 24px; + position: relative; +} +.search .icon { + color: #80868b; + position: absolute; + fill: currentColor; + display: inline-block; + width: 20px; + height: 20px; + top: 50%; + right: 15px; + transform: translateY(-50%); +} +.icon svg { + width: 100%; + height: 100%; +} +.search .icon:first-child { + left: 15px; +} + +.search input { + border: 1px solid #dfe1e5; + border-radius: 24px; + height: 100%; + width: 100%; + padding: 0 44px; + box-sizing: border-box; + color: rgba(0,0,0,.87); + font-size: 16px; +} + +.clear { + cursor: pointer; +} + +.search:hover { + background-color: #fff; + box-shadow: 0 1px 6px rgb(32 33 36 / 28%); + border-color: rgba(223,225,229,0); +} + +.history { + margin: 0 15px; + display: flex; + justify-content: space-between; + flex-wrap: wrap; + margin-top: 50px; + overflow-x: scroll; +} +.history li { + width: 24%; + border: 1px solid #dadce0; + border-radius: 8px; + padding: 24px; + box-sizing: border-box; + margin-bottom: 10px; +} +.history li h2 { + font-family: 'Google Sans',Roboto,Arial,sans-serif; + font-size: 22px; + font-weight: 400; + letter-spacing: 0; + hyphens: auto; + word-break: break-word; + word-wrap: break-word; + color: #202124; +} +.history li .url { + font-family: Roboto,Arial,sans-serif; + font-size: 14px; + font-weight: 400; + hyphens: auto; + word-break: break-word; + word-wrap: break-word; + color: #5f6368; + padding: 8px 0 0 0; +} + diff --git a/img/.pydio b/img/.pydio new file mode 100644 index 0000000..c3b31dc --- /dev/null +++ b/img/.pydio @@ -0,0 +1 @@ +c8b9aa36-6ebc-4a04-9831-36b7080e09ef \ No newline at end of file diff --git a/img/bmylogo.png b/img/bmylogo.png new file mode 100644 index 0000000..fb81c49 Binary files /dev/null and b/img/bmylogo.png differ diff --git a/img/day.svg b/img/day.svg new file mode 100644 index 0000000..48c7d82 --- /dev/null +++ b/img/day.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/img/night.svg b/img/night.svg new file mode 100644 index 0000000..95dd5fc --- /dev/null +++ b/img/night.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/img/search.svg b/img/search.svg new file mode 100644 index 0000000..e69de29 diff --git a/index.html b/index.html new file mode 100644 index 0000000..d1f471a --- /dev/null +++ b/index.html @@ -0,0 +1,114 @@ + + + + + + + + 名字随机生成 + + + + + +
+
+

名字随机生成

+ 2522个刘姓三字名 +
+
+ +
+ + + +
+ + + + + \ No newline at end of file diff --git a/js/.pydio b/js/.pydio new file mode 100644 index 0000000..5a5107b --- /dev/null +++ b/js/.pydio @@ -0,0 +1 @@ +c28add94-9a74-4b12-863a-833671d85ca6 \ No newline at end of file diff --git a/js/newTab.js b/js/newTab.js new file mode 100644 index 0000000..5bb5775 --- /dev/null +++ b/js/newTab.js @@ -0,0 +1,76 @@ +class NewTab { + constructor() { + // chrome.history.search({ + // text: '' + // }, function (results) { + // console.log(results); + // }) + this.input = document.querySelector(".search input"); + this.input.focus(); + + this.ThemeClickChange(); + this.SearchInput(); + this.clearSearch(); + } + + clearSearch () { + var clear = document.querySelector(".clear"); + console.log(clear); + clear.onclick = () => { + this.input.value = ""; + } + } + + /** + * 主题切换 + */ + ThemeClickChange () { + var body = document.querySelector("body"), + theme = document.querySelector(".themeChange img"); + + // 当前为黑夜 + if (localStorage.getItem("status") != null) { + body.className = "night"; + theme.setAttribute("src", "./img/day.svg") + localStorage.setItem("status", "night") + } + + theme.onclick = () => { + // 如果当前白天,切换为黑夜 + if (body.classList.length == 0) { + body.className = "night"; + theme.setAttribute("src", "./img/day.svg") + localStorage.setItem("status", "night") + } else { + body.className = ""; + theme.setAttribute("src", "./img/night.svg"); + localStorage.removeItem("status") + } + } + + + } + + SearchInput() { + this.input.onkeydown = (event) => { + if (event.keyCode == 13) { + if (this.input.value.length != 0) { + window.open(`https://www.google.com/search?q=${this.input.value}`) + } + } + } + } + +} + +new NewTab() + +// chrome.bookmarks.getTree(function (result) { +// console.log(result); +// }) + + + +// chrome.system.cpu.getInfo(function (res) { +// console.log(res); +// }); \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..31870ad --- /dev/null +++ b/manifest.json @@ -0,0 +1,21 @@ +{ + "manifest_version": 2, + "name": "书签管理器", + "description": "一款比谷歌浏览器原生更简洁好用的书签管理器", + "version": "1.0", + "permissions": [ + "bookmarks", + "history", + "tabs", + "system.cpu", + "http://*/*", + "https://*/*" + ], + "chrome_url_overrides": { + "newtab": "newTab.html" + }, + "browser_action": { + "default_icon": "book.png", + "default_popup": "popup.html" + } +} \ No newline at end of file diff --git a/newTab.html b/newTab.html new file mode 100644 index 0000000..2e996e5 --- /dev/null +++ b/newTab.html @@ -0,0 +1,37 @@ + + + + + + + + + + 新标签页 + + + + + +
+ + + + +
+ +
+ +
+ + + + \ No newline at end of file diff --git a/popup.html b/popup.html new file mode 100644 index 0000000..238525f --- /dev/null +++ b/popup.html @@ -0,0 +1,12 @@ + + + + + + + Document + + + 测试 + + \ No newline at end of file