From 04685d65d6ee78cd6dae383cafd6322b1dc7758e Mon Sep 17 00:00:00 2001 From: yutent Date: Tue, 18 Jul 2023 18:24:13 +0800 Subject: [PATCH] init --- .gitignore | 11 + .prettierrc.yaml | 11 + fite.config.js | 44 +++ index.html | 26 ++ package-lock.json | 706 ++++++++++++++++++++++++++++++++++++++ package.json | 14 + public/favicon.ico | Bin 0 -> 16325 bytes src/app.vue | 40 +++ src/assets/logo.svg | 1 + src/components/banner.vue | 99 ++++++ src/components/topbar.vue | 44 +++ src/lib/env.js | 24 ++ src/lib/polyfill.js | 13 + src/main.js | 18 + src/store.js | 110 ++++++ src/views/main.vue | 73 ++++ 16 files changed, 1234 insertions(+) create mode 100644 .gitignore create mode 100644 .prettierrc.yaml create mode 100644 fite.config.js create mode 100644 index.html create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 public/favicon.ico create mode 100644 src/app.vue create mode 100644 src/assets/logo.svg create mode 100644 src/components/banner.vue create mode 100644 src/components/topbar.vue create mode 100644 src/lib/env.js create mode 100644 src/lib/polyfill.js create mode 100644 src/main.js create mode 100644 src/store.js create mode 100644 src/views/main.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0774656 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ + +dist +node_modules + +._* + +.Spotlight-V100 +.Trashes +.DS_Store +.AppleDouble +.LSOverride diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 0000000..6734234 --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,11 @@ + +jsxBracketSameLine: true +jsxSingleQuote: true +semi: false +singleQuote: true +printWidth: 80 +useTabs: false +tabWidth: 2 +trailingComma: none +bracketSpacing: true +arrowParens: avoid diff --git a/fite.config.js b/fite.config.js new file mode 100644 index 0000000..aff1918 --- /dev/null +++ b/fite.config.js @@ -0,0 +1,44 @@ +import { resolve } from 'path' + +export default { + // 用于配置部署目录, 默认为根目录, 如果需要部署到二级目录的话, + // 请取消以下注释, 并填写你最终需要部署的二级目录名, 必须以 / 开头及结尾。如: '/foo/' + // base: '/', + devServer: { + port: 9090, + domain: '', + https: false, + ssl: { + key: '', + cert: '' + // ca: '' //可选 + } + }, + // 如果多页应用, 则这里写传入多个值即可(注意不是数组格式) + pages: { + // 这里的key值, 将是最终的页面的名称 + index: { + // 这里的resolve可将相对路径转为绝对路径 + // 如果传入的路径已经是绝对路径的, 可不需要resolve + entry: resolve('./src/main.js'), + title: 'browser benchmark' + } + }, + inject: { + // v1.0.1之后, 可以注入一个scss, 所有的vue文件中的样式都会被注入这个公共scss + // 注意: 该文件不支持热更新, 不可被vue/js文件引用 (但可以被其他的scss文件引用) + scss: resolve('./src/inject.scss') + }, + // 以下cdn地址, 可自行修改为适合的 + // 有用到其他的库, 可以手动添加, + // 也可以在页面中直接引入完整的路径, 而不必须在这里声明 + imports: { + 'es.shim': '//jscdn.ink/es.shim/latest/index.js', + 'vue-dev': '//jscdn.ink/vue/3.2.47/vue.runtime.esm-browser.js', + vue: '//jscdn.ink/vue/3.2.47/vue.runtime.esm-browser.prod.js', + 'vue-router': '//jscdn.ink/@bytedo/vue-router/4.1.6/vue-router.js', + fetch: '//jscdn.ink/@bytedo/fetch/2.1.5/next.js', + wkit: '//jscdn.ink/wkit/latest/index.js', + '@bd/ui/': '//jscdn.ink/@bd/ui/latest/' + } +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..bd539cb --- /dev/null +++ b/index.html @@ -0,0 +1,26 @@ + + + + + + + {{title}} + + + + + + + {{#if process.env.NODE_ENV === 'development' }} + + {{#/if}} + + +
+ + + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..79a0849 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,706 @@ +{ + "name": "fite-app", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "fite-app", + "devDependencies": { + "fite": "^1.1.12" + } + }, + "node_modules/@babel/parser": { + "version": "7.22.7", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.22.7.tgz", + "integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@bytedo/sass": { + "version": "1.58.3", + "resolved": "https://registry.npmmirror.com/@bytedo/sass/-/sass-1.58.3.tgz", + "integrity": "sha512-HhDX1MERh6KDFykNvQbJM46zf9jBLW6SwqxcdZ/nJ9sZmdRRzHDvwjX2VKAYgGjlz+7r/D2c8CwFFeNaukpV2w==", + "dev": true, + "dependencies": { + "immutable": "^4.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.15.18.tgz", + "integrity": "sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.15.18.tgz", + "integrity": "sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.3.4", + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.4.tgz", + "integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.21.3", + "@vue/shared": "3.3.4", + "estree-walker": "^2.0.2", + "source-map-js": "^1.0.2" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.3.4", + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz", + "integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==", + "dev": true, + "dependencies": { + "@vue/compiler-core": "3.3.4", + "@vue/shared": "3.3.4" + } + }, + "node_modules/@vue/shared": { + "version": "3.3.4", + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.4.tgz", + "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==", + "dev": true + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmmirror.com/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/esbuild": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.15.18.tgz", + "integrity": "sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.15.18", + "@esbuild/linux-loong64": "0.15.18", + "esbuild-android-64": "0.15.18", + "esbuild-android-arm64": "0.15.18", + "esbuild-darwin-64": "0.15.18", + "esbuild-darwin-arm64": "0.15.18", + "esbuild-freebsd-64": "0.15.18", + "esbuild-freebsd-arm64": "0.15.18", + "esbuild-linux-32": "0.15.18", + "esbuild-linux-64": "0.15.18", + "esbuild-linux-arm": "0.15.18", + "esbuild-linux-arm64": "0.15.18", + "esbuild-linux-mips64le": "0.15.18", + "esbuild-linux-ppc64le": "0.15.18", + "esbuild-linux-riscv64": "0.15.18", + "esbuild-linux-s390x": "0.15.18", + "esbuild-netbsd-64": "0.15.18", + "esbuild-openbsd-64": "0.15.18", + "esbuild-sunos-64": "0.15.18", + "esbuild-windows-32": "0.15.18", + "esbuild-windows-64": "0.15.18", + "esbuild-windows-arm64": "0.15.18" + } + }, + "node_modules/esbuild-android-64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-android-64/-/esbuild-android-64-0.15.18.tgz", + "integrity": "sha512-wnpt3OXRhcjfIDSZu9bnzT4/TNTDsOUvip0foZOUBG7QbSt//w3QV4FInVJxNhKc/ErhUxc5z4QjHtMi7/TbgA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-android-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-android-arm64/-/esbuild-android-arm64-0.15.18.tgz", + "integrity": "sha512-G4xu89B8FCzav9XU8EjsXacCKSG2FT7wW9J6hOc18soEHJdtWu03L3TQDGf0geNxfLTtxENKBzMSq9LlbjS8OQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-darwin-64/-/esbuild-darwin-64-0.15.18.tgz", + "integrity": "sha512-2WAvs95uPnVJPuYKP0Eqx+Dl/jaYseZEUUT1sjg97TJa4oBtbAKnPnl3b5M9l51/nbx7+QAEtuummJZW0sBEmg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.18.tgz", + "integrity": "sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.18.tgz", + "integrity": "sha512-TT3uBUxkteAjR1QbsmvSsjpKjOX6UkCstr8nMr+q7zi3NuZ1oIpa8U41Y8I8dJH2fJgdC3Dj3CXO5biLQpfdZA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.18.tgz", + "integrity": "sha512-R/oVr+X3Tkh+S0+tL41wRMbdWtpWB8hEAMsOXDumSSa6qJR89U0S/PpLXrGF7Wk/JykfpWNokERUpCeHDl47wA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-32": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-linux-32/-/esbuild-linux-32-0.15.18.tgz", + "integrity": "sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-linux-64/-/esbuild-linux-64-0.15.18.tgz", + "integrity": "sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-linux-arm/-/esbuild-linux-arm-0.15.18.tgz", + "integrity": "sha512-UH779gstRblS4aoS2qpMl3wjg7U0j+ygu3GjIeTonCcN79ZvpPee12Qun3vcdxX+37O5LFxz39XeW2I9bybMVA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.18.tgz", + "integrity": "sha512-54qr8kg/6ilcxd+0V3h9rjT4qmjc0CccMVWrjOEM/pEcUzt8X62HfBSeZfT2ECpM7104mk4yfQXkosY8Quptug==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-mips64le": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.18.tgz", + "integrity": "sha512-Mk6Ppwzzz3YbMl/ZZL2P0q1tnYqh/trYZ1VfNP47C31yT0K8t9s7Z077QrDA/guU60tGNp2GOwCQnp+DYv7bxQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-ppc64le": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.18.tgz", + "integrity": "sha512-b0XkN4pL9WUulPTa/VKHx2wLCgvIAbgwABGnKMY19WhKZPT+8BxhZdqz6EgkqCLld7X5qiCY2F/bfpUUlnFZ9w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-riscv64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.18.tgz", + "integrity": "sha512-ba2COaoF5wL6VLZWn04k+ACZjZ6NYniMSQStodFKH/Pu6RxzQqzsmjR1t9QC89VYJxBeyVPTaHuBMCejl3O/xg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-s390x": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.18.tgz", + "integrity": "sha512-VbpGuXEl5FCs1wDVp93O8UIzl3ZrglgnSQ+Hu79g7hZu6te6/YHgVJxCM2SqfIila0J3k0csfnf8VD2W7u2kzQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-netbsd-64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.18.tgz", + "integrity": "sha512-98ukeCdvdX7wr1vUYQzKo4kQ0N2p27H7I11maINv73fVEXt2kyh4K4m9f35U1K43Xc2QGXlzAw0K9yoU7JUjOg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-openbsd-64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.18.tgz", + "integrity": "sha512-yK5NCcH31Uae076AyQAXeJzt/vxIo9+omZRKj1pauhk3ITuADzuOx5N2fdHrAKPxN+zH3w96uFKlY7yIn490xQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-sunos-64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-sunos-64/-/esbuild-sunos-64-0.15.18.tgz", + "integrity": "sha512-On22LLFlBeLNj/YF3FT+cXcyKPEI263nflYlAhz5crxtp3yRG1Ugfr7ITyxmCmjm4vbN/dGrb/B7w7U8yJR9yw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-32": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-windows-32/-/esbuild-windows-32-0.15.18.tgz", + "integrity": "sha512-o+eyLu2MjVny/nt+E0uPnBxYuJHBvho8vWsC2lV61A7wwTWC3jkN2w36jtA+yv1UgYkHRihPuQsL23hsCYGcOQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-windows-64/-/esbuild-windows-64-0.15.18.tgz", + "integrity": "sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.18.tgz", + "integrity": "sha512-q9bsYzegpZcLziq0zgUi5KqGVtfhjxGbnksaBFYmWLxeV/S1fK4OLdq2DFYnXcLMjlZw2L0jLsk1eGoB522WXQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fite": { + "version": "1.1.12", + "resolved": "https://registry.npmmirror.com/fite/-/fite-1.1.12.tgz", + "integrity": "sha512-fXNxwbBsELEkFkscnxe25BirpAN6N9Weuf8/hrsUTc4vR12wudXY5P+vFevCBSDz1dgiI7JBG71lpWmVIhLpYQ==", + "dev": true, + "dependencies": { + "@bytedo/sass": "^1.54.8", + "@vue/compiler-dom": "^3.2.47", + "chokidar": "^3.5.3", + "esbuild": "^0.15.13", + "iofs": "^1.5.2", + "kolorist": "^1.6.0", + "ws": "^8.12.0" + }, + "bin": { + "fite": "index.js" + }, + "engines": { + "node": ">=16.6.0" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/immutable": { + "version": "4.3.1", + "resolved": "https://registry.npmmirror.com/immutable/-/immutable-4.3.1.tgz", + "integrity": "sha512-lj9cnmB/kVS0QHsJnYKD1uo3o39nrbKxszjnqS9Fr6NB7bZzW45U6WSGBPKXDL/CvDKqDNPA4r3DoDQ8GTxo2A==", + "dev": true + }, + "node_modules/iofs": { + "version": "1.5.3", + "resolved": "https://registry.npmmirror.com/iofs/-/iofs-1.5.3.tgz", + "integrity": "sha512-ERQxIQHVVaHJDLtgQU84E6a98r+zKwxOHX230FEKHxjKfvfSqAhfPtpVW2Atmi3VbGlSlqvdQK3GOXUXe8F8RQ==", + "dev": true + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmmirror.com/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/kolorist": { + "version": "1.8.0", + "resolved": "https://registry.npmmirror.com/kolorist/-/kolorist-1.8.0.tgz", + "integrity": "sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==", + "dev": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmmirror.com/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ws": { + "version": "8.13.0", + "resolved": "https://registry.npmmirror.com/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..271dd15 --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ + +{ + "name": "fite-app", + "type": "module", + "scripts": { + "start": "fite dev", + "build": "fite build", + "build:keep": "fite build --no-clean" + }, + "devDependencies": { + "fite": "^1.1.12" + } +} + \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..ca9a21a7e9b1fad48ae6760d390004d6450cd9bd GIT binary patch literal 16325 zcmeHOdu&@*8NY744g{N+CdM{t(?EdO5CQ}f0u{zXh%(C924a6q41{=$0TPdacq7(r zK$5;uqT0 z;1&-BtjDqJM$m6mHRWrSQ@P5ie5JDR9nA+H>Z@NpGg?10+IXSi#pXj_tlV@9&|v_E z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0,0 +1,40 @@ + + + + + + + diff --git a/src/assets/logo.svg b/src/assets/logo.svg new file mode 100644 index 0000000..e2a9ebf --- /dev/null +++ b/src/assets/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/banner.vue b/src/components/banner.vue new file mode 100644 index 0000000..7894761 --- /dev/null +++ b/src/components/banner.vue @@ -0,0 +1,99 @@ + + + diff --git a/src/components/topbar.vue b/src/components/topbar.vue new file mode 100644 index 0000000..57952b8 --- /dev/null +++ b/src/components/topbar.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/src/lib/env.js b/src/lib/env.js new file mode 100644 index 0000000..c8098a0 --- /dev/null +++ b/src/lib/env.js @@ -0,0 +1,24 @@ +/** + * {解析当前系统环境} + * @author yutent + * @date 2023/07/18 16:16:02 + */ + +const UA = navigator.userAgent.toLowerCase() + +const IS_CHROME = !!window.chrome +const IS_FIREFOX = !!window.sidebar + +const IS_LINUX = UA.includes('linux') + +const OS_NAME = IS_LINUX ? 'Linux' : 'MacOS' +const SCREEN = `${screen.width} x ${screen.height}` + +const BROWSER_NAME = IS_CHROME ? 'Chrome' : IS_FIREFOX ? 'Firefox' : 'Unknow' +const GENERAL_VERSION = UA.match(/version\/([\d\.]*?) /) || [null, 'unknow'] + +const BROWSER_VERSION = IS_CHROME + ? UA.match(/chrome\/([\d\.]*?) /)[1] + : GENERAL_VERSION[1] + +export { OS_NAME, BROWSER_NAME, BROWSER_VERSION, SCREEN } diff --git a/src/lib/polyfill.js b/src/lib/polyfill.js new file mode 100644 index 0000000..f505314 --- /dev/null +++ b/src/lib/polyfill.js @@ -0,0 +1,13 @@ +/** + * {} + * @author yutent + * @date 2023/07/18 16:51:11 + */ + +if (!Array.prototype.sum) { + Object.defineProperty(Array.prototype, 'sum', { + value() { + return this.reduce((it, sum) => sum + it, 0) + } + }) +} diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..f847216 --- /dev/null +++ b/src/main.js @@ -0,0 +1,18 @@ +/** + * {} + * @author yutent + * @date 2023/07/18 16:01:13 + */ + +import 'es.shim' +import '@/lib/polyfill.js' + +import '@bd/ui/card/index.js' +import '@bd/ui/space/index.js' + +import { createApp } from 'vue' +import App from './app.vue' + +import store from './store' + +createApp(App).use(store).mount('#app') diff --git a/src/store.js b/src/store.js new file mode 100644 index 0000000..2cfbce1 --- /dev/null +++ b/src/store.js @@ -0,0 +1,110 @@ +import { reactive } from 'vue' + +import * as env from '@/lib/env.js' + +function checkCanvas(type) { + try { + var canvas = document.createElement('canvas') + var ctx = canvas.getContext(type) + return ctx ? 1 : 0 + } catch (err) { + console.log(err) + return 0 + } +} + +const store = reactive({ + total: 100, + scores: 80, + useragent: navigator.userAgent, + env, + + modules: [ + { + name: '音频支持', + total: 0, + scores: [!!window.AudioContext ^ 0, 1, 1, 1, 1, 1, 1], + items: [ + 'Web Audio API', + 'pcm audio support', + 'mp3 support', + 'flac support', + 'aac support', + 'ogg support', + 'webm support', + 'Dolby Digital support', + 'Dolby Digital Plus support' + ] + }, + { + name: '视频支持', + total: 0, + scores: [0, 1, 1, 1, 1, 1], + items: [ + 'MPEG-4 ASP support', + 'H.264 support', + 'H.265 support', + 'Ogg Theora support', + 'WebM with VP8 support', + 'WebM with VP9 support' + ] + }, + { + name: '流媒体', + total: 0, + scores: [1, 1, 0, 0], + items: [ + 'Media Source extensions', + 'DRM support', + 'Dynamic Adaptive Streaming / MPEG-DASH', + 'HTTP Live Streaming / HLS' + ] + }, + { + name: '自定义组件', + total: 0, + scores: [ + !!window.customElements ^ 0, + !!document.body.attachShadow ^ 0, + !!document.adoptedStyleSheets ^ 0 + ], + items: ['Custom elements', 'Shadow DOM', 'adoptedStyleSheets'] + }, + { + name: '图形图象支持', + total: 0, + scores: [ + checkCanvas('2d'), + checkCanvas('webgl'), + checkCanvas('webgl2'), + checkCanvas('webgpu'), + !!navigator.xr ^ 0 + ], + items: ['canvas 2D', 'WebGL', 'WebGL 2', 'WebGPU', 'WebVR'] + }, + { + name: '网络', + total: 0, + scores: [ + !!window.EventSource ^ 0, + !!window.WebSocket ^ 0, + !!window.fetch ^ 0, + !!File.prototype.arrayBuffer ^ 0 + ], + items: [ + 'Server-Sent events', + 'websocket', + 'fetch api', + 'ArrayBuffer and Blob support' + ] + } + ] +}) + +store.modules.forEach(it => (it.total = it.items.length)) +store.scores = store.modules.map(it => it.scores.sum()).sum() +store.total = store.modules.map(it => it.total).sum() + +export default function (app) { + app.config.globalProperties.$store = store +} diff --git a/src/views/main.vue b/src/views/main.vue new file mode 100644 index 0000000..3af6954 --- /dev/null +++ b/src/views/main.vue @@ -0,0 +1,73 @@ + + + + +