From 474717c2df978952d5894d338b8003ef37eb749b Mon Sep 17 00:00:00 2001 From: hunlongyu Date: Tue, 28 Apr 2020 00:13:32 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=8F=20=E8=87=AA=E5=8A=A8=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E8=B7=A8=E5=B9=B3=E5=8F=B0=E8=BD=AF=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 37 +++++++++++++++++++++++++++++++++++ src/background.js | 7 ++++--- src/components/Play.vue | 4 ++++ src/mini/Mini.vue | 27 +++++++++++++++---------- 4 files changed, 62 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..26e7651 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: release-build + +on: + push: + tags: + - v*.*.* + +jobs: + release: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [windows-latest, macos-latest, ubuntu-latest] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + + - run: | + yarn + yarn electron:build + shell: pwsh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: | + dist_electron/*.exe + dist_electron/*.dmg + dist_electron/*.snap + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/src/background.js b/src/background.js index ff99a10..3f70d71 100644 --- a/src/background.js +++ b/src/background.js @@ -59,6 +59,7 @@ function createMini () { webSecurity: false, nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION }, + // eslint-disable-next-line icon: path.join(__static, 'icon.png') }) @@ -102,14 +103,14 @@ ipcMain.on('mini', () => { createMini() win.close() }) -ipcMain.on('mini-min', () => { +ipcMain.on('miniMin', () => { mini.minimize() }) -ipcMain.on('mini-close', () => { +ipcMain.on('miniClose', () => { mini.close() createWindow() }) -ipcMain.on('mini-opacity', (e, arg) => { +ipcMain.on('miniOpacity', (e, arg) => { mini.setOpacity(arg) }) diff --git a/src/components/Play.vue b/src/components/Play.vue index 4b0ea86..2b6ec1d 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -369,9 +369,13 @@ export default { }, listItemEvent (n) { this.video.index = n + this.right.show = false + this.right.type = '' }, historyItemEvent (e) { this.video = e + this.right.show = false + this.right.type = '' }, removeItem (e) { history.remove(e.id).then(res => { diff --git a/src/mini/Mini.vue b/src/mini/Mini.vue index de5b876..87077d1 100644 --- a/src/mini/Mini.vue +++ b/src/mini/Mini.vue @@ -2,16 +2,16 @@
- {{index + 1}} / {{length}} + {{index + 1}} / {{length}} - Backwards + 上一集 - Forward + 下一集 @@ -20,8 +20,8 @@
- - + +
@@ -58,8 +58,9 @@ export default { video: {}, d: {}, show: { - prev: true, - next: true + prev: false, + next: false, + number: false }, index: 0, length: 0 @@ -75,8 +76,9 @@ export default { getUrls () { mini.find().then(res => { const v = res - if (v.index <= 0) { - this.show.prev = false + if (v.index > 0) { + this.show.next = true + this.show.number = true } this.video = res tools.detail_get(v.site, v.detail).then(res => { @@ -200,6 +202,7 @@ html,body{ display: flex; justify-content: flex-start; align-items: center; + height: 100%; flex: 1; .number{ color: #fff; @@ -210,6 +213,7 @@ html,body{ -webkit-app-region: no-drag; margin-left: 10px; input{ + text-indent: 4px; background-color: #000; color: #fff; border: 1px solid #aaa; @@ -218,7 +222,10 @@ html,body{ } .right{ width: 80px; - text-align: right; + height: 100%; + display: flex; + justify-content: flex-end; + align-items: center; span{ -webkit-app-region: no-drag; display: inline-block;