Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(ui): adjust in-progress recording window styling

David Anyatonwu5177b17d115c
diff --git a/apps/desktop/src/routes/(window-chrome)/settings/screenshots.tsx b/apps/desktop/src/routes/(window-chrome)/settings/screenshots.tsx
index 92d42feaf..9f491b31e 100644
--- a/apps/desktop/src/routes/(window-chrome)/settings/screenshots.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/settings/screenshots.tsx
@@ -54,7 +54,7 @@ export default function Screenshots() {
<Show
when={fetchScreenshots.data && fetchScreenshots.data.length > 0}
fallback={
- <p class="text-center text-gray-500">No screenshots found</p>
+ <p class="text-center text-[--text-tertiary]">No screenshots found</p>
}
>
<For each={fetchScreenshots.data}>
@@ -81,7 +81,7 @@ function ScreenshotItem(props: {
const [imageExists, setImageExists] = createSignal(true);
return (
- <li class="w-full flex flex-row justify-between items-center p-2 hover:bg-gray-100 rounded">
+ <li class="w-full flex flex-row justify-between items-center p-2 hover:bg-gray-100 dark:hover:bg-gray-200 rounded">
<div class="flex items-center">
<Show
when={imageExists()}
@@ -96,7 +96,7 @@ function ScreenshotItem(props: {
onError={() => setImageExists(false)}
/>
</Show>
- <span>{props.screenshot.prettyName.replace(".png", "")}</span>
+ <span class="text-[--text-primary]">{props.screenshot.prettyName.replace(".png", "")}</span>
</div>
<div class="flex items-center">
<button
@@ -105,7 +105,7 @@ function ScreenshotItem(props: {
e.stopPropagation();
props.onOpenFolder();
}}
- class="p-2 hover:bg-gray-200 rounded-full mr-2"
+ class="p-2 hover:bg-gray-200 dark:hover:bg-gray-300 text-[--text-tertiary] hover:text-[--text-primary] rounded-full mr-2"
>
<IconLucideFolder class="size-5" />
</button>
@@ -115,7 +115,7 @@ function ScreenshotItem(props: {
e.stopPropagation();
props.onClick();
}}
- class="p-2 hover:bg-gray-200 rounded-full"
+ class="p-2 hover:bg-gray-200 dark:hover:bg-gray-300 text-[--text-tertiary] hover:text-[--text-primary] rounded-full"
>
<IconLucideEye class="size-5" />
</button>
diff --git a/apps/desktop/src/routes/(window-chrome)/upgrade.tsx b/apps/desktop/src/routes/(window-chrome)/upgrade.tsx
index cb0b15c6a..09e44c186 100644
--- a/apps/desktop/src/routes/(window-chrome)/upgrade.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/upgrade.tsx
@@ -103,7 +103,7 @@ export default function Page() {
{!upgradeComplete() && (
<>
<div class="text-center">
- <h1 class="text-4xl md:text-4xl mb-3 tracking-[-.05em] font-medium">
+ <h1 class="text-4xl md:text-4xl mb-3 tracking-[-.05em] font-medium text-[--text-primary]">
Upgrade to Cap Pro
</h1>
<p class="text-base font-normal leading-6 text-gray-400">
@@ -119,25 +119,25 @@ export default function Page() {
<div class="border text-card-foreground shadow-sm bg-blue-300 p-3 md:p-3 rounded-xl flex-grow border-blue-500/20">
<div class="space-y-3">
<div class="flex flex-col space-y-1.5 pt-6 px-6 pb-3">
- <h3 class="font-medium tracking-tight text-2xl text-gray-50">
+ <h3 class="font-medium tracking-tight text-2xl text-[--text-primary]">
Cap Pro — Early Adopter Pricing
</h3>
- <p class="text-[0.875rem] leading-[1.25rem] text-gray-50/80">
+ <p class="text-[0.875rem] leading-[1.25rem] text-[--text-tertiary]">
For professional use and teams.
</p>
<div>
<div class="flex items-center space-x-3">
- <h3 class="text-4xl text-gray-50">
+ <h3 class="text-4xl text-[--text-primary]">
{isAnnual() ? "$6/mo" : "$9/mo"}
</h3>
<div>
- <p class="text-sm font-medium text-gray-50/80">
+ <p class="text-sm font-medium text-[--text-tertiary]">
{isAnnual()
? "per user, billed annually."
: "per user, billed monthly."}
</p>
{isAnnual() && (
- <p class="text-sm text-gray-50/80">
+ <p class="text-sm text-[--text-tertiary]">
or, $9/month, billed monthly.
</p>
)}
@@ -147,7 +147,7 @@ export default function Page() {
</div>
<div class="mt-3 px-3 md:px-8">
<div class="flex items-center mt-3 pt-4 pb-1 border-t-2 border-gray-50/20">
- <span class="text-xs text-gray-50/80 mr-2">
+ <span class="text-xs text-[--text-tertiary] mr-2">
Switch to {isAnnual() ? "monthly" : "annually"}
</span>
<button
@@ -156,12 +156,12 @@ export default function Page() {
aria-checked={isAnnual()}
data-state={isAnnual() ? "unchecked" : "checked"}
value={isAnnual() ? "on" : "off"}
- class="peer inline-flex h-4 w-8 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 bg-blue-400"
+ class="peer inline-flex h-4 w-8 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 bg-[--blue-400]"
onClick={togglePricing}
>
<span
data-state={isAnnual() ? "unchecked" : "checked"}
- class="pointer-events-none block h-4 w-4 rounded-full bg-gray-50 shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
+ class="pointer-events-none block h-4 w-4 rounded-full bg-[--gray-50] shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
/>
</button>
</div>
@@ -169,7 +169,7 @@ export default function Page() {
<div class="px-6 pb-4 pt-0">
<button
onClick={getCheckoutUrl}
- class="flex items-center justify-center rounded-full bg-gray-50 text-gray-900 hover:bg-gray-200 disabled:bg-gray-100 border border-gray-300 font-medium text-lg px-6 h-12 w-full no-underline"
+ class="flex items-center justify-center rounded-full bg-[--gray-50] text-[--text-primary] hover:bg-[--gray-200] disabled:bg-[--gray-100] border border-[--gray-300] font-medium text-lg px-6 h-12 w-full no-underline"
disabled={loading()}
>
{loading() ? "Loading..." : "Upgrade to Cap Pro"}
@@ -182,9 +182,9 @@ export default function Page() {
{proFeatures.map((feature) => (
<li class="flex items-center justify-start">
<div class="w-6 h-6 m-0 p-0 flex items-center border-[2px] border-white justify-center rounded-full">
- <IconLucideCheck class="w-5 h-5 stroke-[4px] text-gray-50" />
+ <IconLucideCheck class="w-5 h-5 stroke-[4px] text-[--gray-50]" />
</div>
- <span class="ml-2 text-lg text-gray-50">
+ <span class="ml-2 text-lg text-[--text-primary]">
{feature}
</span>
</li>
diff --git a/apps/desktop/src/routes/in-progress-recording.tsx b/apps/desktop/src/routes/in-progress-recording.tsx
index a67407f06..df09136e0 100644
--- a/apps/desktop/src/routes/in-progress-recording.tsx
+++ b/apps/desktop/src/routes/in-progress-recording.tsx
@@ -53,12 +53,12 @@ export default function () {
return (
<div
- class="text-gray-400 flex flex-row items-stretch bg-gray-500 w-full h-full animate-in fade-in"
+ class="text-[--text-primary] flex flex-row items-stretch bg-gray-50 dark:bg-gray-100 w-full h-full animate-in fade-in"
>
<div class="flex flex-row justify-between p-[0.25rem] flex-1">
<button
disabled={stopRecording.isPending}
- class="py-[0.25rem] px-[0.5rem] text-red-300 gap-[0.25rem] flex flex-row items-center hover:bg-red-transparent-20 transition-colors rounded-lg"
+ class="py-[0.25rem] px-[0.5rem] text-red-300 dark:text-red-300 gap-[0.25rem] flex flex-row items-center hover:bg-red-transparent-20 transition-colors rounded-lg"
type="button"
onClick={() => stopRecording.mutate()}
>
@@ -67,19 +67,23 @@ export default function () {
{formatTime((time() - start) / 1000)}
</span>
</button>
+
{window.FLAGS.pauseResume && (
<ActionButton
disabled={togglePause.isPending}
onClick={() => togglePause.mutate()}
+ class="text-[--text-primary] hover:bg-gray-200 dark:hover:bg-gray-300 flex items-center justify-center"
>
{isPaused() ? <IconCapPlayCircle /> : <IconCapPauseCircle />}
</ActionButton>
)}
+
<ActionButton
disabled={restartRecording.isPending}
onClick={() => restartRecording.mutate()}
+ class="text-[--text-primary] hover:bg-gray-200 dark:hover:bg-gray-300 h-8 w-8 flex items-center justify-center"
>
- <IconCapRestart />
+ <IconCapRestart class="dark:fill-white dark:hover:fill-white" />
</ActionButton>
</div>
<div
diff --git a/apps/desktop/src/routes/prev-recordings.tsx b/apps/desktop/src/routes/prev-recordings.tsx
index 25d1bc04e..757f76f86 100644
--- a/apps/desktop/src/routes/prev-recordings.tsx
+++ b/apps/desktop/src/routes/prev-recordings.tsx
@@ -204,11 +204,11 @@ export default function () {
<Suspense>
<div
ref={setRef}
- style={{ "border-color": "rgba(255, 255, 255, 0.2)" }}
+ style={{ "border-color": "rgba(255, 255, 255, 0.1)" }}
class={cx(
- "w-[260px] h-[150px] p-[0.1875rem] bg-gray-500/50 rounded-[12px] overflow-hidden shadow border-[1px] group relative",
+ "w-[260px] h-[150px] p-[0.1875rem] bg-gray-500/40 dark:bg-gray-500/20 rounded-[12px] overflow-hidden shadow border-[1px] group relative",
"transition-all duration-300",
- media.isNew && "ring-2 ring-blue-500 ring-opacity-75"
+ media.isNew && "ring-2 ring-blue-300 dark:ring-blue-400 ring-opacity-75"
)}
>
<div
@@ -218,18 +218,18 @@ export default function () {
isLoading() && "backdrop-blur bg-gray-500/80"
)}
style={{
- "border-color": "rgba(255, 255, 255, 0.2)",
+ "border-color": "rgba(255, 255, 255, 0.1)",
"pointer-events": "auto",
}}
>
<Show
when={imageExists()}
fallback={
- <div class="pointer-events-none w-[105%] h-[105%] absolute inset-0 -z-10 bg-gray-400" />
+ <div class="pointer-events-none w-full h-full absolute inset-0 -z-10 bg-gray-400 dark:bg-gray-300" />
}
>
<img
- class="pointer-events-none w-[105%] h-[105%] object-cover absolute inset-0 -z-10"
+ class="pointer-events-none w-full h-full object-cover absolute inset-0 -z-10 rounded-[6px]"
alt="media preview"
src={`${convertFileSrc(
isRecording
diff --git a/packages/ui-solid/src/Button.tsx b/packages/ui-solid/src/Button.tsx
index d1d211076..26a94efa9 100644
--- a/packages/ui-solid/src/Button.tsx
+++ b/packages/ui-solid/src/Button.tsx
@@ -11,11 +11,11 @@ const styles = cva(
variants: {
variant: {
primary:
- "bg-blue-300 text-gray-50 hover:bg-blue-400 disabled:bg-blue-200 outline-blue-300",
+ "bg-blue-300 text-gray-50 dark:text-white hover:bg-blue-400 disabled:bg-blue-200 outline-blue-300",
secondary:
"bg-gray-200 text-gray-500 hover:bg-gray-300 disabled:bg-gray-200 disabled:text-gray-400 outline-blue-300",
destructive:
- "bg-red-300 text-gray-50 hover:bg-red-400 disabled:bg-red-200 outline-red-300",
+ "bg-red-300 text-gray-50 dark:text-white hover:bg-red-400 disabled:bg-red-200 outline-red-300",
},
size: {
xs: "font-[400] text-[0.75rem] px-[0.5rem] h-[1.25rem] ",