diff --git a/src/components/Output/index.tsx b/src/components/Output/index.tsx index 454e8bc9..caf020cd 100644 --- a/src/components/Output/index.tsx +++ b/src/components/Output/index.tsx @@ -188,6 +188,7 @@ export default class Output extends Component {
{ onWheelCapture={this.onRetargetableEvent} > @@ -213,7 +215,7 @@ export default class Output extends Component { }} /> - + {
-
+
@@ -247,7 +249,7 @@ export default class Output extends Component { /> ) : ( - {Math.round(scale * 100)} + {Math.round(scale * 100)} % )} diff --git a/src/components/Output/style.scss b/src/components/Output/style.scss index dacb10bf..6f6fa708 100644 --- a/src/components/Output/style.scss +++ b/src/components/Output/style.scss @@ -2,134 +2,68 @@ Note: These styles are temporary. They will be replaced before going live. */ -%fill { - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - overflow: hidden; - contain: strict; -} - .output { - @extend %fill; + composes: abs-fill from '../../lib/util.scss'; - &:before { + &::before { content: ''; - @extend %fill; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; background: #000; opacity: 0; transition: opacity 500ms ease; } - &.altBackground:before { - opacity: .6; - } - > two-up { - @extend %fill; - --accent-color: var(--button-fg); - - > pinch-zoom { - @extend %fill; - outline: none; - display: flex; - justify-content: center; - align-items: center; - } + &.alt-background::before { + opacity: 0.6; } } +.two-up { + composes: abs-fill from '../../lib/util.scss'; + --accent-color: var(--button-fg); +} + +.pinch-zoom { + composes: abs-fill from '../../lib/util.scss'; + outline: none; + display: flex; + justify-content: center; + align-items: center; +} + .controls { position: absolute; display: flex; justify-content: center; - left: 220px; - right: 220px; - bottom: 0; + top: 0; + left: 0; + right: 0; padding: 9px; overflow: hidden; flex-wrap: wrap; contain: content; - @media (max-width: 680px) { - top: 0; - bottom: auto; - left: 0; - right: 0; + @media (min-width: 680px) { + top: auto; + left: 220px; + right: 220px; + bottom: 0; } +} - > * { - z-index: 2; - } +.zoom-controls { + display: flex; - .group { - display: flex; - } - - .button, - .zoom { - display: flex; - align-items: center; - flex: 0; - box-sizing: border-box; - height: 48px; - padding: 0 16px; - margin: 4px; - background-color: #fff; - border: 1px solid rgba(0,0,0,0.2); - border-radius: 5px; - line-height: 1; - font-size: 110%; - white-space: nowrap; - - &:focus { - box-shadow: 0 0 0 2px var(--button-fg); - outline: none; - z-index: 1; - } - } - - .button { - text-transform: uppercase; - color: var(--button-fg); - cursor: pointer; - text-indent: 6px; - } - - .button:hover { - background-color: #eee; - } - - .zoom { - flex: 0 0 6em; - color: #625E80; - font: inherit; - cursor: text; - width: 6em; - text-align: center; - justify-content: center; - - &:focus { - box-shadow: inset 0 1px 4px rgba(0,0,0,0.2), 0 0 0 2px var(--button-fg); - } - - strong { - position: relative; - top: 1px; - margin: 0 3px 0 0; - color: #888; - font-weight: normal; - border-bottom: 1px dashed #999; - } - } - - .group > :not(:first-child) { + & :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; } - .group > :not(:last-child) { + & :not(:last-child) { margin-right: 0; border-right-width: 0; border-top-right-radius: 0; @@ -137,6 +71,61 @@ Note: These styles are temporary. They will be replaced before going live. } } +.button, +.zoom { + display: flex; + align-items: center; + box-sizing: border-box; + height: 48px; + padding: 0 16px; + margin: 4px; + background-color: #fff; + border: 1px solid rgba(0,0,0,0.2); + border-radius: 5px; + line-height: 1; + white-space: nowrap; + + &:focus { + box-shadow: 0 0 0 2px var(--button-fg); + outline: none; + z-index: 1; + } +} + +.button { + text-transform: uppercase; + color: var(--button-fg); + cursor: pointer; + text-indent: 6px; + font-size: 110%; + + &:hover { + background-color: #eee; + } +} + +.zoom { + flex: 0 0 6em; + color: #625E80; + cursor: text; + width: 6em; + font: inherit; + text-align: center; + justify-content: center; + + &:focus { + box-shadow: inset 0 1px 4px rgba(0,0,0,0.2), 0 0 0 2px var(--button-fg); + } +} + +.zoom-value { + position: relative; + top: 1px; + margin: 0 3px 0 0; + color: #888; + border-bottom: 1px dashed #999; +} + .output-canvas { flex-shrink: 0; } diff --git a/src/components/compress/style.scss b/src/components/compress/style.scss index 2643534f..29fefe9f 100644 --- a/src/components/compress/style.scss +++ b/src/components/compress/style.scss @@ -4,7 +4,6 @@ .option-pair { display: flex; - justify-content: flex-end; width: 100%; height: 100%; @@ -15,5 +14,6 @@ &.vertical { flex-direction: column; + justify-content: flex-end; } } diff --git a/src/lib/icons.tsx b/src/lib/icons.tsx index 7ada39cc..0562b8d9 100644 --- a/src/lib/icons.tsx +++ b/src/lib/icons.tsx @@ -2,31 +2,29 @@ import { h } from 'preact'; // tslint:disable:max-line-length variable-name -export interface IconProps extends JSX.HTMLAttributes {} - -const Icon = (props: IconProps) => ( +const Icon = (props: JSX.HTMLAttributes) => ( ); -export const DownloadIcon = (props: IconProps) => ( +export const DownloadIcon = (props: JSX.HTMLAttributes) => ( ); -export const ToggleIcon = (props: IconProps) => ( +export const ToggleIcon = (props: JSX.HTMLAttributes) => ( ); -export const AddIcon = (props: IconProps) => ( +export const AddIcon = (props: JSX.HTMLAttributes) => ( ); -export const RemoveIcon = (props: IconProps) => ( +export const RemoveIcon = (props: JSX.HTMLAttributes) => ( diff --git a/src/lib/util.scss b/src/lib/util.scss index f5b3241d..b8c7ba48 100644 --- a/src/lib/util.scss +++ b/src/lib/util.scss @@ -5,6 +5,7 @@ width: 100%; height: 100%; box-sizing: border-box; + contain: strict; } .unbutton {