Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

style(chrome-extension): add drawing overlay and control bar styles

Richie McIlroy979779073805
diff --git a/apps/chrome-extension/src/content/overlay.css b/apps/chrome-extension/src/content/overlay.css
index 042b56a97..e6afc3ef3 100644
--- a/apps/chrome-extension/src/content/overlay.css
+++ b/apps/chrome-extension/src/content/overlay.css
@@ -280,7 +280,11 @@
all: unset;
position: fixed;
inset: 0;
- z-index: 2147483646;
+ /* Sits below the drawing canvas so that, while drawing, strokes land on the
+ canvas instead of this backdrop closing the panel out from under them. It
+ still covers the page (which lives far below) to catch outside clicks when
+ no canvas is mounted. */
+ z-index: 2147483640;
display: block;
background: transparent;
pointer-events: auto;
@@ -492,6 +496,17 @@
color: #9b9ba3;
}
+.cap-extension-control-bar-icon-button.is-active {
+ background: rgba(37, 99, 235, 0.12);
+ color: #2563eb;
+}
+
+.cap-extension-control-bar-icon-button.is-active:hover,
+.cap-extension-control-bar-icon-button.is-active:focus-visible {
+ background: rgba(37, 99, 235, 0.18);
+ color: #1d4ed8;
+}
+
.cap-extension-control-bar-pill {
all: unset;
box-sizing: border-box;
@@ -636,3 +651,150 @@
transform: translateY(0) scale(1);
}
}
+
+/* The drawing surface sits above the recorder panel's backdrop (so drawing
+ works even while the panel that hosts the "Ready to record" bar is open) but
+ below the floating bars and the draw toolbar (which stay at the maximum
+ z-index) so those controls remain clickable while the canvas captures
+ pointer events everywhere else on the page. */
+.cap-extension-draw-canvas {
+ position: fixed;
+ inset: 0;
+ z-index: 2147483645;
+ display: block;
+ cursor: crosshair;
+ pointer-events: auto;
+ touch-action: none;
+}
+
+.cap-extension-draw-toolbar {
+ position: fixed;
+ top: 16px;
+ left: 50%;
+ z-index: 2147483647;
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ padding: 8px 10px;
+ border: 1px solid rgba(18, 18, 23, 0.08);
+ border-radius: 16px;
+ background: rgba(252, 252, 252, 0.97);
+ box-shadow:
+ 0 24px 64px rgba(0, 0, 0, 0.28),
+ 0 4px 16px rgba(0, 0, 0, 0.12);
+ color: #202020;
+ pointer-events: auto;
+ user-select: none;
+ backdrop-filter: blur(20px);
+ font-family:
+ Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
+ "Segoe UI", sans-serif;
+ font-size: 13px;
+ letter-spacing: 0;
+ line-height: 1;
+ transform: translateX(-50%);
+ animation: cap-extension-draw-toolbar-in 240ms cubic-bezier(0.16, 1, 0.3, 1);
+}
+
+.cap-extension-draw-group {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+}
+
+.cap-extension-draw-divider {
+ width: 1px;
+ align-self: stretch;
+ margin: 3px 0;
+ background: rgba(18, 18, 23, 0.08);
+}
+
+.cap-extension-draw-swatch {
+ all: unset;
+ box-sizing: border-box;
+ width: 22px;
+ height: 22px;
+ flex: 0 0 auto;
+ border-radius: 999px;
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
+ cursor: pointer;
+ transition:
+ transform 140ms ease,
+ box-shadow 140ms ease;
+}
+
+.cap-extension-draw-swatch:hover {
+ transform: scale(1.12);
+}
+
+.cap-extension-draw-swatch.is-active {
+ box-shadow:
+ inset 0 0 0 1px rgba(0, 0, 0, 0.12),
+ 0 0 0 2px #fcfcfc,
+ 0 0 0 4px currentColor;
+}
+
+.cap-extension-draw-swatch:focus-visible {
+ outline: 2px solid #5eb1ef;
+ outline-offset: 2px;
+}
+
+.cap-extension-draw-size,
+.cap-extension-draw-icon-button {
+ all: unset;
+ box-sizing: border-box;
+ display: flex;
+ width: 32px;
+ height: 32px;
+ align-items: center;
+ justify-content: center;
+ border-radius: 9px;
+ color: #5f5f66;
+ cursor: pointer;
+ transition:
+ background 140ms ease,
+ color 140ms ease;
+}
+
+.cap-extension-draw-size:hover,
+.cap-extension-draw-icon-button:hover,
+.cap-extension-draw-size:focus-visible,
+.cap-extension-draw-icon-button:focus-visible {
+ background: rgba(18, 18, 23, 0.06);
+ color: #18181b;
+}
+
+.cap-extension-draw-size:focus-visible,
+.cap-extension-draw-icon-button:focus-visible {
+ outline: 2px solid #5eb1ef;
+ outline-offset: 1px;
+}
+
+.cap-extension-draw-size.is-active,
+.cap-extension-draw-icon-button.is-active {
+ background: rgba(18, 18, 23, 0.09);
+ color: #18181b;
+}
+
+.cap-extension-draw-icon-button svg {
+ display: block;
+ flex: 0 0 auto;
+}
+
+.cap-extension-draw-size-dot {
+ display: block;
+ flex: 0 0 auto;
+ border-radius: 999px;
+ background: currentColor;
+}
+
+@keyframes cap-extension-draw-toolbar-in {
+ from {
+ opacity: 0;
+ transform: translateX(-50%) translateY(-10px) scale(0.98);
+ }
+ to {
+ opacity: 1;
+ transform: translateX(-50%) translateY(0) scale(1);
+ }
+}