Skip to content
神代綺凜 edited this page Jul 24, 2020 · 45 revisions

不太建议您阅读或学习本项目的 vue 代码,这是我在初学的时候实践的成品,有很多使用频率不高的部分都没有组件化,为了直接传递数据也懒得组件化

单页 vue 文件十分长,HTML 层级很多,可能会让您看得头晕眼花,但 script 部分还是可以看的,大概

Project setup

yarn install

Compiles and hot-reloads for development

yarn run serve

Compiles and minifies for production

yarn run build

ENV

  • VUE_APP_GTAG - Optional, Google Analytics gtag ID.
  • VUE_APP_CDN - Optional, CDN URL of static resources.
  • USE_CDN - Optional, set to true if you want to let SW load and precache resources from CDN specified by VUE_APP_CDN.

Vercel ENV

  • OCRSPACE_API_KEY - Optional, API Key of ocr.space, default is helloworld if not set.
  • BAIDUBCE_API_KEY and BAIDUBCE_SECRET_KEY - Optional, Baidu OCR will be used if both of them are set.
  • Baidu OCR will not be used to recognize English due to its low accuracy in English OCR.

About USE_CDN

  • VUE_APP_CDN must be setted before enable it.
  • Because of some limitations of PWA, some files will be specially processed to ensure that index.html, manifest.json, service-worker.js will not be loaded from CDN.

Lints and fixes files

yarn run lint

Customize configuration

See Configuration Reference.

Update Arknights game data

yarn run update-data

or

# Recommend in China
yarn run update-data:cdn

or

git clone https://github.com/Kengxxiao/ArknightsGameData ../ArknightsGameData
yarn run update-data:local

Github Actions

Used for automatic build and deploy to GitHub Pages, please ignore if not needed.

After forking this repo, you can enable it on Actions Page, and set the following secrets:

  • ACCESS_TOKEN: Create here,just check "repo".
  • CNAME: GitHub Pages CNAME
  • GTAG: Corresponding to ENV VUE_APP_GTAG
  • CDN: Corresponding to ENV VUE_APP_CDN
  • USE_CDN: Corresponding to ENV USE_CDN

Automatically update game data

利用了一些自动化白嫖技巧,以下是目前的更新策略流程图

+---++-------------------------------------+                 +---------+
|   ||                                     |   New Commits   |         |
|   ||     Kengxxiao/ArknightsGameData     +---------------->+  IFTTT  |
|   ||                                     |      Feed       |         |
| G |+-------------------------------------+                 +----+----+
| i |+-------------------------------------+     Create Issue     |
| t ||                                     +<---------------------+
| H ||  Tsuk1ko/arknights-toolbox-update   |
| u ||                                     +----+
| b |+-------------------------------------+    | Workflow: Check Issue
|   |+-------------------------------------+    | & Update Data & Push
|   ||                                     +<---+
|   ||      Tsuk1ko/arknights-toolbox      |
|   ||                                     +----+
+---++--------+----------------------------+    | Vercel APP:
              |  Workflow: Build & Deploy       | Build & Deploy
              v                                 v
+-------------+---------------------+ +---------+----------------------+
|                                   | |                                |
| GitHub Pages: arkn-gh.lolicon.app | |    Vercel: arkn.lolicon.app    |
|                                   | |                                |
+-----------------------------------+ +--------------------------------+
Clone this wiki locally