diff --git a/package.json b/package.json index 85dedca..7ac38e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "szuru-chrome", - "version": "0.8.2", + "version": "0.0.0", "description": "Import media from various sites into szurubooru.", "author": "neobooru", "license": "MIT", @@ -19,23 +19,26 @@ "dependencies": { "axios": "^0.27.2", "markdown-it": "^13.0.1", - "neo-scraper": "^0.5.7", + "neo-scraper": "^0.5.8", + "normalize.css": "^8.0.1", "vue": "^2.6.14", "webextension-polyfill": "^0.9.0" }, "devDependencies": { "@types/markdown-it": "^12.2.3", - "@typescript-eslint/eslint-plugin": "^5.33.0", - "@typescript-eslint/parser": "^5.33.0", + "@typescript-eslint/eslint-plugin": "^5.48.1", + "@typescript-eslint/parser": "^5.48.1", "archiver": "^5.3.1", "copy-webpack-plugin": "^11.0.0", "css-loader": "^6.7.1", "eslint": "^8.21.0", "eslint-plugin-vue": "^9.3.0", "mini-css-extract-plugin": "^2.6.1", + "sass": "^1.57.1", + "sass-loader": "^13.2.0", "sign-addon": "^5.0.0", "ts-loader": "^9.3.1", - "typescript": "^4.7.4", + "typescript": "^4.9.4", "vue-loader": "^15.9.8", "vue-template-compiler": "^2.7.8", "web-ext-types": "^3.2.1", diff --git a/src/ViewModels.ts b/src/ViewModels.ts index b56616c..131d9e5 100644 --- a/src/ViewModels.ts +++ b/src/ViewModels.ts @@ -43,13 +43,7 @@ export class PostViewModel { this.pageUrl = post.pageUrl; this.contentType = post.contentType; this.rating = post.rating; - - if (post.sources.length > 0) { - // Add extra newline at the end for user convenience. This allows the user to click below the last source line to add something. - // But we only do this if there is at least one source, otherwise we get a blank line when there are zero sources. - this.source = post.sources.join("\n") + "\n"; - } - + this.source = post.sources.join("\n"); this.referrer = post.referrer; this.tags = post.tags.map((x) => TagViewModel.fromScapedTag(x)); this.notes = post.notes; diff --git a/src/css/solid.css b/src/css/solid.css index b2ff919..726e419 100644 --- a/src/css/solid.css +++ b/src/css/solid.css @@ -3,14 +3,15 @@ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) */ @font-face { - font-family: 'Font Awesome 5 Free'; + font-family: "Font Awesome 5 Free"; font-style: normal; font-weight: 900; font-display: auto; - src: url("../fonts/fa-solid-900.eot"); - src: url("../fonts/fa-solid-900.eot?#iefix") format("embedded-opentype"), url("../fonts/fa-solid-900.woff2") format("woff2"), url("../fonts/fa-solid-900.woff") format("woff"), url("../fonts/fa-solid-900.ttf") format("truetype"); } + src: url("../fonts/fa-solid-900.woff2") format("woff2"); +} .fa, .fas { - font-family: 'Font Awesome 5 Free'; - font-weight: 900; } + font-family: "Font Awesome 5 Free"; + font-weight: 900; +} diff --git a/src/css/style.css b/src/css/style.scss similarity index 68% rename from src/css/style.css rename to src/css/style.scss index da95c07..4f1fa48 100644 --- a/src/css/style.css +++ b/src/css/style.scss @@ -1,187 +1,201 @@ -:root { - --button-bg-color: #a2a2a2; - --primary-color: #24aadd; - --bg-main-color: #fff; - --bg-secondary-color: #fafafa; - --border-color: #eee; - --secondary-text: #888; - --error-color: #f44336; - --success-color: #4caf50; - --section-header-fg-color: #4c4c4c; - --section-header-bg-color: #eee; - --text-color: #111; -} - -html[data-theme="dark"] { - --button-bg-color: #666; - --primary-color: #1b87b0; - --bg-main-color: #1a1a1a; - --bg-secondary-color: #3e3e3e; - --border-color: #474747; - --section-header-fg-color: #d9d9d9; - --section-header-bg-color: #272727; - --text-color: #e6e6e6; - - color: var(--text-color); - background-color: var(--bg-main-color); -} - -body { - margin: 0px; - font-family: "Open Sans", sans-serif; - display: block; - font-size: 100%; -} - -button { - background-color: var(--button-bg-color); - border: none; - color: white; - font-family: "Open Sans", sans-serif; - height: 30px; - cursor: pointer; - padding: 0 10px; - white-space: nowrap; -} - -button.primary { - background-color: var(--primary-color); -} - -input[type="text"] { - height: 26px; -} - -input[type="text"], -textarea { - color: var(--text-color); - background-color: var(--bg-secondary-color); - border: 1px solid var(--border-color); - width: 100%; -} - -input[type="text"]:focus, -textarea:focus { - outline: var(--primary-color) solid 2px; - box-sizing: content-box; -} - -textarea { - white-space: pre; - overflow-wrap: normal; - overflow-x: scroll; - text-overflow: ellipsis; - resize: vertical; -} - -img { - max-width: 100%; - max-height: 100%; -} - -.full { - width: 100%; -} - -select { - color: var(--text-color); - background-color: var(--bg-secondary-color); - border: 1px solid var(--border-color); - height: 30px; - width: 100%; -} - -ul.compact, -.compact-tags { - list-style-type: none; - padding: 0; - display: inline; -} - -.compact-tags > li { - /* - Ident each newline but not the first line. - This makes tagName line breaks look better, though it is a bit hacky. - */ - text-indent: -1.5ch; - padding-left: 1.5ch; -} - -.tag-general { - color: var(--primary-color); -} - -.tag-copyright { - color: rgb(170, 0, 170); -} - -.tag-character { - color: rgb(0, 170, 0); -} - -.tag-artist { - color: rgb(170, 0, 0); -} - -.tag-meta { - color: rgb(255, 128, 0); -} - -.tag-species { - color: rgb(17, 14, 247); -} - -.tag-lore { - color: rgb(48, 48, 48); -} - -.remove-tag, -.tag-usages { - color: var(--secondary-text); -} - -a.remove-tag { - text-decoration: none; - cursor: pointer; -} - -.tag-usages { - font-size: 90%; - /* Reset text-indent set by ".compact-tags > li" because it clashes with our margin */ - text-indent: initial; - margin-left: 0.7em; -} - -.messages { - list-style-type: none; - padding: 0; - display: inline; -} - -.messages > li { - padding: 5px; - border-radius: 2px; - background: var(--primary-color); - color: white; -} - -.messages > li > a { - color: white; - text-decoration: none; -} - -.messages > li:first-child { - margin-top: 10px; -} - -.messages > li:not(:last-child) { - margin-bottom: 5px; -} - -.message-error { - background: var(--error-color) !important; -} - -.message-success { - background: var(--success-color) !important; -} +/* open-sans-regular - latin */ +@font-face { + font-family: "Open Sans"; + font-style: normal; + font-weight: 400; + src: local(""), url("../fonts/open-sans-v34-latin-regular.woff2") format("woff2"); +} + +body { + font-family: "Open Sans", sans-serif; + font-size: 16px; +} + +:root { + --button-bg-color: #a2a2a2; + --primary-color: #24aadd; + --bg-main-color: #fff; + --bg-secondary-color: #fafafa; + --border-color: #eee; + --secondary-text: #888; + --error-color: #f44336; + --success-color: #4caf50; + --section-header-fg-color: #4c4c4c; + --section-header-bg-color: #eee; + --text-color: #111; +} + +html[data-theme="dark"] { + --button-bg-color: #666; + --primary-color: #1b87b0; + --bg-main-color: #1a1a1a; + --bg-secondary-color: #3e3e3e; + --border-color: #474747; + --section-header-fg-color: #d9d9d9; + --section-header-bg-color: #272727; + --text-color: #e6e6e6; + color: var(--text-color); + background-color: var(--bg-main-color); +} + +body { + margin: 0px; + display: block; +} + +button { + background-color: var(--button-bg-color); + border: none; + color: #fff; + height: 30px; + cursor: pointer; + padding: 0 10px; + white-space: nowrap; +} + +button.primary { + background-color: var(--primary-color); +} + +input[type="email"], +input[type="number"], +input[type="password"], +input[type="text"], +select { + color: var(--text-color); + background-color: var(--bg-secondary-color); + border: 1px solid var(--border-color); + + padding: 0.2em 0.3em; + box-sizing: border-box; + + width: 100%; + + &:focus { + outline: var(--primary-color) solid 2px; + } +} + +input[type="radio"] { + margin: 3px 3px 0 5px; +} + +textarea { + color: var(--text-color); + background-color: var(--bg-secondary-color); + border: 1px solid var(--border-color); + width: 100%; + white-space: pre; + overflow-wrap: normal; + overflow-x: scroll; + text-overflow: ellipsis; + resize: vertical; + + &:focus { + outline: var(--primary-color) solid 2px; + box-sizing: content-box; + } +} + +img { + max-width: 100%; + max-height: 100%; +} + +.flex { + display: flex; +} + +.full { + width: 100%; +} + +ul.compact { + list-style-type: none; + padding: 0; + display: inline; +} + +.compact-tags { + list-style-type: none; + padding: 0; + display: inline; +} + +.tag-general { + color: var(--primary-color); +} + +.tag-copyright { + color: rgb(170, 0, 170); +} + +.tag-character { + color: rgb(0, 170, 0); +} + +.tag-artist { + color: rgb(170, 0, 0); +} + +.tag-meta { + color: rgb(255, 128, 0); +} + +.tag-species { + color: rgb(17, 14, 247); +} + +.tag-lore { + color: rgb(48, 48, 48); +} + +.remove-tag { + color: var(--secondary-text); +} + +.tag-usages { + color: var(--secondary-text); + font-size: 90%; + text-indent: initial; + margin-left: 0.7em; +} + +a.remove-tag { + text-decoration: none; + cursor: pointer; +} + +.messages { + list-style-type: none; + padding: 0; + display: inline; + + > li { + padding: 5px; + border-radius: 2px; + background: var(--primary-color); + color: #fff; + + > a { + color: #fff; + text-decoration: none; + } + + &:first-child { + margin-top: 10px; + } + + &:not(:last-child) { + margin-bottom: 5px; + } + } +} + +.message-error { + background: var(--error-color) !important; +} + +.message-success { + background: var(--success-color) !important; +} diff --git a/src/fonts/fa-solid-900.eot b/src/fonts/fa-solid-900.eot deleted file mode 100644 index 7c78e8c..0000000 Binary files a/src/fonts/fa-solid-900.eot and /dev/null differ diff --git a/src/fonts/fa-solid-900.ttf b/src/fonts/fa-solid-900.ttf deleted file mode 100644 index d4e300d..0000000 Binary files a/src/fonts/fa-solid-900.ttf and /dev/null differ diff --git a/src/fonts/fa-solid-900.woff b/src/fonts/fa-solid-900.woff deleted file mode 100644 index a50f67f..0000000 Binary files a/src/fonts/fa-solid-900.woff and /dev/null differ diff --git a/src/fonts/open-sans-v34-latin-regular.woff2 b/src/fonts/open-sans-v34-latin-regular.woff2 new file mode 100644 index 0000000..15339ea Binary files /dev/null and b/src/fonts/open-sans-v34-latin-regular.woff2 differ diff --git a/src/options/App.vue b/src/options/App.vue index e305c6e..a763bc0 100644 --- a/src/options/App.vue +++ b/src/options/App.vue @@ -163,24 +163,24 @@ export default Vue.extend({ }); - diff --git a/src/options/options.ts b/src/options/options.ts index d29c5f6..e8b180b 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -1,4 +1,5 @@ -import "../css/style.css"; +import "normalize.css"; +import "../css/style.scss"; import Vue from "vue"; import App from "./App.vue"; diff --git a/src/popup/App.vue b/src/popup/App.vue index 6b7d6b5..a9646dd 100644 --- a/src/popup/App.vue +++ b/src/popup/App.vue @@ -6,123 +6,127 @@ -