diff --git a/comic_reader.css b/comic_reader.css index 0ae3bd0..f0314cd 100644 --- a/comic_reader.css +++ b/comic_reader.css @@ -2,6 +2,9 @@ --reader-progressbar-height: 0.3em; } +.animated { + transition: all 1.5s ease; +} #reader-frame { display: flex; @@ -19,7 +22,6 @@ flex-direction: row; left: 0px; right: 0px; - transition: all 1.5s ease; } #reader-pages > img { @@ -29,17 +31,33 @@ flex-shrink: 0; } -#focus-overlay, #focus-overlay * { - transition: all 1.5s ease; -} - -#focus-overlay, #nav-controls { +.fill { position: absolute; top: 0; left: 0; width: 100%; height: 100%; - +} + +.obscured { + background-color: rgba(0, 0, 0, 0.85); +} + +.flex { + display: flex; + flex-direction: row; +} + +.flex-col { + display: flex; + flex-direction: column; +} + +.grow { + flex: 1 +} + +#nav-controls { display: grid; grid-template-areas: @@ -48,11 +66,6 @@ "left bottom right"; } -#focus-overlay { - grid-template-columns: 50% auto 50%; - grid-template-rows: 50% auto 50%; -} - #nav-controls { grid-template-columns: 33% 0 1fr; grid-template-rows: auto; @@ -82,11 +95,7 @@ grid-area: bottom; } -#focus-overlay > *:not(.center) { - background-color: rgba(0, 0, 0, 0.85); -} - -#focus-overlay > .center { +.focus { box-shadow: inset 0px 0px 5px 5px rgba(0, 0, 0, 0.85); } diff --git a/comic_reader.js b/comic_reader.js index ed2ce52..2c6a6b4 100644 --- a/comic_reader.js +++ b/comic_reader.js @@ -24,7 +24,8 @@ DELAY_BEFORE_HIDDING_CONTROLS = 4000; READER_FRAME = document.getElementById("reader-frame") READER_CONTENT_FRAME = document.getElementById("reader-content-frame") READER_PAGES = document.getElementById("reader-pages") -FOCUS_OVERLAY = document.getElementById("focus-overlay") +FOCUS_OVERLAY_HEIGHT = document.getElementById("focus-overlay-height") +FOCUS_OVERLAY_WIDTH = document.getElementById("focus-overlay-width") HELP_CONTROLS = document.getElementById("help-controls") PROGRESS_BAR_CONTAINER = document.getElementById("reader-progress-container") PROGRESS_BAR = document.getElementById("reader-progress-bar") @@ -234,19 +235,13 @@ function moveReaderDisplayToZoom(index) { } function updateFocusByWidth(width){ - - side_width = (READER_CONTENT_FRAME.clientWidth - width) / 2 - - FOCUS_OVERLAY.style.gridTemplateColumns = side_width +"px auto " + side_width + "px" - FOCUS_OVERLAY.style.gridTemplateRows = "0px auto 0px"; + FOCUS_OVERLAY_WIDTH.style.width = (width / READER_CONTENT_FRAME.clientWidth * 100) + "%" + FOCUS_OVERLAY_HEIGHT.style.height = "100%" } function updateFocusByHeight(height){ - - side_width = (READER_CONTENT_FRAME.clientHeight - height) / 2 - - FOCUS_OVERLAY.style.gridTemplateRows = side_width +"px auto " + side_width + "px" - FOCUS_OVERLAY.style.gridTemplateColumns = "0px auto 0px"; + FOCUS_OVERLAY_WIDTH.style.width = "100%" + FOCUS_OVERLAY_HEIGHT.style.height = (height / READER_CONTENT_FRAME.clientHeight * 100) + "%" } function toggleViewMode() { diff --git a/comic_reader_test_high_res.html b/comic_reader_test_high_res.html index 84e2c31..e86d8fc 100644 --- a/comic_reader_test_high_res.html +++ b/comic_reader_test_high_res.html @@ -13,7 +13,7 @@
-