forked from Jakubantalik/transitions.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivate.html
More file actions
549 lines (513 loc) · 23.6 KB
/
Copy pathactivate.html
File metadata and controls
549 lines (513 loc) · 23.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noindex" />
<title>Sign in · Transitions.dev</title>
<!--
Sign-in / activation page (Figma 2330:2552 "Sign in" + 2330:2712 input states).
Entry points:
• Plain sign-in: /activate.html
• Checkout return: /activate.html?checkout=success&session_id=...
• Device activate: /activate.html?code=WXYZ-WXYZ (from `npx transitions-pro skill` / `add --pro`)
Redirect states from the API's magic-link callback:
?signed_in=1 · ?device=approved · ?device=denied · ?error=link_invalid
-->
<link rel="preload" href="assets/fonts/Saans-Medium.woff2" as="font" type="font/woff2" crossorigin />
<style>
@font-face {
font-family: "Saans";
src: url("assets/fonts/Saans-Medium.woff2") format("woff2"),
url("assets/fonts/Saans-Medium.woff") format("woff");
font-weight: 500;
font-style: normal;
font-display: optional;
}
:root {
--bg: #fdfdfd;
--text: #0d0d0d;
--muted: #8a8a8a;
--text-muted: #6c6c6c;
--text-faint: #8f8f8f;
--text-footer-name: #4a4a4a;
--font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
Roboto, Helvetica, Arial, sans-serif;
/* transitions.dev motion tokens (subset used here). */
--ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
--duration-fast: 250ms;
/* error-state-shake tokens (12-error-state-shake) */
--shake-distance: 6px;
--shake-overshoot: 4px;
--shake-dur-a: 80ms;
--shake-dur-b: 60ms;
--shake-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
html[data-theme="dark"] {
--bg: #0f0f10;
--text: #f2f2f2;
--muted: #9a9a9a;
--text-muted: rgba(202, 202, 202, 0.7);
--text-faint: #8f8f8f;
--text-footer-name: #e9e9e9;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
background: var(--bg);
color: var(--text);
font-family: var(--font-sans);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
min-height: 100vh;
}
/* Back button — circular tertiary (top-left in the design). */
.back-btn {
position: fixed;
top: 16px;
left: 16px;
width: 36px;
height: 36px;
display: inline-flex;
align-items: center;
justify-content: center;
border: 0;
border-radius: 50px;
background: rgba(0, 0, 0, 0.03);
color: var(--text);
cursor: pointer;
text-decoration: none;
}
.back-btn:hover { background: rgba(0, 0, 0, 0.06); }
html[data-theme="dark"] .back-btn { background: rgba(255, 255, 255, 0.06); }
/* Scale on press (0.96) — tactile feedback. */
.back-btn { transition: background 120ms ease, scale 120ms var(--ease-smooth-out); }
.back-btn:active { scale: 0.96; }
/* Extend the 36px control to a 44px touch target without changing its look. */
.back-btn::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; }
.page {
display: flex;
flex-direction: column;
align-items: center;
padding: 64px 20px 96px;
min-height: 100vh;
}
/* Brand cube icon — identical to skill.html / pro.html hero (136×140,
assets/icon light 2x.png / icon-dark-2x.png, theme-swapped + hover). */
.header-icon-wrap {
position: relative;
width: 136px;
height: 140px;
margin-top: -43px;
margin-bottom: -27px;
overflow: visible;
}
.header-icon-img {
position: absolute;
left: 0;
top: 0;
width: 136px;
height: 140px;
display: block;
user-select: none;
transform-origin: center;
transition:
filter 0.5s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (hover: hover) {
.header-icon-wrap:hover .header-icon-img {
filter: hue-rotate(60deg) saturate(1.6);
transform: rotate(8deg) scale(1.06);
}
}
html[data-theme="dark"] .header-icon-img--light,
html:not([data-theme="dark"]) .header-icon-img--dark { display: none; }
html:not([data-theme="dark"]) .header-icon-img--light,
html[data-theme="dark"] .header-icon-img--dark { display: block; }
.page-title {
margin: 0 0 30px;
font-family: "Saans", var(--font-sans);
font-weight: 500;
font-size: 36px;
line-height: 42px;
letter-spacing: -0.18px;
color: var(--text);
text-align: center;
text-wrap: balance;
}
/* Sign-in card (Figma 2330:2574): 369px, r24, p20, ring shadows. */
.signin-card {
position: relative;
width: min(92vw, 369px);
background: #fff;
border-radius: 24px;
padding: 20px;
display: flex;
flex-direction: column;
gap: 24px;
box-shadow:
0 1px 3px rgba(0, 0, 0, 0.04),
inset 0 0 0 1px rgba(0, 0, 0, 0.06),
inset 0 -1px 0 0 rgba(0, 0, 0, 0.06),
inset 0 0 0 1px rgba(196, 196, 196, 0.1);
}
html[data-theme="dark"] .signin-card { background: #1b1b1d; }
.card-intro {
margin: 0;
font-size: 16px;
line-height: 24.2px;
color: var(--text);
text-wrap: pretty;
}
.card-intro .muted { color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; line-height: 1.4; color: #4d4d4d; }
html[data-theme="dark"] .field-label { color: #b5b5b5; }
/* Input states (Figma 2330:2712): default #dcdcdc 1px, focus #585858 1.5px,
error #e23014 1.5px + #d62b11 message. */
.field-input {
width: 100%;
height: 40px;
padding: 4px 4px 4px 12px;
font-family: inherit;
font-size: 13px;
line-height: 1.4;
color: #0f0f0f;
background: #fff;
border: 1px solid #dcdcdc;
border-radius: 60px;
outline: none;
transition: border-color 120ms ease;
}
.field-input::placeholder { color: #828282; }
.field-input:focus { border: 1.5px solid #585858; padding-left: 11.5px; }
.field-input.is-error,
.field-input.is-error:focus { border: 1.5px solid #e23014; padding-left: 11.5px; }
html[data-theme="dark"] .field-input { background: #151517; color: #f2f2f2; border-color: #3a3a3d; }
html[data-theme="dark"] .field-input:focus { border-color: #a5a5a5; }
html[data-theme="dark"] .field-input.is-error { border-color: #e23014; }
.field-error { margin: -2px 0 0; font-size: 13px; line-height: 1.4; color: #d62b11; }
/* Error-state-shake (transitions-dev 12): the field shakes on invalid submit.
Per-segment easing; %-stops are cumulative (80,60,80,60 = 280ms). */
.field-input { will-change: transform; }
.field-input.is-shaking {
animation: t-input-shake calc(var(--shake-dur-a) * 2 + var(--shake-dur-b) * 2) linear;
}
@keyframes t-input-shake {
0% { transform: translateX(0); animation-timing-function: var(--shake-ease); }
28.57% { transform: translateX(var(--shake-distance)); animation-timing-function: var(--shake-ease); }
57.14% { transform: translateX(calc(var(--shake-distance) * -1)); animation-timing-function: var(--shake-ease); }
78.57% { transform: translateX(var(--shake-overshoot)); animation-timing-function: var(--shake-ease); }
100% { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
.field-input { animation: none !important; transform: none !important; }
}
/* Primary pill button (Figma 2330:2584). */
.btn-primary {
width: 100%;
height: 40px;
border: 0;
border-radius: 26px;
background: #17181c;
color: #fff;
font-family: inherit;
font-size: 13px;
line-height: 13px;
font-weight: 500;
cursor: pointer;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.btn-primary[disabled] { opacity: 0.6; cursor: default; }
html[data-theme="dark"] .btn-primary { background: #f2f2f2; color: #111; }
/* Scale on press (0.96). */
.btn-primary { transition: scale 120ms var(--ease-smooth-out), opacity 120ms ease; }
.btn-primary:not([disabled]):active { scale: 0.96; }
.card-foot {
margin: 0;
font-size: 13px;
line-height: 16px;
color: #17181c;
}
.card-foot a { color: inherit; font-weight: 500; text-decoration: none; }
.card-foot a:hover { text-decoration: underline; }
html[data-theme="dark"] .card-foot { color: #e5e5e5; }
.card-note { margin: 0; font-size: 13px; line-height: 1.4; }
.card-note[data-kind="ok"] { color: #16a34a; }
.card-note[data-kind="err"] { color: #d62b11; }
.device-code {
font: 500 20px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
letter-spacing: 0.12em;
padding: 10px 14px;
border: 1px dashed #dcdcdc;
border-radius: 12px;
align-self: center;
}
html[data-theme="dark"] .device-code { border-color: #3a3a3d; }
/* Shared site footer (identical to pro.html / account.html). */
.brand-mark {
display: inline-flex; align-items: center; justify-content: center;
width: 24px; height: 24px; color: currentColor;
}
.brand-mark svg { width: 18px; height: 20.295px; display: block; }
.brand-word { font-size: 15px; font-weight: 500; line-height: 1; letter-spacing: -0.01em; white-space: nowrap; }
.brand-word-dim { color: var(--text-muted); }
.footer {
width: 100%; max-width: 1008px; margin: auto auto 0; padding: 112px 20px 40px;
font-family: var(--font-sans); font-size: 13px; line-height: 18.2px; text-align: left;
display: flex; flex-direction: column; gap: 25px; box-sizing: border-box;
}
.footer-top { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.footer-brand { display: flex; flex-direction: column; gap: 10px; max-width: 260px; }
.footer-brand-logo {
display: inline-flex; align-items: center; gap: 4px; opacity: 0.7;
text-decoration: none; color: var(--text);
transition: transform 400ms var(--ease-smooth-out), opacity 150ms ease; transform-origin: center;
}
.footer-brand-logo:hover { opacity: 1; transform: scale(1.02); }
.footer-brand-logo:hover .brand-mark { transform: rotate(60deg); transition: transform 400ms var(--ease-smooth-out); }
.footer-tagline { margin: 0; color: var(--text-muted); }
.footer-cols { display: flex; gap: 56px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col-title { margin: 0 0 2px; font-weight: 500; color: var(--text-muted); }
.footer-col a { color: var(--text-muted); text-decoration: none; transition: color 150ms var(--ease-smooth-out); }
.footer-col a:hover { color: var(--text); }
.footer-credit { margin: 0; }
.footer-muted { color: var(--text-faint); }
.footer-name { color: var(--text-footer-name); text-decoration: none; margin-left: 4px; }
.footer-name:hover { color: #0d0d0d; }
html[data-theme="dark"] .footer-name:hover { color: #ffffff; }
@media (max-width: 720px) {
.footer-top { flex-direction: column; gap: 32px; }
.footer-cols { gap: 40px; flex-wrap: wrap; row-gap: 32px; }
}
@media (prefers-reduced-motion: reduce) {
.footer-brand-logo { transition: opacity 150ms ease; }
.footer-brand-logo:hover, .footer-brand-logo:hover .brand-mark { transform: none; }
}
[hidden] { display: none !important; }
</style>
<script>
// Same theme bootstrap as the rest of the site (localStorage tdev:theme).
(function () {
try {
var pref = localStorage.getItem("tdev:theme");
var dark = pref === "dark" ||
(pref !== "light" && window.matchMedia("(prefers-color-scheme: dark)").matches);
if (dark) document.documentElement.setAttribute("data-theme", "dark");
} catch (e) {}
})();
</script>
</head>
<body>
<a class="back-btn" href="/" aria-label="Back to Transitions.dev">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12.5 8H3.5M3.5 8L7.5 4M3.5 8L7.5 12"/></svg>
</a>
<main class="page">
<div class="header-icon-wrap" aria-hidden="true">
<img class="header-icon-img header-icon-img--light" src="assets/icon%20light%202x.png" alt="" width="136" height="140" decoding="async" />
<img class="header-icon-img header-icon-img--dark" src="assets/icon-dark-2x.png?v=2" alt="" width="136" height="140" decoding="async" />
</div>
<h1 class="page-title" id="a-title">Welcome back</h1>
<div class="signin-card">
<p class="card-intro" id="a-desc">Enter your email you used at checkout.
<span class="muted">We’ll send you a sign-in link.</span></p>
<!-- Device code display (device flow) -->
<span class="device-code" id="a-code" hidden></span>
<!-- Sign-in form (email → magic link) -->
<form id="a-signin" novalidate>
<div class="field">
<label class="field-label" for="a-email">Your email</label>
<input class="field-input" type="email" id="a-email" placeholder="name@example.com"
autocomplete="email" />
<p class="field-error" id="a-email-error" role="alert" hidden>Please enter a valid email.</p>
</div>
<div style="height:24px"></div>
<button class="btn-primary" type="submit" id="a-signin-btn">Send login link</button>
</form>
<!-- Approve button (signed-in + device code present) -->
<button class="btn-primary" id="a-approve" hidden>Approve this device</button>
<!-- Manage / account actions (signed-in) -->
<button class="btn-primary" id="a-portal" hidden>Manage subscription</button>
<p class="card-note" id="a-note" role="status" hidden></p>
<p class="card-foot" id="a-foot">No access? <a href="pro.html">Get Pro</a></p>
</div>
<footer class="footer">
<div class="footer-top">
<div class="footer-brand">
<a class="footer-brand-logo" href="/" aria-label="Transitions.dev home">
<span class="brand-mark" aria-hidden="true">
<svg viewBox="0 0 18 20.2947" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 0L12.5409 1.99176L11.5604 3.73491L10 2.8572V5.14735H8V2.8572L6.43962 3.73491L5.45909 1.99176L9 0ZM14.3613 3.01571L18 5.0625V9.14735H16V7.3794L14.0359 8.51337L13.0359 6.78132L14.9804 5.65867L13.3807 4.75886L14.3613 3.01571ZM4.61925 4.75887L3.01961 5.65867L4.9641 6.78132L3.9641 8.51337L2 7.3794L2 9.14735H0L1.54972e-06 5.0625L3.63873 3.01572L4.61925 4.75887ZM2 11.1473V12.9153L3.9641 11.7813L4.9641 13.5134L3.01961 14.636L4.61925 15.5358L3.63873 17.279L3.57628e-07 15.2322V11.1473H2ZM18 11.1473V15.2322L14.3613 17.279L13.3807 15.5358L14.9804 14.636L13.0359 13.5134L14.0359 11.7813L16 12.9153V11.1473H18ZM10 15.1473V17.4375L11.5604 16.5598L12.5409 18.3029L9 20.2947L5.45908 18.3029L6.43961 16.5598L8 17.4375V15.1473H10Z" fill="currentColor"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.0981 9.51337L10 10.7247V13.1474H8V10.7247L5.90192 9.51337L6.90192 7.78132L9 8.99265L11.0981 7.78132L12.0981 9.51337Z" fill="currentColor"/>
</svg>
</span>
<span class="brand-word"><span class="brand-word-strong">Transitions</span><span class="brand-word-dim">.dev</span></span>
</a>
<p class="footer-tagline">Collection of the most essential UI transitions for web apps</p>
</div>
<nav class="footer-cols" aria-label="Footer">
<div class="footer-col">
<p class="footer-col-title">Site</p>
<a href="/">Home</a>
<a href="detail.html?t=card-resize">Transitions</a>
<a href="/skill.html">Skill</a>
<a href="/refine.html">Refine tool</a>
<a href="/pro.html">Get Pro</a>
</div>
<div class="footer-col">
<p class="footer-col-title">Docs</p>
<a href="/skill.html">Introduction</a>
<a href="/skill.html#installation">Installation</a>
<a href="/skill.html">Accessibility</a>
</div>
<div class="footer-col">
<p class="footer-col-title">Legal & Account</p>
<a href="/pro.html">Sign in</a>
<a href="/terms.html">Terms</a>
<a href="/privacy.html">Privacy</a>
<a href="mailto:jakubja@gmail.com">Contact</a>
</div>
</nav>
</div>
<p class="footer-credit"><span class="footer-muted">Created by</span><a class="footer-name" href="https://x.com/jakubantalik" target="_blank" rel="noopener noreferrer">Jakub Antalik</a></p>
</footer>
</main>
<script src="assets/pro-client.js?v=14" defer></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
var TP = window.TransitionsPro;
var q = new URLSearchParams(location.search);
var deviceCode = (q.get("code") || "").toUpperCase();
var inviteToken = q.get("invite") || "";
var el = function (id) { return document.getElementById(id); };
var title = el("a-title"), desc = el("a-desc"), note = el("a-note");
var codeEl = el("a-code");
var signinForm = el("a-signin"), emailInput = el("a-email"), signinBtn = el("a-signin-btn");
var emailError = el("a-email-error");
var approveBtn = el("a-approve"), portalBtn = el("a-portal");
function setNote(msg, kind) {
note.textContent = msg; note.hidden = !msg;
note.setAttribute("data-kind", kind || "");
}
function setIntro(main, mutedText) {
desc.textContent = main + " ";
if (mutedText) {
var m = document.createElement("span");
m.className = "muted";
m.textContent = mutedText;
desc.appendChild(m);
}
}
function setEmailError(on) {
emailInput.classList.toggle("is-error", on);
emailError.hidden = !on;
if (on) {
// Replay the shake from a clean baseline (remove → reflow → add).
emailInput.classList.remove("is-shaking");
void emailInput.offsetWidth;
emailInput.classList.add("is-shaking");
var shakeMs = 80 * 2 + 60 * 2;
setTimeout(function () { emailInput.classList.remove("is-shaking"); }, shakeMs + 20);
}
}
emailInput.addEventListener("input", function () { setEmailError(false); });
function show(node, on) { if (node) node.hidden = !on; }
// Redirect states from the magic-link callback.
if (q.get("error") === "link_invalid") setNote("That sign-in link was invalid or expired. Try again below.", "err");
if (q.get("device") === "approved") setNote("Device approved — you can return to your terminal.", "ok");
if (q.get("device") === "denied") setNote("This account doesn't have an active Pro plan, so the device wasn't approved.", "err");
if (deviceCode) { codeEl.textContent = deviceCode; show(codeEl, true); }
signinForm.addEventListener("submit", function (e) {
e.preventDefault();
var email = emailInput.value.trim();
if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(email)) { setEmailError(true); emailInput.focus(); return; }
setEmailError(false);
signinBtn.disabled = true; signinBtn.textContent = "Sending…";
TP.magicLink(email, deviceCode || null, inviteToken || null)
.then(function () { setNote("Check your email for a sign-in link.", "ok"); })
.catch(function () { setNote("Couldn't send the link. Please try again.", "err"); })
.finally(function () { signinBtn.disabled = false; signinBtn.textContent = "Send login link"; });
});
approveBtn.addEventListener("click", function () {
approveBtn.disabled = true;
TP.approveDevice(deviceCode).then(function (r) {
if (r && r.status === "approved") setNote("Device approved — return to your terminal.", "ok");
else setNote("Couldn't approve — your account may not have an active Pro plan.", "err");
}).catch(function () { setNote("Approval failed. Try again.", "err"); })
.finally(function () { approveBtn.disabled = false; });
});
portalBtn.addEventListener("click", function () { TP.portal(); });
// If arriving from a team invite, look up the team name + invited email.
var invitePreview = inviteToken
? TP.team.previewInvite(inviteToken).catch(function () { return { valid: false }; })
: Promise.resolve(null);
// Paint according to auth + context.
Promise.all([TP.refresh(), invitePreview]).then(function (res) {
var state = res[0];
var inv = res[1];
// ── Team invitation ──
if (inviteToken) {
if (!inv || !inv.valid) {
title.textContent = "Invitation not found";
setIntro("This invitation is invalid or has expired.", "Ask the team owner to send a new one.");
show(signinForm, false); show(el("a-foot"), false);
return;
}
if (state.authenticated) {
// Signed in already — accept directly.
show(signinForm, false);
title.textContent = "Join " + inv.team_name;
setIntro("Accepting your invitation…", "");
TP.team.accept(inviteToken).then(function (r) {
if (r && r.ok) {
setIntro("You've joined " + inv.team_name + ".", "Pro is now active on your account.");
setNote("Redirecting to your account…", "ok");
setTimeout(function () { location.href = "account.html?joined=1"; }, 900);
} else if (r && r.error === "email_mismatch") {
setIntro("This invite was sent to " + inv.email + ".", "Sign in with that email to accept.");
} else {
setNote("Couldn't accept the invitation. It may have expired.", "err");
}
});
} else {
title.textContent = "Join " + inv.team_name;
setIntro("You've been invited to " + inv.team_name + ".", "Sign in with " + inv.email + " to accept.");
emailInput.value = inv.email;
show(el("a-foot"), false);
}
return;
}
if (state.authenticated) {
show(signinForm, false);
if (deviceCode) {
title.textContent = "Approve device";
setIntro("Signed in as " + (state.email || "your account") + ".", "Approve this device to finish setup.");
show(approveBtn, true);
} else if (q.get("checkout") === "success") {
title.textContent = "You're all set";
setIntro("Payment received and you're signed in as " + (state.email || "your account") + ".", "");
show(portalBtn, state.pro);
show(el("a-foot"), false);
} else {
title.textContent = state.pro ? "Transitions Pro" : "Your account";
setIntro("Signed in as " + (state.email || "your account") + ".",
state.pro ? "Pro is active." : "No active Pro plan.");
show(portalBtn, state.pro);
if (state.pro) show(el("a-foot"), false);
}
} else {
if (q.get("checkout") === "success") {
title.textContent = "Payment received";
// Default intro copy already matches this state (Figma copy).
} else if (deviceCode) {
title.textContent = "Activate device";
setIntro("Sign in to approve this device.", "We'll email you a one-time link.");
}
}
});
});
</script>
</body>
</html>