From b4cfa527135f83b8f60fde4178db75142e9378fd Mon Sep 17 00:00:00 2001 From: Alessandro Jean Date: Tue, 24 Sep 2019 18:58:13 -0300 Subject: [PATCH 1/4] Create custom theme. --- package-lock.json | 41 +++- src/.vuepress/theme/components/Home.vue | 254 ++++++++++++++++++++++++ src/.vuepress/theme/index.js | 3 + 3 files changed, 287 insertions(+), 11 deletions(-) create mode 100644 src/.vuepress/theme/components/Home.vue create mode 100644 src/.vuepress/theme/index.js diff --git a/package-lock.json b/package-lock.json index 0c03c409..7675fdee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4263,7 +4263,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -4284,12 +4285,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4304,17 +4307,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -4431,7 +4437,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -4443,6 +4450,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -4457,6 +4465,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4464,12 +4473,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -4488,6 +4499,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -4568,7 +4580,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -4580,6 +4593,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -4665,7 +4679,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -4701,6 +4716,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4720,6 +4736,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -4763,12 +4780,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, diff --git a/src/.vuepress/theme/components/Home.vue b/src/.vuepress/theme/components/Home.vue new file mode 100644 index 00000000..128fba07 --- /dev/null +++ b/src/.vuepress/theme/components/Home.vue @@ -0,0 +1,254 @@ + + + + + diff --git a/src/.vuepress/theme/index.js b/src/.vuepress/theme/index.js new file mode 100644 index 00000000..ba95b2af --- /dev/null +++ b/src/.vuepress/theme/index.js @@ -0,0 +1,3 @@ +module.exports = { + extend: '@vuepress/theme-default' +}; From c19cef157946bab34852f166cd9af74f9fc1d73e Mon Sep 17 00:00:00 2001 From: Alessandro Jean Date: Tue, 24 Sep 2019 19:56:23 -0300 Subject: [PATCH 2/4] Add download icon and fix fetch info method. --- package-lock.json | 26 ++++++++++++++ package.json | 3 ++ src/.vuepress/components/ExtensionList.vue | 25 ++++++++++--- src/.vuepress/enhanceApp.js | 12 +++++-- src/.vuepress/theme/components/Home.vue | 42 +++++++++++----------- 5 files changed, 81 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7675fdee..a9ccadfc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -842,6 +842,32 @@ "to-fast-properties": "^2.0.0" } }, + "@fortawesome/fontawesome-common-types": { + "version": "0.2.25", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.25.tgz", + "integrity": "sha512-3RuZPDuuPELd7RXtUqTCfed14fcny9UiPOkdr2i+cYxBoTOfQgxcDoq77fHiiHcgWuo1LoBUpvGxFF1H/y7s3Q==" + }, + "@fortawesome/fontawesome-svg-core": { + "version": "1.2.25", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.25.tgz", + "integrity": "sha512-MotKnn53JKqbkLQiwcZSBJVYtTgIKFbh7B8+kd05TSnfKYPFmjKKI59o2fpz5t0Hzl35vVGU6+N4twoOpZUrqA==", + "requires": { + "@fortawesome/fontawesome-common-types": "^0.2.25" + } + }, + "@fortawesome/free-solid-svg-icons": { + "version": "5.11.2", + "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.11.2.tgz", + "integrity": "sha512-zBue4i0PAZJUXOmLBBvM7L0O7wmsDC8dFv9IhpW5QL4kT9xhhVUsYg/LX1+5KaukWq4/cbDcKT+RT1aRe543sg==", + "requires": { + "@fortawesome/fontawesome-common-types": "^0.2.25" + } + }, + "@fortawesome/vue-fontawesome": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/@fortawesome/vue-fontawesome/-/vue-fontawesome-0.1.7.tgz", + "integrity": "sha512-YCw2Q2m4fxzyFsPOH3uDYMoJztTD+pT+AAyse4LFpbdrBg+r8ueaVT8BFnXEjrGwMDJJeXrwJ5AOC6q/JWBI4w==" + }, "@mrmlnc/readdir-enhanced": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", diff --git a/package.json b/package.json index 02218095..6c634543 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,9 @@ "vuepress": "^1.1.0" }, "dependencies": { + "@fortawesome/fontawesome-svg-core": "^1.2.25", + "@fortawesome/free-solid-svg-icons": "^5.11.2", + "@fortawesome/vue-fontawesome": "^0.1.7", "axios": "^0.19.0", "iso-639-1": "^2.1.0", "lodash.groupby": "^4.6.0", diff --git a/src/.vuepress/components/ExtensionList.vue b/src/.vuepress/components/ExtensionList.vue index 333b65ca..da7472c5 100644 --- a/src/.vuepress/components/ExtensionList.vue +++ b/src/.vuepress/components/ExtensionList.vue @@ -13,7 +13,14 @@ {{ extension.pkg }} - Download + + + Download + @@ -28,11 +35,12 @@ import ISO6391 from 'iso-639-1'; const EXTENSION_JSON = 'https://raw.githubusercontent.com/inorichi/tachiyomi-extensions/repo/index.json'; export default { - data: function () { + data () { return { extensions: [] } }, + methods: { langName: code => code === 'all' ? 'All' : `${ISO6391.getName(code)} (${ISO6391.getNativeName(code)})`, iconUrl (pkg) { @@ -41,6 +49,7 @@ export default { }, apkUrl: apk => `https://raw.githubusercontent.com/inorichi/tachiyomi-extensions/repo/apk/${apk}` }, + async beforeMount () { const { data } = await axios.get(EXTENSION_JSON); const values = Object.values(groupBy(data, 'lang')); @@ -78,7 +87,7 @@ export default { font-size: 0.8em; color: #fff; background-color: #2e84bf; - padding: 0.3rem; + padding: 0.5rem; border-radius: 4px; transition: background-color 0.1s ease; box-sizing: border-box; @@ -89,12 +98,18 @@ export default { background-color: #3992cf; text-decoration: none !important; } + + svg + span { + margin-left: 0.25rem; + } } } @media (max-width: 767px) { - .extension .extension-text .down { - display: none; + .extension { + .extension-text .down, .button span { + display: none; + } } } diff --git a/src/.vuepress/enhanceApp.js b/src/.vuepress/enhanceApp.js index e620be25..6ae74df1 100644 --- a/src/.vuepress/enhanceApp.js +++ b/src/.vuepress/enhanceApp.js @@ -1,8 +1,16 @@ -import './styles/index.scss' +import './styles/index.scss'; + +import { library } from '@fortawesome/fontawesome-svg-core'; +import { faDownload } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; + +library.add(faDownload); export default ({ Vue, // the version of Vue being used in the VuePress app options, // the options for the root Vue instance router, // the router instance for the app siteData // site metadata -}) => {} +}) => { + Vue.component('font-awesome-icon', FontAwesomeIcon); +}; diff --git a/src/.vuepress/theme/components/Home.vue b/src/.vuepress/theme/components/Home.vue index 128fba07..03511316 100644 --- a/src/.vuepress/theme/components/Home.vue +++ b/src/.vuepress/theme/components/Home.vue @@ -17,12 +17,17 @@ class="action" v-if="data.actionText && data.actionLink" > - + > + + Download {{ tagName || 'vX.X.X' }} + + a.name.includes('.apk')); @@ -147,23 +145,27 @@ export default { box-sizing: border-box; border-bottom: 1px solid darken($accentColor, 10%); - &[download] svg { - display: none; - } - &:hover { background-color: lighten($accentColor, 10%); } &.secundary { - background-color: darken($borderColor, 10%); - color: lighten($textColor, 15%); - border-bottom-color: darken($borderColor, 20%); + background-color: darken($borderColor, 5%); + color: lighten($textColor, 25%); + border-bottom-color: darken($borderColor, 15%); &:hover { - background-color: $borderColor; + background-color: lighten($borderColor, 5%); } } + + svg + span { + margin-left: 0.5rem; + } + + & + .action-button { + margin-left: 0.5rem; + } } } From 1dbcd5f9150ab3d122628b85d59f0a02ea92d46c Mon Sep 17 00:00:00 2001 From: Alessandro Jean Date: Tue, 24 Sep 2019 20:15:03 -0300 Subject: [PATCH 3/4] Fix spacing in mobile. --- src/.vuepress/theme/components/Home.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/.vuepress/theme/components/Home.vue b/src/.vuepress/theme/components/Home.vue index 03511316..88262b27 100644 --- a/src/.vuepress/theme/components/Home.vue +++ b/src/.vuepress/theme/components/Home.vue @@ -216,6 +216,13 @@ export default { max-width: 100%; padding: 0 2.5rem; } + + .hero { + .action-button + .action-button { + margin-left: 0; + margin-top: 0.5rem; + } + } } } From e096f1f0843e5077fb250d0b3eae56e7abea81f8 Mon Sep 17 00:00:00 2001 From: Alessandro Jean Date: Tue, 24 Sep 2019 20:20:21 -0300 Subject: [PATCH 4/4] Change div to footer and add semicolon. --- src/.vuepress/theme/components/Home.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/.vuepress/theme/components/Home.vue b/src/.vuepress/theme/components/Home.vue index 88262b27..866d26e0 100644 --- a/src/.vuepress/theme/components/Home.vue +++ b/src/.vuepress/theme/components/Home.vue @@ -51,12 +51,12 @@ - + @@ -65,7 +65,7 @@ import NavLink from '@parent-theme/components/NavLink.vue'; import axios from 'axios'; -const RELEASE_URL = 'https://api.github.com/repos/inorichi/tachiyomi/releases/latest' +const RELEASE_URL = 'https://api.github.com/repos/inorichi/tachiyomi/releases/latest'; export default { components: { NavLink },