├── public ├── favicon.ico └── index.html ├── vue.config.js ├── babel.config.js ├── src ├── main.js ├── bookmark │ ├── index.js │ └── Main.vue ├── components │ ├── abyss │ │ ├── RevealRankBox.vue │ │ ├── RankBox.vue │ │ ├── SummaryBox.vue │ │ └── FloorBox.vue │ ├── base │ │ ├── HomeBox.vue │ │ ├── ExplorationBox.vue │ │ ├── AvatarBox.vue │ │ └── SummaryBox.vue │ ├── BaseInfo.vue │ └── AbyssInfo.vue ├── utils │ └── DateUtils.js └── App.vue ├── README.md ├── .gitignore ├── package.json ├── .github └── workflows │ └── ci.yml └── webpack.config.js /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/babalae/genshin-info/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | productionSourceMap: false, 3 | publicPath: './' 4 | } 5 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import 'bulma/css/bulma.css' 4 | import DateUtils from './utils/DateUtils.js' 5 | 6 | Vue.config.productionTip = false 7 | 8 | new Vue({ 9 | render: h => h(App), 10 | }).$mount('#app') 11 | 12 | Vue.use(DateUtils) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 原神角色信息查询工具 2 | 3 | 原神角色信息查询工具的前端代码, 4 | 5 | 能查到的内容大概和米游社一致。 6 | 7 | 地址:https://babalae.github.io/genshin-info/ 8 | 9 | ## 参考 10 | 11 | https://github.com/Womsxd/YuanShen_User_Info 12 | 13 | 感谢 [Steesha](https://github.com/Steesha) 提供DS的算法 14 | 15 | 感谢 [Womsxd](https://github.com/Womsxd) 的后端代码 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /src/bookmark/index.js: -------------------------------------------------------------------------------- 1 | import Main from './Main.vue' 2 | import DateUtils from './../utils/DateUtils.js' 3 | import html2canvas from 'html2canvas'; 4 | // import Vue from "vue"; 5 | 6 | Main.install = function (Vue) { 7 | Vue.component(Main.name, Main); 8 | } 9 | 10 | const components = [ 11 | Main 12 | ] 13 | const install = function (Vue) { 14 | components.forEach(component => { 15 | Vue.component(component.name, component); 16 | }); 17 | } 18 | 19 | if (typeof window !== 'undefined' && window.Vue) { 20 | install(window.Vue); 21 | Vue.use(DateUtils); 22 | Vue.use(html2canvas); 23 | } 24 | 25 | export default { 26 | install, 27 | Main 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /src/components/abyss/RevealRankBox.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 22 | 23 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 原神角色信息查询 9 | 10 | 18 | 19 | 20 | 24 |
25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/components/base/HomeBox.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 30 | 31 | 45 | -------------------------------------------------------------------------------- /src/components/abyss/RankBox.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | 36 | 37 | -------------------------------------------------------------------------------- /src/utils/DateUtils.js: -------------------------------------------------------------------------------- 1 | exports.install = function (Vue) { 2 | Vue.prototype.dateFormat = function (timestamp, formats){ 3 | // formats格式包括 4 | // 1. Y-m-d 5 | // 2. Y-m-d H:i:s 6 | // 3. Y年m月d日 7 | // 4. Y年m月d日 H时i分 8 | formats = formats || 'Y-m-d'; 9 | 10 | let zero = function (value) { 11 | if (value < 10) { 12 | return '0' + value; 13 | } 14 | return value; 15 | }; 16 | 17 | let myDate = timestamp ? new Date(timestamp) : new Date(); 18 | 19 | let year = myDate.getFullYear(); 20 | let month = zero(myDate.getMonth() + 1); 21 | let day = zero(myDate.getDate()); 22 | 23 | let hour = zero(myDate.getHours()); 24 | let minute = zero(myDate.getMinutes()); 25 | let second = zero(myDate.getSeconds()); 26 | 27 | return formats.replace(/Y|m|d|H|i|s/ig, function (matches) { 28 | return ({ 29 | Y: year, 30 | m: month, 31 | d: day, 32 | H: hour, 33 | i: minute, 34 | s: second 35 | })[matches]; 36 | }); 37 | }; 38 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "genshin-info", 3 | "version": "0.1.2", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint", 9 | "bh": "webpack --progress" 10 | }, 11 | "dependencies": { 12 | "bulma": "^0.9.1", 13 | "core-js": "^3.6.5", 14 | "html2canvas": "^1.2.1", 15 | "vue": "^2.6.11" 16 | }, 17 | "devDependencies": { 18 | "@vue/cli-plugin-babel": "~4.5.0", 19 | "@vue/cli-plugin-eslint": "~4.5.0", 20 | "@vue/cli-service": "~4.5.0", 21 | "babel-eslint": "^10.1.0", 22 | "css-loader": "^2.1.1", 23 | "eslint": "^6.7.2", 24 | "eslint-plugin-vue": "^6.2.2", 25 | "style-loader": "^0.23.1", 26 | "uglifyjs-webpack-plugin": "^2.2.0", 27 | "vue-loader": "^15.7.0", 28 | "vue-template-compiler": "^2.6.11", 29 | "webpack": "^4.32.2", 30 | "webpack-cli": "^3.3.2" 31 | }, 32 | "eslintConfig": { 33 | "root": true, 34 | "env": { 35 | "node": true 36 | }, 37 | "extends": [ 38 | "plugin:vue/essential", 39 | "eslint:recommended" 40 | ], 41 | "parserOptions": { 42 | "parser": "babel-eslint" 43 | }, 44 | "rules": {} 45 | }, 46 | "browserslist": [ 47 | "> 1%", 48 | "last 2 versions", 49 | "not dead" 50 | ] 51 | } 52 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | # 工作流名称,不设置的话默认取配置文件名 2 | name: Build and Deploy 3 | # 指定触发 workflow 的条件 4 | # 指定触发事件时,可以限定分支或标签 5 | # 当前是 只有 master分支上触发 push 事件时才执行工作流任务 6 | on: 7 | push: 8 | branches: 9 | - master 10 | # 工作流执行的一个或多个任务 11 | jobs: 12 | # 任务名称 13 | build-and-deploy: 14 | # 任务运行的容器类型(虚拟机环境) 15 | runs-on: ubuntu-latest 16 | # 任务执行的步骤 17 | steps: 18 | # 步骤名称 19 | - name: Checkout 20 | # 使用的操作 actions,可以使用公共仓库,本地仓库,别人的仓库的action 21 | # 拉取代码 22 | uses: actions/checkout@master 23 | 24 | - name: Build and Deploy 25 | # 构建发布 Github pages 26 | uses: JamesIves/github-pages-deploy-action@releases/v2 27 | # 该步骤所需的环境变量 28 | env: 29 | ACCESS_TOKEN: ${{ secrets.MY_TOKEN }} 30 | # 在部署前要checkout的基本分支,默认是master 31 | BASE_BRANCH: master # The branch the action should deploy from. 32 | # 指定部署的分支,默认是 gh-pages 分支 33 | BRANCH: gh-pages # The branch the action should deploy to. 34 | # 存储库中要部署的文件夹。 35 | # 该步骤会将项目中 FOLDER 指定文件夹下的文件推送到 BRANCH 分支,作为Github Pages 部署的内容。 36 | # Vue CLI默认打包到 dist 目录 37 | FOLDER: dist # The folder the action should deploy. 38 | # 在向 BRANCH 分支推送代码前,可以指定构建脚本 39 | BUILD_SCRIPT: npm install && npm run build && npm run bh # The build script the action should run prior to deploying. 40 | -------------------------------------------------------------------------------- /src/components/base/ExplorationBox.vue: -------------------------------------------------------------------------------- 1 | 35 | 36 | 42 | 43 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const VueLoaderPlugin = require('vue-loader/lib/plugin'); 3 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); 4 | 5 | 6 | module.exports = { 7 | mode: 'development', 8 | entry: "./src/bookmark/index.js", 9 | output: { 10 | path: path.resolve(__dirname, './dist/js/'), 11 | publicPath: '/dist/js/', 12 | filename: 'bh-render.js', 13 | library: 'bh-render', 14 | libraryTarget: 'umd', 15 | libraryExport: 'default', 16 | umdNamedDefine: true, 17 | globalObject: 'typeof self !== \'undefined\' ? self : this' 18 | }, 19 | module: { 20 | rules: [{ 21 | test: /\.vue$/, 22 | loader: 'vue-loader' 23 | }, { 24 | test: /\.css$/, 25 | use: ['style-loader', 'css-loader'], 26 | }] 27 | }, 28 | // devtool: "source-map", 29 | resolve: { 30 | alias: { 31 | 'vue': 'vue/dist/vue.js' 32 | } 33 | }, 34 | plugins: [ 35 | new VueLoaderPlugin(), 36 | new UglifyJsPlugin({ 37 | sourceMap: false, 38 | uglifyOptions: { 39 | compress: { 40 | // 删除所有的 `console` 语句 41 | drop_console: true, 42 | }, 43 | output: { 44 | // 最紧凑的输出 45 | beautify: false, 46 | // 删除所有的注释 47 | comments: false, 48 | }, 49 | } 50 | }) 51 | ], 52 | // optimization: { 53 | // minimizer: [] 54 | // } 55 | } 56 | -------------------------------------------------------------------------------- /src/components/base/AvatarBox.vue: -------------------------------------------------------------------------------- 1 | 38 | 39 | 45 | 46 | 71 | -------------------------------------------------------------------------------- /src/components/BaseInfo.vue: -------------------------------------------------------------------------------- 1 | 46 | 47 | 59 | 60 | -------------------------------------------------------------------------------- /src/components/AbyssInfo.vue: -------------------------------------------------------------------------------- 1 | 47 | 48 | 70 | 71 | 74 | -------------------------------------------------------------------------------- /src/components/abyss/SummaryBox.vue: -------------------------------------------------------------------------------- 1 | 55 | 56 | 62 | 63 | -------------------------------------------------------------------------------- /src/bookmark/Main.vue: -------------------------------------------------------------------------------- 1 | 45 | 46 | 72 | 73 | 82 | -------------------------------------------------------------------------------- /src/components/abyss/FloorBox.vue: -------------------------------------------------------------------------------- 1 | 56 | 57 | 63 | 64 | 82 | -------------------------------------------------------------------------------- /src/components/base/SummaryBox.vue: -------------------------------------------------------------------------------- 1 | 97 | 98 | 104 | 105 | 108 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 91 | 92 | 192 | 193 | 221 | --------------------------------------------------------------------------------