From 6771bc471679fbb881e8196553f2ba2811ef198c Mon Sep 17 00:00:00 2001 From: Kylart Date: Sun, 27 Aug 2017 00:01:49 +0200 Subject: [PATCH] Added progress bar on building dev Added default text if no synopsis on release --- package.json | 2 +- pages/downloader.vue | 16 ++-------------- pages/index.vue | 2 +- webpack/setup-dev-server.js | 10 ++++++++-- webpack/webpack.base.config.js | 10 +++++++++- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index cfb155a..17ead93 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "KawAnime", "description": "Desktop app for anime fans", - "version": "1.0.0", + "version": "0.1.0", "main": "main.js", "repository": "https://github.com/Kylart/KawAnime.git", "author": { diff --git a/pages/downloader.vue b/pages/downloader.vue index b3eec75..07ea0f2 100644 --- a/pages/downloader.vue +++ b/pages/downloader.vue @@ -54,8 +54,8 @@ v-radio.radio.primary--text(label='720p', v-model='quality', value='720p', dark) v-flex(xs12, sm6, md4) v-radio.radio.primary--text(label='1080p', v-model='quality', value='1080p', dark) - .download-button-container - .download-button + v-layout.pt-4(justify-center, align-center) + v-flex(xs3) v-btn#download-btn( dark, block, secondary, @click='isDownloadable()', @@ -260,18 +260,6 @@ margin-left: 35%; } - .download-button-container - { - align-content: center; - } - - .download-button - { - margin-top: 45px; - display: inline-block; - width: 20%; - } - .modal-text { white-space: pre-wrap; diff --git a/pages/index.vue b/pages/index.vue index 8265ce0..1fc30fb 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -45,7 +45,7 @@ ) v-flex(xl6, lg8, md7, xs8) .elem-text-links - .synopsis {{ item.synopsis }} + .synopsis {{ item.synopsis || 'No synopsis yet.' }} .links a.download-button(:href='item.magnetLink') v-btn.btn--light-flat-pressed(dark, flat, @click='print(item)') Download diff --git a/webpack/setup-dev-server.js b/webpack/setup-dev-server.js index f45530a..480c8dd 100644 --- a/webpack/setup-dev-server.js +++ b/webpack/setup-dev-server.js @@ -3,6 +3,8 @@ const webpack = require('webpack') const MFS = require('memory-fs') const clientConfig = require(path.join(__dirname, 'webpack.client.config')) const serverConfig = require(path.join(__dirname, 'webpack.server.config')) +const ProgressBarPlugin = require('progress-bar-webpack-plugin') +const chalk = require('chalk') module.exports = function setupDevServer (app, cb) { let bundle, clientManifest @@ -11,7 +13,7 @@ module.exports = function setupDevServer (app, cb) { const readyPromise = new Promise(r => { resolve = r }) // eslint-disable-line promise/param-names const ready = (...args) => { if (!resolved) resolve() - cb(...args) // eslint-disable-line + cb(...args) // eslint-disable-line standard/no-callback-literal } // modify client config to work with hot middleware @@ -19,7 +21,11 @@ module.exports = function setupDevServer (app, cb) { clientConfig.output.filename = '[name].js' clientConfig.plugins.push( new webpack.HotModuleReplacementPlugin(), - new webpack.NoEmitOnErrorsPlugin() + new webpack.NoEmitOnErrorsPlugin(), + new ProgressBarPlugin({ + format: chalk.cyan('> build') + ' [:bar] ' + chalk.green.bold(':percent') + ' (:elapsed seconds)', + clear: true + }) ) // dev middleware diff --git a/webpack/webpack.base.config.js b/webpack/webpack.base.config.js index e102dbd..bd44500 100644 --- a/webpack/webpack.base.config.js +++ b/webpack/webpack.base.config.js @@ -52,12 +52,20 @@ module.exports = { loader: ['style-loader', 'css-loader', 'stylus-loader'] }, { - test: /\.(woff|woff2|eot|ttf|png|jpe?g|gif|svg)(\?.*)?$/, + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, loader: 'url-loader', query: { limit: 10000, name: 'img/[name].[hash:7].[ext]' } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 1000, + name: 'fonts/[name].[hash:7].[ext]' + } } ] },