From de07746a904e62525e1a97c4400271688e6b9791 Mon Sep 17 00:00:00 2001 From: lhy1205 <972982286@qq.com> Date: Thu, 11 Jan 2024 18:20:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Dropdown.vue | 36 ++++++++++++++++++++++++++++ components/Header.vue | 25 ++++++++++++++++--- components/SvgIcon.vue | 29 ++++++++++++++++++++++ pages/explore.vue | 21 +++++++++++++++- pages/explore/{index.vue => des.vue} | 2 +- pages/explore/install.vue | 8 +++++++ pages/explore/use.vue | 8 +++++++ static/image/svgIcon/404.svg | 1 + static/style/base.less | 10 ++++---- 9 files changed, 129 insertions(+), 11 deletions(-) create mode 100644 components/Dropdown.vue create mode 100644 components/SvgIcon.vue rename pages/explore/{index.vue => des.vue} (74%) create mode 100644 pages/explore/install.vue create mode 100644 pages/explore/use.vue create mode 100644 static/image/svgIcon/404.svg diff --git a/components/Dropdown.vue b/components/Dropdown.vue new file mode 100644 index 0000000..73ce87b --- /dev/null +++ b/components/Dropdown.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/components/Header.vue b/components/Header.vue index 3275593..3f38611 100644 --- a/components/Header.vue +++ b/components/Header.vue @@ -9,8 +9,7 @@
- explore - about +
@@ -21,5 +20,25 @@ diff --git a/components/SvgIcon.vue b/components/SvgIcon.vue new file mode 100644 index 0000000..dd603a0 --- /dev/null +++ b/components/SvgIcon.vue @@ -0,0 +1,29 @@ +import { default } from '../.nuxt/components/nuxt-build-indicator.vue'; + + diff --git a/pages/explore.vue b/pages/explore.vue index daad90f..16d3222 100644 --- a/pages/explore.vue +++ b/pages/explore.vue @@ -1,8 +1,27 @@ + diff --git a/pages/explore/index.vue b/pages/explore/des.vue similarity index 74% rename from pages/explore/index.vue rename to pages/explore/des.vue index daad90f..c322cef 100644 --- a/pages/explore/index.vue +++ b/pages/explore/des.vue @@ -1,5 +1,5 @@ diff --git a/pages/explore/use.vue b/pages/explore/use.vue new file mode 100644 index 0000000..e142e8f --- /dev/null +++ b/pages/explore/use.vue @@ -0,0 +1,8 @@ + + + diff --git a/static/image/svgIcon/404.svg b/static/image/svgIcon/404.svg new file mode 100644 index 0000000..6df5019 --- /dev/null +++ b/static/image/svgIcon/404.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/style/base.less b/static/style/base.less index 2ca31be..de7f1b8 100644 --- a/static/style/base.less +++ b/static/style/base.less @@ -31,14 +31,11 @@ a { ul { list-style-type: none; padding: 0; - display: flex; - justify-content: center; - flex-wrap: wrap; li { - margin: 0 0.5rem; - padding: 0.25rem; - font-size: 1.2rem; + // margin: 0 0.5rem; + // padding: 0.25rem; + // font-size: 1.2rem; } } @@ -71,6 +68,7 @@ ul { } .header-center { + height: 100%; flex: 1; display: flex; justify-content: space-evenly; -- Gitee From 3b658bc1a41cf95d59caad94dfd5753388022fab Mon Sep 17 00:00:00 2001 From: lhy1205 <972982286@qq.com> Date: Fri, 12 Jan 2024 15:11:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Dropdown.vue | 10 +- components/Header.vue | 61 ++- components/SvgIcon.vue | 21 +- nuxt.config.js | 15 +- package-lock.json | 642 +++++++++++++++++++++++++- package.json | 3 +- plugins/icons.js | 9 + static/image/svgIcon/dark.svg | 1 + static/image/svgIcon/github.svg | 1 + static/image/svgIcon/light.svg | 1 + static/image/svgIcon/system-theme.svg | 1 + static/style/base.less | 38 +- store/index.js | 24 + store/theme.js | 16 + 14 files changed, 817 insertions(+), 26 deletions(-) create mode 100644 plugins/icons.js create mode 100644 static/image/svgIcon/dark.svg create mode 100644 static/image/svgIcon/github.svg create mode 100644 static/image/svgIcon/light.svg create mode 100644 static/image/svgIcon/system-theme.svg create mode 100644 store/index.js create mode 100644 store/theme.js diff --git a/components/Dropdown.vue b/components/Dropdown.vue index 73ce87b..8c881da 100644 --- a/components/Dropdown.vue +++ b/components/Dropdown.vue @@ -5,10 +5,12 @@ {{ data.name }} - - - {{ item.name }} - + +
+ + {{ item.name }} + +
diff --git a/components/Header.vue b/components/Header.vue index 3f38611..29c5f37 100644 --- a/components/Header.vue +++ b/components/Header.vue @@ -12,8 +12,10 @@
- - Nuxt + + + +
@@ -21,6 +23,7 @@ diff --git a/components/SvgIcon.vue b/components/SvgIcon.vue index dd603a0..0f8ebf8 100644 --- a/components/SvgIcon.vue +++ b/components/SvgIcon.vue @@ -7,23 +7,18 @@ import { default } from '../.nuxt/components/nuxt-build-indicator.vue'; diff --git a/nuxt.config.js b/nuxt.config.js index 83e526b..23f5e98 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -1,3 +1,4 @@ +import path from 'node:path' export default { // Global page headers: https://go.nuxtjs.dev/config-head head: { @@ -18,7 +19,7 @@ export default { css: ['element-ui/lib/theme-chalk/index.css', '~/static/style/base.less'], // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins - plugins: ['@/plugins/element-ui'], + plugins: ['@/plugins/element-ui', { src: '@/plugins/icons', ssr: true }], // Auto import components: https://go.nuxtjs.dev/config-components components: true, @@ -41,5 +42,17 @@ export default { // Build Configuration: https://go.nuxtjs.dev/config-build build: { transpile: [/^element-ui/], + extend(config, ctx) { + const svgRule = config.module.rules.find((rule) => rule.test.test('.svg')) + svgRule.exclude = [path.resolve(__dirname, 'static/image/svgIcon')] + config.module.rules.push({ + test: /\.svg$/, + include: [path.resolve(__dirname, 'static/image/svgIcon')], + loader: 'svg-sprite-loader', + options: { + symbolId: 'icon-[name]', + }, + }) + }, }, } diff --git a/package-lock.json b/package-lock.json index 08bf8ab..1b0097a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,8 @@ "eslint-config-prettier": "^8.5.0", "less": "^4.2.0", "less-loader": "^7.3.0", - "prettier": "^2.7.1" + "prettier": "^2.7.1", + "svg-sprite-loader": "^6.0.11" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -4947,6 +4948,15 @@ "node": ">= 10" } }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, "node_modules/collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/collection-visit/-/collection-visit-1.0.0.tgz", @@ -5823,6 +5833,12 @@ "node": ">= 4" } }, + "node_modules/domready": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/domready/-/domready-1.0.8.tgz", + "integrity": "sha512-uIzsOJUNk+AdGE9a6VDeessoMCzF8RrZvJCX/W8QtyfgdR6Uofn/MvRonih3OtCO79b2VDzDOymuiABrQ4z3XA==", + "dev": true + }, "node_modules/domutils": { "version": "3.1.0", "resolved": "https://registry.npmmirror.com/domutils/-/domutils-3.1.0.tgz", @@ -7309,6 +7325,27 @@ "node": ">=4" } }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-ansi/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmmirror.com/has-bigints/-/has-bigints-1.0.2.tgz", @@ -7780,7 +7817,6 @@ "resolved": "https://registry.npmmirror.com/image-size/-/image-size-0.5.5.tgz", "integrity": "sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==", "dev": true, - "optional": true, "bin": { "image-size": "bin/image-size.js" }, @@ -8241,6 +8277,12 @@ "jiti": "bin/jiti.js" } }, + "node_modules/js-base64": { + "version": "2.6.4", + "resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", + "dev": true + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz", @@ -8680,6 +8722,27 @@ "node": ">=4.3.0 <5.0.0 || >=5.10" } }, + "node_modules/merge-options": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/merge-options/-/merge-options-1.0.1.tgz", + "integrity": "sha512-iuPV41VWKWBIOpBsjoxjDZw8/GbSfZ2mk7N1453bwMrfzdrIk7EzBd+8UVR6rkw67th7xnk9Dytl3J+lHPdxvg==", + "dev": true, + "dependencies": { + "is-plain-obj": "^1.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/merge-options/node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/merge-source-map": { "version": "1.1.0", "resolved": "https://registry.npmmirror.com/merge-source-map/-/merge-source-map-1.1.0.tgz", @@ -8880,6 +8943,12 @@ "node": ">=4.0.0" } }, + "node_modules/mitt": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/mitt/-/mitt-1.1.2.tgz", + "integrity": "sha512-3btxP0O9iGADGWAkteQ8mzDtEspZqu4I32y4GZYCV5BrwtzdcRpF4dQgNdJadCrbBx7Lu6Sq9AVrerMHR0Hkmw==", + "dev": true + }, "node_modules/mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmmirror.com/mixin-deep/-/mixin-deep-1.3.2.tgz", @@ -11180,6 +11249,15 @@ "postcss": "^8.4" } }, + "node_modules/postcss-prefix-selector": { + "version": "1.16.0", + "resolved": "https://registry.npmmirror.com/postcss-prefix-selector/-/postcss-prefix-selector-1.16.0.tgz", + "integrity": "sha512-rdVMIi7Q4B0XbXqNUEI+Z4E+pueiu/CS5E6vRCQommzdQ/sgsS4dK42U7GX8oJR+TJOtT+Qv3GkNo6iijUMp3Q==", + "dev": true, + "peerDependencies": { + "postcss": ">4 <9" + } + }, "node_modules/postcss-preset-env": { "version": "9.3.0", "resolved": "https://registry.npmmirror.com/postcss-preset-env/-/postcss-preset-env-9.3.0.tgz", @@ -11392,6 +11470,161 @@ "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, + "node_modules/posthtml": { + "version": "0.9.2", + "resolved": "https://registry.npmmirror.com/posthtml/-/posthtml-0.9.2.tgz", + "integrity": "sha512-spBB5sgC4cv2YcW03f/IAUN1pgDJWNWD8FzkyY4mArLUMJW+KlQhlmUdKAHQuPfb00Jl5xIfImeOsf6YL8QK7Q==", + "dev": true, + "dependencies": { + "posthtml-parser": "^0.2.0", + "posthtml-render": "^1.0.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/posthtml-parser": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/posthtml-parser/-/posthtml-parser-0.2.1.tgz", + "integrity": "sha512-nPC53YMqJnc/+1x4fRYFfm81KV2V+G9NZY+hTohpYg64Ay7NemWWcV4UWuy/SgMupqQ3kJ88M/iRfZmSnxT+pw==", + "dev": true, + "dependencies": { + "htmlparser2": "^3.8.3", + "isobject": "^2.1.0" + } + }, + "node_modules/posthtml-parser/node_modules/dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmmirror.com/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "dev": true, + "dependencies": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + } + }, + "node_modules/posthtml-parser/node_modules/dom-serializer/node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true + }, + "node_modules/posthtml-parser/node_modules/dom-serializer/node_modules/entities": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true + }, + "node_modules/posthtml-parser/node_modules/domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, + "node_modules/posthtml-parser/node_modules/domhandler": { + "version": "2.4.2", + "resolved": "https://registry.npmmirror.com/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "dev": true, + "dependencies": { + "domelementtype": "1" + } + }, + "node_modules/posthtml-parser/node_modules/domutils": { + "version": "1.7.0", + "resolved": "https://registry.npmmirror.com/domutils/-/domutils-1.7.0.tgz", + "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "dev": true, + "dependencies": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "node_modules/posthtml-parser/node_modules/entities": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", + "dev": true + }, + "node_modules/posthtml-parser/node_modules/htmlparser2": { + "version": "3.10.1", + "resolved": "https://registry.npmmirror.com/htmlparser2/-/htmlparser2-3.10.1.tgz", + "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", + "dev": true, + "dependencies": { + "domelementtype": "^1.3.1", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^3.1.1" + } + }, + "node_modules/posthtml-parser/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", + "dev": true, + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/posthtml-parser/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/posthtml-rename-id": { + "version": "1.0.12", + "resolved": "https://registry.npmmirror.com/posthtml-rename-id/-/posthtml-rename-id-1.0.12.tgz", + "integrity": "sha512-UKXf9OF/no8WZo9edRzvuMenb6AD5hDLzIepJW+a4oJT+T/Lx7vfMYWT4aWlGNQh0WMhnUx1ipN9OkZ9q+ddEw==", + "dev": true, + "dependencies": { + "escape-string-regexp": "1.0.5" + } + }, + "node_modules/posthtml-rename-id/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/posthtml-render": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/posthtml-render/-/posthtml-render-1.4.0.tgz", + "integrity": "sha512-W1779iVHGfq0Fvh2PROhCe2QhB8mEErgqzo1wpIt36tCgChafP+hbXIhLDOM8ePJrZcFs0vkNEtdibEWVqChqw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/posthtml-svg-mode": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/posthtml-svg-mode/-/posthtml-svg-mode-1.0.3.tgz", + "integrity": "sha512-hEqw9NHZ9YgJ2/0G7CECOeuLQKZi8HjWLkBaSVtOWjygQ9ZD8P7tqeowYs7WrFdKsWEKG7o+IlsPY8jrr0CJpQ==", + "dev": true, + "dependencies": { + "merge-options": "1.0.1", + "posthtml": "^0.9.2", + "posthtml-parser": "^0.2.1", + "posthtml-render": "^1.0.6" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmmirror.com/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -12854,6 +13087,384 @@ "node": ">= 0.4" } }, + "node_modules/svg-baker": { + "version": "1.7.0", + "resolved": "https://registry.npmmirror.com/svg-baker/-/svg-baker-1.7.0.tgz", + "integrity": "sha512-nibslMbkXOIkqKVrfcncwha45f97fGuAOn1G99YwnwTj8kF9YiM6XexPcUso97NxOm6GsP0SIvYVIosBis1xLg==", + "dev": true, + "dependencies": { + "bluebird": "^3.5.0", + "clone": "^2.1.1", + "he": "^1.1.1", + "image-size": "^0.5.1", + "loader-utils": "^1.1.0", + "merge-options": "1.0.1", + "micromatch": "3.1.0", + "postcss": "^5.2.17", + "postcss-prefix-selector": "^1.6.0", + "posthtml-rename-id": "^1.0", + "posthtml-svg-mode": "^1.0.3", + "query-string": "^4.3.2", + "traverse": "^0.6.6" + } + }, + "node_modules/svg-baker-runtime": { + "version": "1.4.7", + "resolved": "https://registry.npmmirror.com/svg-baker-runtime/-/svg-baker-runtime-1.4.7.tgz", + "integrity": "sha512-Zorfwwj5+lWjk/oxwSMsRdS2sPQQdTmmsvaSpzU+i9ZWi3zugHLt6VckWfnswphQP0LmOel3nggpF5nETbt6xw==", + "dev": true, + "dependencies": { + "deepmerge": "1.3.2", + "mitt": "1.1.2", + "svg-baker": "^1.7.0" + } + }, + "node_modules/svg-baker-runtime/node_modules/deepmerge": { + "version": "1.3.2", + "resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-1.3.2.tgz", + "integrity": "sha512-qjMjTrk+RKv/sp4RPDpV5CnKhxjFI9p+GkLBOls5A8EEElldYWCWA9zceAkmfd0xIo2aU1nxiaLFoiya2sb6Cg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmmirror.com/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dev": true, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/chalk/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/svg-baker/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/svg-baker/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmmirror.com/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/svg-baker/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/svg-baker/node_modules/micromatch": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/micromatch/-/micromatch-3.1.0.tgz", + "integrity": "sha512-3StSelAE+hnRvMs8IdVW7Uhk8CVed5tp+kLLGlBP6WiRAXS21GPGu/Nat4WNPXj2Eoc24B02SaeoyozPMfj0/g==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.2.2", + "define-property": "^1.0.0", + "extend-shallow": "^2.0.1", + "extglob": "^2.0.2", + "fragment-cache": "^0.2.1", + "kind-of": "^5.0.2", + "nanomatch": "^1.2.1", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/postcss": { + "version": "5.2.18", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-5.2.18.tgz", + "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "dev": true, + "dependencies": { + "chalk": "^1.1.3", + "js-base64": "^2.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/svg-baker/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-baker/node_modules/supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==", + "dev": true, + "dependencies": { + "has-flag": "^1.0.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/svg-baker/node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-sprite-loader": { + "version": "6.0.11", + "resolved": "https://registry.npmmirror.com/svg-sprite-loader/-/svg-sprite-loader-6.0.11.tgz", + "integrity": "sha512-TedsTf8wsHH6HgdwKjUveDZRC6q5gPloYV8A8/zZaRWP929J7x6TzQ6MvZFl+YYDJuJ0Akyuu/vNVJ+fbPuYXg==", + "dev": true, + "dependencies": { + "bluebird": "^3.5.0", + "deepmerge": "1.3.2", + "domready": "1.0.8", + "escape-string-regexp": "1.0.5", + "loader-utils": "^1.1.0", + "svg-baker": "^1.5.0", + "svg-baker-runtime": "^1.4.7", + "url-slug": "2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/svg-sprite-loader/node_modules/deepmerge": { + "version": "1.3.2", + "resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-1.3.2.tgz", + "integrity": "sha512-qjMjTrk+RKv/sp4RPDpV5CnKhxjFI9p+GkLBOls5A8EEElldYWCWA9zceAkmfd0xIo2aU1nxiaLFoiya2sb6Cg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svg-sprite-loader/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/svg-sprite-loader/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/svg-sprite-loader/node_modules/loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/svg-tags": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/svg-tags/-/svg-tags-1.0.0.tgz", @@ -13182,6 +13793,15 @@ "resolved": "https://registry.npmmirror.com/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, + "node_modules/traverse": { + "version": "0.6.8", + "resolved": "https://registry.npmmirror.com/traverse/-/traverse-0.6.8.tgz", + "integrity": "sha512-aXJDbk6SnumuaZSANd21XAo15ucCDE38H4fkqiGsc3MhCK+wOlZvLP9cB/TvpHT0mOyWgC4Z8EwRlzqYSUzdsA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/ts-pnp": { "version": "1.2.0", "resolved": "https://registry.npmmirror.com/ts-pnp/-/ts-pnp-1.2.0.tgz", @@ -13367,6 +13987,15 @@ "node": ">=4" } }, + "node_modules/unidecode": { + "version": "0.1.8", + "resolved": "https://registry.npmmirror.com/unidecode/-/unidecode-0.1.8.tgz", + "integrity": "sha512-SdoZNxCWpN2tXTCrGkPF/0rL2HEq+i2gwRG1ReBvx8/0yTzC3enHfugOf8A9JBShVwwrRIkLX0YcDUGbzjbVCA==", + "dev": true, + "engines": { + "node": ">= 0.4.12" + } + }, "node_modules/union-value": { "version": "1.0.1", "resolved": "https://registry.npmmirror.com/union-value/-/union-value-1.0.1.tgz", @@ -13552,6 +14181,15 @@ "node": ">= 10.13.0" } }, + "node_modules/url-slug": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/url-slug/-/url-slug-2.0.0.tgz", + "integrity": "sha512-aiNmSsVgrjCiJ2+KWPferjT46YFKoE8i0YX04BlMVDue022Xwhg/zYlnZ6V9/mP3p8Wj7LEp0myiTkC/p6sxew==", + "dev": true, + "dependencies": { + "unidecode": "0.1.8" + } + }, "node_modules/url/node_modules/punycode": { "version": "1.4.1", "resolved": "https://registry.npmmirror.com/punycode/-/punycode-1.4.1.tgz", diff --git a/package.json b/package.json index 123c54a..b6f4750 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "eslint-config-prettier": "^8.5.0", "less": "^4.2.0", "less-loader": "^7.3.0", - "prettier": "^2.7.1" + "prettier": "^2.7.1", + "svg-sprite-loader": "^6.0.11" } } diff --git a/plugins/icons.js b/plugins/icons.js new file mode 100644 index 0000000..6faeafc --- /dev/null +++ b/plugins/icons.js @@ -0,0 +1,9 @@ +import Vue from 'vue' +import SvgIconVue from '~/components/SvgIcon.vue' + +Vue.component('SvgIcon', SvgIconVue) + +const requireAll = (requireContext) => requireContext.keys().map(requireContext) + +const req = require.context('~/static/image/svgIcon', true, /\.svg$/) +requireAll(req) diff --git a/static/image/svgIcon/dark.svg b/static/image/svgIcon/dark.svg new file mode 100644 index 0000000..2313bac --- /dev/null +++ b/static/image/svgIcon/dark.svg @@ -0,0 +1 @@ + diff --git a/static/image/svgIcon/github.svg b/static/image/svgIcon/github.svg new file mode 100644 index 0000000..33fc05a --- /dev/null +++ b/static/image/svgIcon/github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/svgIcon/light.svg b/static/image/svgIcon/light.svg new file mode 100644 index 0000000..e5fca1b --- /dev/null +++ b/static/image/svgIcon/light.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/image/svgIcon/system-theme.svg b/static/image/svgIcon/system-theme.svg new file mode 100644 index 0000000..3c98b40 --- /dev/null +++ b/static/image/svgIcon/system-theme.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/style/base.less b/static/style/base.less index de7f1b8..fff298f 100644 --- a/static/style/base.less +++ b/static/style/base.less @@ -5,9 +5,45 @@ } :root { - --primary-color: #00c58e; + // light theme + --primary-color: #000000; + --primary-background-color: #ffffff; + + + // dark theme + --primary-color-dark: #ffffff; + --primary-background-color-dark: #000000; +} + +body[data-theme="light"] { + *{ + background: var(--primary-background-color); + color: var(--primary-color); + } } +body[data-theme="dark"] { + *{ + background: var(--primary-background-color-dark); + color: var(--primary-color-dark); + } +} + +// @media (prefers-color-scheme: dark) { +// body { +// background: var(--primary-background-color-dark); +// color: var(--primary-color-dark); +// } +// } + +// @media (prefers-color-scheme: light) { +// body { +// background: var(--primary-background-color); +// color: var(--primary-color); +// } +// } + + body { font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, diff --git a/store/index.js b/store/index.js new file mode 100644 index 0000000..1109ad0 --- /dev/null +++ b/store/index.js @@ -0,0 +1,24 @@ +export const state = () => ({ + counter: 0 +}) + +export const getters = { + getCounter(state) { + return state.counter + } +} + +export const mutations = { + increment(state) { + state.counter++ + } +} + +export const actions = { + async fetchCounter({ state }) { + // make request + const res = { data: 10 }; + state.counter = res.data; + return res.data; + } +} diff --git a/store/theme.js b/store/theme.js new file mode 100644 index 0000000..52326de --- /dev/null +++ b/store/theme.js @@ -0,0 +1,16 @@ +export const state = () => ({ + theme: 'system-theme', +}) + +export const mutations = { + changeTheme(state, data) { + state.theme = data || 'system-theme' + document.body.setAttribute('data-theme', state.theme) + }, +} + +export const actions = { + async changeThemeAction(context) { + context.commit('changeTheme') + }, +} -- Gitee