Przeglądaj źródła

Работа над ночным режимом

Book Pauk 2 lat temu
rodzic
commit
31481453f5

+ 1 - 1
client/components/Reader/LoaderPage/LoaderPage.vue

@@ -162,7 +162,7 @@ class LoaderPage {
 
     loadBuffer(opts) {
         if (opts.buffer.length) {
-            const file = new File([opts.buffer], 'dummyName-PasteFromClipboard');
+            const file = new File([opts.buffer], `paste_from_clipboard_#${utils.randomHexString(10)}`);
             this.$emit('load-file', {file});
         }
     }

+ 14 - 3
client/components/Reader/LoaderPage/PasteTextPage/PasteTextPage.vue

@@ -8,9 +8,11 @@
             </span>
         </template>
 
-        <q-input v-model="bookTitle" class="q-px-sm" dense borderless placeholder="Введите название текста" />
-        <hr />
-        <textarea ref="textArea" class="text" @paste="calcTitle"></textarea>
+        <div class="fit column" :class="{dark}">
+            <q-input v-model="bookTitle" class="q-px-sm" dense borderless placeholder="Введите название текста" />
+            <hr />
+            <textarea ref="textArea" class="text" :class="{dark}" @paste="calcTitle"></textarea>
+        </div>
     </Window>
 </template>
 
@@ -39,6 +41,10 @@ class PasteTextPage {
         this.$refs.textArea.focus();
     }
 
+    get dark() {
+        return this.$store.state.reader.settings.nightMode;
+    }
+
     getNonEmptyLine3words(text, count) {
         let result = '';
         const lines = text.split("\n");
@@ -115,6 +121,11 @@ export default vueComponent(PasteTextPage);
     outline: none;
 }
 
+.dark {
+    color: white;
+    background-color: #333;
+}
+
 hr {
     margin: 0;
     padding: 0;