diff --git a/client/components/readers/ComicReader.vue b/client/components/readers/ComicReader.vue index 40b28a74..c0a3f957 100644 --- a/client/components/readers/ComicReader.vue +++ b/client/components/readers/ComicReader.vue @@ -26,8 +26,12 @@

{{ page }} / {{ numPages }}

+ -
+
arrow_back_ios @@ -38,10 +42,11 @@ arrow_forward_ios
-
- +
+
+ +
-
@@ -54,6 +59,10 @@ import Path from 'path' import { Archive } from 'libarchive.js/main.js' import { CompressedFile } from 'libarchive.js/src/compressed-file' +// This is % with respect to the screen width +const MAX_SCALE = 400 +const MIN_SCALE = 10 + Archive.init({ workerUrl: '/libarchive/worker-bundle.js' }) @@ -81,7 +90,8 @@ export default { showInfoMenu: false, loadTimeout: null, loadedFirstPage: false, - comicMetadata: null + comicMetadata: null, + scale: 80, } }, watch: { @@ -136,6 +146,12 @@ export default { return p }) || [] ) + }, + canScaleUp() { + return this.scale < MAX_SCALE + }, + canScaleDown() { + return this.scale > MIN_SCALE } }, methods: { @@ -331,7 +347,13 @@ export default { orderedImages = orderedImages.concat(noNumImages.map((i) => i.filename)) this.pages = orderedImages - } + }, + zoomIn() { + this.scale += 10 + }, + zoomOut() { + this.scale -= 10 + }, }, mounted() {}, beforeDestroy() {}