Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(web): restyle desktop sign-in handoff page

Richie McIlroy3524dd005b7c
diff --git a/apps/web/lib/desktop-session.ts b/apps/web/lib/desktop-session.ts
index ef8d2ed17..84f4527ae 100644
--- a/apps/web/lib/desktop-session.ts
+++ b/apps/web/lib/desktop-session.ts
@@ -63,90 +63,345 @@ export function createDesktopRedirectPage(
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
- <title>Open Cap</title>
+ <title>Opening Cap</title>
<style>
+ @font-face {
+ font-family: "Neue Montreal";
+ src: url("/fonts/NeueMontreal-Regular.woff2") format("woff2");
+ font-weight: 400;
+ font-display: swap;
+ }
+
+ @font-face {
+ font-family: "Neue Montreal";
+ src: url("/fonts/NeueMontreal-Medium.woff2") format("woff2");
+ font-weight: 500;
+ font-display: swap;
+ }
+
:root {
+ --paper: #fbfaf7;
+ --ink: #20242c;
+ --ink-soft: #8b8f98;
+ --accent: #4785ff;
+ --accent-soft: #adc9ff;
+ --track: #dcdcd4;
color-scheme: light;
- font-family: Inter, "Segoe UI", sans-serif;
+ }
+
+ *,
+ *::before,
+ *::after {
+ box-sizing: border-box;
}
body {
margin: 0;
min-height: 100vh;
- display: grid;
- place-items: center;
- background: linear-gradient(180deg, #f6f8fc 0%, #eef3ff 100%);
- color: #111827;
+ min-height: 100dvh;
+ display: flex;
+ flex-direction: column;
+ background: var(--paper);
+ color: var(--ink);
+ font-family: "Neue Montreal", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
+ -webkit-font-smoothing: antialiased;
+ }
+
+ header {
+ display: flex;
+ justify-content: center;
+ padding: 32px 24px 0;
+ animation: fade-up 0.5s ease both;
}
main {
- width: min(440px, calc(100vw - 32px));
- padding: 32px 28px;
- border-radius: 24px;
- background: rgba(255, 255, 255, 0.92);
- box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 40px 24px 56px;
text-align: center;
}
+ .doodle {
+ width: 236px;
+ height: auto;
+ overflow: visible;
+ animation: fade-up 0.5s ease 0.05s both;
+ }
+
+ .boil {
+ filter: url(#boil);
+ }
+
+ .stroke,
+ .accent,
+ .accent-soft,
+ .soft {
+ fill: none;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ }
+
+ .stroke {
+ stroke: var(--ink);
+ stroke-width: 4.5;
+ }
+
+ .accent {
+ stroke: var(--accent);
+ stroke-width: 4.5;
+ }
+
+ .accent-soft {
+ stroke: var(--accent-soft);
+ stroke-width: 4.5;
+ }
+
+ .soft {
+ stroke: var(--ink-soft);
+ stroke-width: 2.5;
+ stroke-dasharray: 2 4.2;
+ animation: march 1.2s linear infinite;
+ }
+
+ .ink-fill {
+ fill: var(--ink);
+ }
+
+ .draw {
+ stroke-dasharray: 1;
+ stroke-dashoffset: 1;
+ animation: draw var(--t, 0.6s) ease var(--d, 0s) forwards;
+ }
+
+ .appear {
+ opacity: 0;
+ animation: fade-in 0.4s ease var(--d, 0s) forwards;
+ }
+
+ .mark {
+ transform-box: fill-box;
+ transform-origin: center;
+ animation: pulse 1.6s ease-in-out 1.2s infinite;
+ }
+
h1 {
- margin: 0 0 12px;
+ margin: 28px 0 0;
font-size: 28px;
- line-height: 1.1;
+ font-weight: 500;
+ line-height: 1.15;
+ letter-spacing: -0.015em;
+ animation: fade-up 0.5s ease 0.1s both;
}
- p {
- margin: 0;
- font-size: 16px;
- line-height: 1.5;
- color: #4b5563;
+ .lede {
+ margin: 10px 0 0;
+ max-width: 400px;
+ font-size: 15.5px;
+ line-height: 1.55;
+ color: var(--ink-soft);
+ animation: fade-up 0.5s ease 0.15s both;
}
.actions {
- margin-top: 24px;
- display: grid;
- gap: 12px;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: center;
+ gap: 10px;
+ margin-top: 28px;
+ animation: fade-up 0.5s ease 0.22s both;
}
- a,
- button {
- width: 100%;
- border: 0;
- border-radius: 14px;
- padding: 14px 16px;
+ .cta {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ min-height: 44px;
+ padding: 0 24px;
+ border: 1.5px solid var(--ink);
+ border-radius: 999px;
+ background: var(--ink);
+ color: var(--paper);
font: inherit;
- font-weight: 600;
- cursor: pointer;
+ font-size: 14.5px;
+ font-weight: 500;
text-decoration: none;
- box-sizing: border-box;
+ cursor: pointer;
+ transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
+ }
+
+ .cta:hover {
+ background: #353a45;
+ border-color: #353a45;
+ }
+
+ .cta:active {
+ transform: translateY(1px);
+ }
+
+ .cta:focus-visible {
+ outline: 2px solid var(--accent);
+ outline-offset: 3px;
+ }
+
+ .cta.ghost {
+ background: transparent;
+ border-color: var(--track);
+ color: var(--ink);
+ }
+
+ .cta.ghost:hover {
+ background: rgba(32, 36, 44, 0.04);
+ border-color: var(--ink-soft);
+ }
+
+ .status {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ margin: 22px 0 0;
+ font-size: 13.5px;
+ color: var(--ink-soft);
+ animation: fade-up 0.5s ease 0.3s both;
+ }
+
+ .status svg {
+ width: 44px;
+ height: 12px;
+ overflow: visible;
+ }
+
+ footer {
+ padding: 0 24px 32px;
+ text-align: center;
+ font-size: 13px;
+ color: var(--ink-soft);
+ animation: fade-up 0.5s ease 0.35s both;
+ }
+
+ footer a {
+ color: var(--ink);
+ text-decoration: underline;
+ text-decoration-color: var(--track);
+ text-decoration-thickness: 1.5px;
+ text-underline-offset: 3px;
+ }
+
+ footer a:hover {
+ text-decoration-color: var(--ink);
}
- button {
- background: #2563eb;
- color: white;
+ @keyframes draw {
+ to {
+ stroke-dashoffset: 0;
+ }
}
- a {
- background: #e5eefc;
- color: #1d4ed8;
+ @keyframes fade-in {
+ to {
+ opacity: 1;
+ }
}
- #status {
- margin-top: 18px;
- font-size: 14px;
- color: #6b7280;
+ @keyframes fade-up {
+ from {
+ opacity: 0;
+ transform: translateY(10px);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+ }
+
+ @keyframes march {
+ to {
+ stroke-dashoffset: -6.2;
+ }
+ }
+
+ @keyframes pulse {
+ 0%,
+ 100% {
+ transform: scale(1);
+ }
+ 50% {
+ transform: scale(1.08);
+ }
+ }
+
+ @media (prefers-reduced-motion: reduce) {
+ .boil {
+ filter: none;
+ }
+
+ header,
+ .doodle,
+ h1,
+ .lede,
+ .actions,
+ .status,
+ footer,
+ .draw,
+ .appear {
+ animation-duration: 0.01ms;
+ animation-delay: 0s;
+ }
+
+ .soft,
+ .mark {
+ animation: none;
+ }
}
</style>
</head>
<body>
+ <header>
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 103 40" height="28" role="img" aria-label="Cap">
+ <path fill="#4785FF" d="M20 36c8.837 0 16-7.163 16-16S28.837 4 20 4 4 11.164 4 20s7.164 16 16 16" />
+ <path fill="#ADC9FF" d="M20 33c7.18 0 13-5.82 13-13S27.18 7 20 7 7 12.82 7 20s5.82 13 13 13" />
+ <path fill="#fff" d="M20 30c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10" />
+ <path fill="#20242c" d="M58.416 30.448c-5.404 0-9.212-3.864-9.212-10.36 0-6.384 3.668-10.416 9.268-10.416 5.068 0 7.784 2.66 8.624 7.168l-3.808.196c-.476-2.604-2.072-4.2-4.816-4.2-3.388 0-5.488 2.828-5.488 7.252 0 4.48 2.156 7.196 5.46 7.196 2.94 0 4.508-1.708 4.956-4.564l3.808.196c-.784 4.676-3.752 7.532-8.792 7.532m16.23-.112c-3.137 0-5.209-1.484-5.209-4.088 0-2.576 1.596-3.948 4.872-4.592l4.956-.98c0-2.1-.98-3.192-2.856-3.192-1.764 0-2.716.812-3.052 2.324l-3.668-.168c.588-3.136 2.996-4.928 6.72-4.928 4.256 0 6.44 2.24 6.44 6.216v5.432c0 .812.28 1.036.84 1.036h.476V30c-.224.056-.812.112-1.288.112-1.624 0-2.828-.588-3.136-2.436-.728 1.596-2.632 2.66-5.096 2.66m.727-2.604c2.38 0 3.892-1.512 3.892-3.78v-.84l-3.864.784c-1.596.308-2.24.98-2.24 2.016 0 1.176.784 1.82 2.212 1.82M86.874 34.2V15.048h3.444l.056 2.212c.868-1.652 2.52-2.548 4.48-2.548 4.256 0 6.356 3.5 6.356 7.812s-2.128 7.812-6.384 7.812c-1.904 0-3.556-.924-4.368-2.38V34.2zm7.112-6.776c2.184 0 3.5-1.82 3.5-4.9s-1.316-4.9-3.5-4.9-3.528 1.652-3.528 4.9 1.316 4.9 3.528 4.9" />
+ </svg>
+ </header>
<main>
+ <svg class="doodle" viewBox="0 0 200 104" aria-hidden="true">
+ <defs>
+ <filter id="boil" x="-15%" y="-15%" width="130%" height="130%">
+ <feTurbulence type="fractalNoise" baseFrequency="0.05" numOctaves="2" seed="1" result="noise">
+ <animate attributeName="seed" values="1;3;5;7" dur="0.6s" repeatCount="indefinite" calcMode="discrete" />
+ </feTurbulence>
+ <feDisplacementMap in="SourceGraphic" in2="noise" scale="3" xChannelSelector="R" yChannelSelector="G" />
+ </filter>
+ </defs>
+ <g class="boil">
+ <path class="stroke draw" style="--d: 0.1s; --t: 0.7s" pathLength="1" d="M 18 30 L 62 30 Q 70 30 70 38 L 70 80 Q 70 88 62 88 L 18 88 Q 10 88 10 80 L 10 38 Q 10 30 18 30 Z" />
+ <path class="stroke draw" style="--d: 0.55s; --t: 0.3s" pathLength="1" d="M 10 43 L 70 43" />
+ <circle class="ink-fill appear" style="--d: 0.75s" cx="18" cy="36.5" r="1.8" />
+ <circle class="ink-fill appear" style="--d: 0.8s" cx="25" cy="36.5" r="1.8" />
+ <path class="accent draw" style="--d: 0.8s; --t: 0.35s" pathLength="1" d="M 28 66 L 36 73 L 52 56" />
+ <path class="soft" d="M 82 50 Q 110 18 140 46" />
+ <path class="stroke draw" style="--d: 1s; --t: 0.25s" pathLength="1" d="M 129 46 L 141 47 L 139 35" />
+ <g class="mark">
+ <circle class="accent draw" style="--d: 0.35s; --t: 0.6s" pathLength="1" cx="170" cy="60" r="22" />
+ <circle class="accent-soft draw" style="--d: 0.75s; --t: 0.45s" pathLength="1" cx="170" cy="60" r="12" />
+ </g>
+ </g>
+ </svg>
<h1>Opening Cap</h1>
- <p>If Cap does not open automatically, try the button below. Browser fallback will start in a moment.</p>
+ <p class="lede">You're signed in. Cap should open in a moment and pick up right where you left off.</p>
<div class="actions">
- <button id="open-cap" type="button">Open Cap</button>
- <a id="browser-fallback" href="${fallbackHref}">Use browser fallback</a>
+ <button id="open-cap" class="cta" type="button">Open Cap</button>
+ <a id="browser-fallback" class="cta ghost" href="${fallbackHref}">Finish in browser</a>
</div>
- <p id="status">Trying the desktop app first...</p>
+ <p class="status">
+ <svg viewBox="0 0 44 12" aria-hidden="true"><path class="soft" d="M 2 6 q 3 -4 6 0 t 6 0 t 6 0 t 6 0 t 6 0 t 6 0 t 6 0" /></svg>
+ <span id="status" role="status">Waiting for Cap to open</span>
+ </p>
</main>
+ <footer>Don't have the app yet? <a href="/download">Download Cap</a></footer>
<script>
const { primaryUrl, fallbackUrl } = ${state};
const status = document.getElementById("status");
@@ -157,12 +412,12 @@ export function createDesktopRedirectPage(
const startFallback = () => {
if (fallbackStarted) return;
fallbackStarted = true;
- status.textContent = "Switching to the browser fallback...";
+ status.textContent = "Finishing sign-in in your browser";
window.location.replace(fallbackUrl);
};
const openCap = () => {
- status.textContent = "Trying to open the Cap desktop app...";
+ status.textContent = "Waiting for Cap to open";
window.location.href = primaryUrl;
};