diff options
Diffstat (limited to 'browser/components/screenshots/overlay')
-rw-r--r-- | browser/components/screenshots/overlay/overlay.css | 349 |
1 files changed, 349 insertions, 0 deletions
diff --git a/browser/components/screenshots/overlay/overlay.css b/browser/components/screenshots/overlay/overlay.css new file mode 100644 index 0000000000..6eeda8b44c --- /dev/null +++ b/browser/components/screenshots/overlay/overlay.css @@ -0,0 +1,349 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +@import url("chrome://global/skin/in-content/common.css"); + +:host { + display: contents; +} + +[hidden] { + display: none !important; +} + +#screenshots-component { + position: absolute; + inset: 0; + font: message-box; + user-select: none; + touch-action: none; + pointer-events: auto; + cursor: crosshair; + + &[dragging] { + cursor: grabbing; + } + + &[resizing] { + position: fixed; + width: 100% !important; + height: 100% !important; + } +} + +#selection-container { + overflow: clip; + position: absolute; + inset: 0; + pointer-events: none; +} + +#preview-container { + overflow: clip; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + position: sticky; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + background-color: rgba(0, 0, 0, 0.7); +} + +#buttons-container { + position: absolute; + margin: 10px 0; + cursor: auto; +} + +#selection-size, +#buttons-container { + padding: 4px; + background-color: var(--in-content-page-background); + color: var(--in-content-text-color); + border-radius: 4px; +} + +.buttons-wrapper, +#selection-size-container { + display: flex; + align-items: center; + justify-content: center; +} + +.screenshots-button { + display: inline-flex; + align-items: center; + cursor: pointer; + text-align: center; + user-select: none; + white-space: nowrap; + z-index: 6; + min-width: 32px; + margin-inline: 4px; +} + +#selection-size-container { + width: 100%; + height: 100%; + pointer-events: none; +} + +#screenshots-cancel-button { + margin-top: 20px; + border-color: #fff; + color: #fff; + + @media (prefers-contrast) { + background-color: var(--in-content-button-background); + color: var(--in-content-button-text-color); + border-color: var(--in-content-button-border-color); + } +} + +#screenshots-cancel-button:hover { + background-color: #fff; + color: #000; + + @media (prefers-contrast) { + background-color: var(--in-content-button-background-hover); + color: var(--in-content-button-text-color-hover); + border-color: var(--in-content-button-border-color-hover); + } +} + +.screenshots-button > img { + -moz-context-properties: fill; + fill: currentColor; + width: 16px; + height: 16px; + pointer-events: none; +} + +#cancel > img { + content: url("chrome://global/skin/icons/close.svg"); +} + +#copy > img { + content: url("chrome://global/skin/icons/edit-copy.svg"); +} + +#download > img { + content: url("chrome://browser/skin/downloads/downloads.svg"); +} + +#download > img, +#copy > img { + margin-inline-end: 5px; +} + +.face-container { + position: relative; + width: 64px; + height: 64px; +} + +.face { + width: 62px; + height: 62px; + display: block; + background-image: url("chrome://browser/content/screenshots/icon-welcome-face-without-eyes.svg"); +} + +.eye { + background-color: #fff; + width: 10px; + height: 14px; + position: absolute; + border-radius: 100%; + overflow: hidden; + inset-inline-start: 16px; + top: 19px; +} + +.eyeball { + position: absolute; + width: 6px; + height: 6px; + background-color: #000; + border-radius: 50%; + inset-inline-start: 2px; + top: 4px; + z-index: 10; +} + +.left { + margin-inline-start: 0; +} + +.right { + margin-inline-start: 20px; +} + +.preview-instructions { + display: flex; + align-items: center; + justify-content: center; + animation: pulse 125ms cubic-bezier(0.07, 0.95, 0, 1); + color: #fff; + font-size: 24px; + line-height: 32px; + text-align: center; + padding: 20px; + width: 400px; + + @media (prefers-contrast) { + color: CanvasText; + background-color: Canvas; + } +} + +#hover-highlight { + animation: fade-in 125ms forwards cubic-bezier(0.07, 0.95, 0, 1); + background: rgba(255, 255, 255, 0.2); + border: 2px dashed rgba(255, 255, 255, 0.4); + border-radius: 1px; + box-sizing: border-box; + pointer-events: none; + position: absolute; + z-index: 11; +} + +#top-background { + top: 0; + left: 0; + width: 100%; +} + +#left-background { + left: 0; +} + +#bottom-background { + left: 0; + width: 100%; +} + +.bghighlight { + background-color: rgba(0, 0, 0, 0.7); + position: absolute; + overflow: clip; + pointer-events: none; + /* FIXME(bug 1859421): This shouldn't be needed */ + z-index: -1; +} + +.highlight { + border: 2px dashed rgba(255, 255, 255, 0.8); + box-sizing: border-box; + cursor: move; + position: absolute; + pointer-events: auto; + z-index: 2; + outline-offset: 8px; +} + +.mover-target { + display: flex; + align-items: center; + justify-content: center; + position: absolute; + z-index: 5; + pointer-events: auto; + outline-offset: -15px; +} + +.mover-target.direction-topLeft { + cursor: nwse-resize; + height: 60px; + left: -30px; + top: -30px; + width: 60px; +} + +.mover-target.direction-top { + cursor: ns-resize; + height: 60px; + inset-inline-start: 0; + top: -30px; + width: 100%; + z-index: 4; +} + +.mover-target.direction-topRight { + cursor: nesw-resize; + height: 60px; + right: -30px; + top: -30px; + width: 60px; +} + +.mover-target.direction-left { + cursor: ew-resize; + height: 100%; + left: -30px; + top: 0; + width: 60px; + z-index: 4; +} + +.mover-target.direction-right { + cursor: ew-resize; + height: 100%; + right: -30px; + top: 0; + width: 60px; + z-index: 4; +} + +.mover-target.direction-bottomLeft { + bottom: -30px; + cursor: nesw-resize; + height: 60px; + left: -30px; + width: 60px; +} + +.mover-target.direction-bottom { + bottom: -30px; + cursor: ns-resize; + height: 60px; + inset-inline-start: 0; + width: 100%; + z-index: 4; +} + +.mover-target.direction-bottomRight { + bottom: -30px; + cursor: nwse-resize; + height: 60px; + right: -30px; + width: 60px; +} + +.mover-target:hover .mover { + transform: scale(1.05); +} + +.mover { + background-color: #fff; + border-radius: 50%; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.5); + transition: transform 125ms cubic-bezier(0.07, 0.95, 0, 1); + position: relative; + height: 16px; + width: 16px; + pointer-events: none; + + @media (prefers-contrast) { + background-color: ButtonText; + } +} + +.small-selection .mover { + height: 10px; + width: 10px; +} |