From 125c296eedf680ad7670544aa8f74d81fa9aa799 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 8 Dec 2020 20:31:02 -0500 Subject: Support frame resize on firefox (#1088) * Add popup functions for getting/setting the frame size * Add frontend functions for getting/setting popup frame size * Expose display mode attribute on display HTML * Disable resizer on iframe * Add custom frame resizer handle * Add support for custom frame resizer --- ext/mixed/css/display.css | 50 +++++++++++++++++++++++++++++++++++++++++++ ext/mixed/css/popup-outer.css | 3 +-- 2 files changed, 51 insertions(+), 2 deletions(-) (limited to 'ext/mixed/css') diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css index 605c0148..0a676a8f 100644 --- a/ext/mixed/css/display.css +++ b/ext/mixed/css/display.css @@ -1119,6 +1119,52 @@ button.action-button { } +/* Frame resizer */ +.frame-resizer-container { + position: fixed; + bottom: 0; + right: 0; + z-index: 100; + background: transparent; + pointer-events: none; + user-select: none; +} +.frame-resizer-sizer1 { + padding-top: 100%; + line-height: 0; +} +.frame-resizer-sizer2 { + display: inline-block; + overflow-x: hidden; + overflow-y: scroll; + vertical-align: bottom; +} +.frame-resizer-sizer2.frame-resizer-sizer2-with-min-size { + min-width: 1em; +} +.frame-resizer-svg { + display: block; + position: absolute; + bottom: 0; + right: 0; + width: 75%; + height: 75%; +} +.frame-resizer-handle { + fill: var(--default-text-color); + opacity: 0.125; + cursor: se-resize; + pointer-events: auto; + transition: + fill var(--animation-duration) linear, + opacity var(--animation-duration) linear; +} +.frame-resizer-handle:hover { + fill: var(--accent-color); + opacity: 1; +} + + /* Conditional styles */ :root:not([data-enable-search-tags=true]) .tag[data-category=search] { display: none; @@ -1221,3 +1267,7 @@ button.action-button { :root:not([data-glossary-layout-mode=compact]) .term-glossary-image-description { display: block; } + +:root[data-popup-display-mode=full-width] .frame-resizer-container { + display: none; +} diff --git a/ext/mixed/css/popup-outer.css b/ext/mixed/css/popup-outer.css index 74307d9f..0ee8df9e 100644 --- a/ext/mixed/css/popup-outer.css +++ b/ext/mixed/css/popup-outer.css @@ -22,7 +22,7 @@ iframe.yomichan-popup { border: 1em solid #999999; box-shadow: 0 0 10em rgba(0, 0, 0, 0.5); position: fixed; - resize: both; + resize: none; visibility: hidden; z-index: 2147483647; box-sizing: border-box; @@ -38,7 +38,6 @@ iframe.yomichan-popup[data-outer-theme=auto][data-site-color=dark] { iframe.yomichan-popup[data-popup-display-mode=full-width] { border-left: none; border-right: none; - resize: none; } iframe.yomichan-popup[data-popup-display-mode=full-width][data-below=true] { border-bottom: none; -- cgit v1.2.3