From d0d6af8de6ce6cfd51fb8e8bd8114539aee2231d Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 22 May 2020 11:27:36 +0300 Subject: [PATCH] scale gazeta --- app/pub/scripts/klanviewer.js | 14 ++++++++++---- app/views/layout.phtml | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/pub/scripts/klanviewer.js b/app/pub/scripts/klanviewer.js index 24b7ed0..f6566f7 100644 --- a/app/pub/scripts/klanviewer.js +++ b/app/pub/scripts/klanviewer.js @@ -2,8 +2,6 @@ var pdfjsLib = window['pdfjs-dist/build/pdf']; var pdfcanvas = "the-canvas"; var cnt = 100; - - function renderPage() { var el_title = document.getElementById('pdfprogress'); @@ -19,8 +17,16 @@ function renderPage() { var context = canvas.getContext('2d'); //var viewport = page.getViewport({scale: scale}); - currscale = 2; - + if (window.screen.width <= 560) { + currscale = 1.5; + } + else if (window.screen.width >= 560 && window.screen.width <= 1200) { + currscale = 2; + } + else{ + currscale = 2.5; + } + var viewport = page.getViewport({scale: currscale}); // var viewport = page.getViewport(canvas.width / page.getViewport(0.5).width) diff --git a/app/views/layout.phtml b/app/views/layout.phtml index 9c4bb92..d8ec265 100644 --- a/app/views/layout.phtml +++ b/app/views/layout.phtml @@ -4,7 +4,7 @@ "> - +