From c184efb8ce4f9d7f6b95d3615d0b2e51428fccc9 Mon Sep 17 00:00:00 2001 From: imsyy Date: Mon, 7 Aug 2023 18:09:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=BE=E7=BD=AE=E5=8F=8A=E7=9B=92?= =?UTF-8?q?=E5=AD=90=E9=A1=B5=E9=9D=A2=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 52 +++++---- package.json | 5 +- pnpm-lock.yaml | 36 ++++-- public/favicon.ico | Bin 0 -> 4286 bytes public/lib/iconfont.js | 1 + src/App.vue | 106 +++++++++++++++++- src/components/AllFunc/AllBox.vue | 12 ++ src/components/AllFunc/AllFunc.vue | 67 +++++++++++ src/components/AllFunc/AllSet.vue | 104 +++++++++++++++++ src/components/Cover.vue | 3 +- src/components/Footer.vue | 1 + src/components/Provider.vue | 6 + .../{ => SearchInput}/SearchEngine.vue | 0 .../{ => SearchInput}/SearchInp.vue | 39 ++++--- .../{ => SearchInput}/Suggestions.vue | 20 ++-- src/components/Setting.vue | 0 src/components/WeatherTime.vue | 27 +++-- src/main.js | 4 +- src/stores/setData.js | 6 +- src/stores/statusData.js | 6 + src/style/global.scss | 35 +++++- src/utils/iconfont.js | 1 - src/utils/identifyInput.js | 4 +- vite.config.js | 3 + 24 files changed, 451 insertions(+), 87 deletions(-) create mode 100644 public/favicon.ico create mode 100644 public/lib/iconfont.js create mode 100644 src/components/AllFunc/AllBox.vue create mode 100644 src/components/AllFunc/AllFunc.vue create mode 100644 src/components/AllFunc/AllSet.vue rename src/components/{ => SearchInput}/SearchEngine.vue (100%) rename src/components/{ => SearchInput}/SearchInp.vue (85%) rename src/components/{ => SearchInput}/Suggestions.vue (95%) delete mode 100644 src/components/Setting.vue delete mode 100644 src/utils/iconfont.js diff --git a/index.html b/index.html index fcbc1e0..cbd932b 100644 --- a/index.html +++ b/index.html @@ -1,26 +1,30 @@ - - - - - Snavigation - - - - - - -
- - - + + + + + + Snavigation + + + + + + + +
+ + + + + \ No newline at end of file diff --git a/package.json b/package.json index fbae2a6..b1f7ef3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "snavigation", "private": true, - "version": "2.0.0 beta 2", + "version": "2.0.0 beta 3", "type": "module", "scripts": { "dev": "vite --host", @@ -21,6 +21,7 @@ "@vitejs/plugin-vue": "^4.2.3", "naive-ui": "^2.34.4", "terser": "^5.19.2", - "vite": "^4.4.5" + "vite": "^4.4.5", + "vite-plugin-compression": "^0.5.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 60a8822..c93fc73 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,6 +40,9 @@ devDependencies: vite: specifier: ^4.4.5 version: 4.4.6(sass@1.64.1)(terser@5.19.2) + vite-plugin-compression: + specifier: ^0.5.1 + version: 0.5.1(vite@4.4.6) packages: @@ -1691,7 +1694,6 @@ packages: engines: {node: '>=8'} dependencies: color-convert: 2.0.1 - dev: false /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} @@ -1859,7 +1861,6 @@ packages: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 - dev: false /chokidar@3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} @@ -1886,7 +1887,6 @@ packages: engines: {node: '>=7.0.0'} dependencies: color-name: 1.1.4 - dev: false /color-name@1.1.3: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} @@ -1894,7 +1894,6 @@ packages: /color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - dev: false /combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} @@ -1969,7 +1968,6 @@ packages: optional: true dependencies: ms: 2.1.2 - dev: false /deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} @@ -2185,6 +2183,15 @@ packages: mime-types: 2.1.35 dev: false + /fs-extra@10.1.0: + resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} + engines: {node: '>=12'} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.0 + dev: true + /fs-extra@9.1.0: resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==} engines: {node: '>=10'} @@ -2287,7 +2294,6 @@ packages: /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - dev: false /has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} @@ -2301,7 +2307,6 @@ packages: /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} - dev: false /has-property-descriptors@1.0.0: resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} @@ -2556,7 +2561,6 @@ packages: universalify: 2.0.0 optionalDependencies: graceful-fs: 4.2.11 - dev: false /jsonpointer@5.0.1: resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} @@ -2645,7 +2649,6 @@ packages: /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - dev: false /naive-ui@2.34.4(vue@3.3.4): resolution: {integrity: sha512-aPG8PDfhSzIzn/jSC9y3Jb3Pe2wHJ7F0cFV1EWlbImSrZECeUmoc+fIcOSWbizoztkKfaUAeKwYdMl09MKkj1g==} @@ -3040,7 +3043,6 @@ packages: engines: {node: '>=8'} dependencies: has-flag: 4.0.0 - dev: false /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} @@ -3177,7 +3179,6 @@ packages: /universalify@2.0.0: resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==} engines: {node: '>= 10.0.0'} - dev: false /upath@1.2.0: resolution: {integrity: sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==} @@ -3210,6 +3211,19 @@ packages: vue: 3.3.4 dev: true + /vite-plugin-compression@0.5.1(vite@4.4.6): + resolution: {integrity: sha512-5QJKBDc+gNYVqL/skgFAP81Yuzo9R+EAf19d+EtsMF/i8kFUpNi3J/H01QD3Oo8zBQn+NzoCIFkpPLynoOzaJg==} + peerDependencies: + vite: '>=2.0.0' + dependencies: + chalk: 4.1.2 + debug: 4.3.4 + fs-extra: 10.1.0 + vite: 4.4.6(sass@1.64.1)(terser@5.19.2) + transitivePeerDependencies: + - supports-color + dev: true + /vite-plugin-pwa@0.16.4(vite@4.4.6)(workbox-build@7.0.0)(workbox-window@7.0.0): resolution: {integrity: sha512-lmwHFIs9zI2H9bXJld/zVTbCqCQHZ9WrpyDMqosICDV0FVnCJwniX1NMDB79HGTIZzOQkY4gSZaVTJTw6maz/Q==} engines: {node: '>=16.0.0'} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..24794849c40c7d8cc2b6fab57b1a785d18c3128b GIT binary patch literal 4286 zcmc(jJ5L)y6om(+h|)zVQim=j`~cps2nqxej~XbE(xjk*NJt1*2th#!4Wg$_!CycT zm=24ips^PlY_PqybG~5)EwIK`NMNJOjOTIA-TRu^7}KJEpFSD>n!WeNd^E;)f4jQ6OixdbnV6U`ZEbC~-`(A9dV71{scn~hmF!7=N-~nr34O+x zV@G? z7=shh9@E#?N82h%NX|T`=EKp^(d*gS*^7mRg^T6o0|XJPh|2$)N;WR%d2ra{K%H=^zO5wOTEdGscl}4m7^A+}j0hY7Hp}0GU2RPv-HZ_O+ z@i%s=$wpx!kq9!G4DbA`2Mn;l1RD;x;Pg4B-^4kw#+oWRJ9|Hi+iwO7Ot2kC0#1q1 zZv?yBILBws=6?G>X~6{B`QglQ5(m_lO~#2?;zopjr>Cd$b8~aKot>TZ z>FH@M48!t0lBa)I4!Gcy*m{obsa@2MdfWBh*{P|iyw+BRhK8tfCFydtv9Xa!CX*Ls zJ@xiR$Kim>#eqFbum|;%8Wvp}?PGJ^TX}o4wYBwYZEYu@b0a4H_Q-`s`RDm*(Se-97vv!C4YzPAtOxgL-{j1*nll$7z($cf XQ^veKFy_s7{+r;19=Hy~nG*LOF>ix| literal 0 HcmV?d00001 diff --git a/public/lib/iconfont.js b/public/lib/iconfont.js new file mode 100644 index 0000000..056cd2a --- /dev/null +++ b/public/lib/iconfont.js @@ -0,0 +1 @@ +window._iconfont_svg_string_4182315='',function(t){var c=(c=document.getElementsByTagName("script"))[c.length-1],l=c.getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var i,o,a,e,h,s=function(c,l){l.parentNode.insertBefore(c,l)};if(l&&!t.__iconfont__svg__cssinject__){t.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}i=function(){var c,l=document.createElement("div");l.innerHTML=t._iconfont_svg_string_4182315,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(c=document.body).firstChild?s(l,c.firstChild):c.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(i,0):(o=function(){document.removeEventListener("DOMContentLoaded",o,!1),i()},document.addEventListener("DOMContentLoaded",o,!1)):document.attachEvent&&(a=i,e=t.document,h=!1,d(),e.onreadystatechange=function(){"complete"==e.readyState&&(e.onreadystatechange=null,n())})}function n(){h||(h=!0,a())}function d(){try{e.documentElement.doScroll("left")}catch(c){return void setTimeout(d,50)}n()}}(window); \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 7b9feca..58404db 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,10 +4,43 @@ -
+
- + +
+ + +
+ + + +
+
@@ -26,7 +59,8 @@ import { getGreeting } from "@/utils/timeTools"; import Provider from "@/components/Provider.vue"; import Cover from "@/components/Cover.vue"; import WeatherTime from "@/components/WeatherTime.vue"; -import SearchInp from "@/components/SearchInp.vue"; +import SearchInp from "@/components/SearchInput/SearchInp.vue"; +import AllFunc from "@/components/AllFunc/AllFunc.vue"; import Footer from "@/components/Footer.vue"; const status = statusStore(); @@ -34,9 +68,10 @@ const status = statusStore(); // 获取配置 const welcomeText = import.meta.env.VITE_WELCOME_TEXT ?? "欢迎访问本站"; -// 全局点击 -const mainClick = () => { - status.setSiteStatus("normal"); +// 鼠标右键 +const mainContextmenu = (event) => { + event.preventDefault(); + status.setSiteStatus("box"); }; // 加载完成事件 @@ -48,6 +83,18 @@ const loadComplete = () => { }); }); }; + +// 全局键盘事件 +const mainPressKeyboard = (event) => { + const keyCode = event.keyCode; + // 回车 + if (keyCode === 13) { + // focus 元素 + const mainInput = document.getElementById("main-input"); + status.setSiteStatus("focus"); + mainInput?.focus(); + } +}; diff --git a/src/components/AllFunc/AllSet.vue b/src/components/AllFunc/AllSet.vue new file mode 100644 index 0000000..500be2b --- /dev/null +++ b/src/components/AllFunc/AllSet.vue @@ -0,0 +1,104 @@ + + + + diff --git a/src/components/Cover.vue b/src/components/Cover.vue index 9c5175f..57d6018 100644 --- a/src/components/Cover.vue +++ b/src/components/Cover.vue @@ -67,8 +67,9 @@ const imgAnimationEnd = () => { // 图片显示失败 const imgLoadError = () => { - console.error("图片加载失败:", bgUrl.value); bgUrl.value = `/background/bg${bgRandom}.jpg`; + console.error("图片加载失败:", bgUrl.value); + $message.error("壁纸加载失败,已临时切换回默认"); }; onMounted(() => { diff --git a/src/components/Footer.vue b/src/components/Footer.vue index 9a16cf2..332d875 100644 --- a/src/components/Footer.vue +++ b/src/components/Footer.vue @@ -13,5 +13,6 @@ width: 100%; font-size: 14px; color: var(--main-text-color); + z-index: 1; } diff --git a/src/components/Provider.vue b/src/components/Provider.vue index b3833b9..e4a2969 100644 --- a/src/components/Provider.vue +++ b/src/components/Provider.vue @@ -3,6 +3,7 @@
-
+
@@ -43,7 +43,7 @@
@@ -52,8 +52,8 @@