feat: high-fidelity callback page — animated check, glass card, agos.stuffle.ai links
Revamped login callback HTML with animated mesh background, floating particles, SVG animated checkmark/X, glass-morphism card, countdown progress bar, auto-close timer, and proper link hierarchy (agos.stuffle.ai). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
329
cli/agos.py
329
cli/agos.py
@@ -229,77 +229,189 @@ _CALLBACK_SUCCESS_HTML = """<!DOCTYPE html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Agos — Logged in</title>
|
||||
<title>Agos \u2014 Signed in</title>
|
||||
<style>
|
||||
*, *::before, *::after {{ box-sizing: border-box; margin: 0; padding: 0; }}
|
||||
|
||||
body {{
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
background: #0f1117;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
background: #07080d;
|
||||
color: #e2e8f0;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}}
|
||||
.card {{
|
||||
background: #1a1d27;
|
||||
border: 1px solid #2d3148;
|
||||
border-radius: 16px;
|
||||
padding: 48px 40px 40px;
|
||||
max-width: 440px;
|
||||
width: 90%;
|
||||
text-align: center;
|
||||
box-shadow: 0 24px 64px rgba(0,0,0,0.5);
|
||||
|
||||
/* ---- animated mesh background ---- */
|
||||
body::before {{
|
||||
content: "";
|
||||
position: fixed; inset: 0;
|
||||
background:
|
||||
radial-gradient(ellipse 60% 50% at 20% 30%, rgba(99,102,241,.12) 0%, transparent 70%),
|
||||
radial-gradient(ellipse 50% 60% at 80% 70%, rgba(139,92,246,.10) 0%, transparent 70%),
|
||||
radial-gradient(ellipse 40% 40% at 50% 50%, rgba(56,189,248,.06) 0%, transparent 60%);
|
||||
animation: drift 12s ease-in-out infinite alternate;
|
||||
z-index: 0;
|
||||
}}
|
||||
.icon {{
|
||||
width: 64px; height: 64px;
|
||||
background: linear-gradient(135deg, #6366f1, #8b5cf6);
|
||||
@keyframes drift {{
|
||||
0% {{ transform: translate(0, 0) scale(1); }}
|
||||
50% {{ transform: translate(-3%, 2%) scale(1.05); }}
|
||||
100% {{ transform: translate(2%, -2%) scale(1); }}
|
||||
}}
|
||||
|
||||
/* ---- floating particles ---- */
|
||||
.particles {{
|
||||
position: fixed; inset: 0; z-index: 0; pointer-events: none;
|
||||
}}
|
||||
.particles span {{
|
||||
position: absolute;
|
||||
width: 3px; height: 3px;
|
||||
border-radius: 50%;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
margin: 0 auto 24px;
|
||||
font-size: 28px;
|
||||
background: rgba(139,92,246,.35);
|
||||
animation: float linear infinite;
|
||||
}}
|
||||
h1 {{ font-size: 22px; font-weight: 700; color: #f1f5f9; margin-bottom: 8px; }}
|
||||
.subtitle {{ font-size: 14px; color: #94a3b8; margin-bottom: 32px; }}
|
||||
.user {{ font-size: 13px; color: #6366f1; background: #1e2035; border-radius: 8px;
|
||||
padding: 10px 16px; margin-bottom: 28px; font-weight: 500; }}
|
||||
.links {{
|
||||
.particles span:nth-child(1) {{ left:12%; top:80%; animation-duration:18s; animation-delay:0s; }}
|
||||
.particles span:nth-child(2) {{ left:30%; top:90%; animation-duration:22s; animation-delay:2s; width:2px; height:2px; background:rgba(99,102,241,.3); }}
|
||||
.particles span:nth-child(3) {{ left:55%; top:85%; animation-duration:16s; animation-delay:4s; }}
|
||||
.particles span:nth-child(4) {{ left:75%; top:95%; animation-duration:20s; animation-delay:1s; width:4px; height:4px; background:rgba(56,189,248,.2); }}
|
||||
.particles span:nth-child(5) {{ left:90%; top:88%; animation-duration:24s; animation-delay:3s; width:2px; height:2px; }}
|
||||
.particles span:nth-child(6) {{ left:5%; top:75%; animation-duration:19s; animation-delay:5s; width:2px; height:2px; background:rgba(56,189,248,.25); }}
|
||||
@keyframes float {{
|
||||
0% {{ transform: translateY(0) scale(1); opacity:.6; }}
|
||||
50% {{ opacity:1; }}
|
||||
100% {{ transform: translateY(-100vh) scale(.5); opacity:0; }}
|
||||
}}
|
||||
|
||||
/* ---- card ---- */
|
||||
.card {{
|
||||
position: relative; z-index: 1;
|
||||
background: rgba(15,17,26,.82);
|
||||
backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
|
||||
border: 1px solid rgba(99,102,241,.18);
|
||||
border-radius: 20px;
|
||||
padding: 52px 44px 44px;
|
||||
max-width: 460px; width: 92%;
|
||||
text-align: center;
|
||||
box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 32px 80px rgba(0,0,0,.55);
|
||||
animation: cardIn .6s cubic-bezier(.16,1,.3,1) both;
|
||||
}}
|
||||
@keyframes cardIn {{
|
||||
0% {{ opacity: 0; transform: translateY(24px) scale(.97); }}
|
||||
100% {{ opacity: 1; transform: translateY(0) scale(1); }}
|
||||
}}
|
||||
|
||||
/* ---- check icon ---- */
|
||||
.check-ring {{
|
||||
width: 72px; height: 72px; margin: 0 auto 28px;
|
||||
position: relative;
|
||||
}}
|
||||
.check-ring svg {{
|
||||
width: 72px; height: 72px;
|
||||
}}
|
||||
.check-ring .ring {{
|
||||
fill: none; stroke: url(#grad); stroke-width: 3;
|
||||
stroke-dasharray: 204; stroke-dashoffset: 204;
|
||||
animation: drawRing .7s .3s ease-out forwards;
|
||||
}}
|
||||
.check-ring .tick {{
|
||||
fill: none; stroke: #a5b4fc; stroke-width: 3.5;
|
||||
stroke-linecap: round; stroke-linejoin: round;
|
||||
stroke-dasharray: 30; stroke-dashoffset: 30;
|
||||
animation: drawTick .4s .9s ease-out forwards;
|
||||
}}
|
||||
@keyframes drawRing {{ to {{ stroke-dashoffset: 0; }} }}
|
||||
@keyframes drawTick {{ to {{ stroke-dashoffset: 0; }} }}
|
||||
|
||||
h1 {{
|
||||
font-size: 24px; font-weight: 700; color: #f1f5f9;
|
||||
margin-bottom: 6px;
|
||||
animation: fadeUp .5s .4s ease both;
|
||||
}}
|
||||
.subtitle {{
|
||||
font-size: 14px; color: #94a3b8; line-height: 1.5;
|
||||
margin-bottom: 32px;
|
||||
animation: fadeUp .5s .55s ease both;
|
||||
}}
|
||||
@keyframes fadeUp {{
|
||||
0% {{ opacity:0; transform:translateY(8px); }}
|
||||
100% {{ opacity:1; transform:translateY(0); }}
|
||||
}}
|
||||
|
||||
/* ---- progress bar (auto-close countdown) ---- */
|
||||
.countdown-bar {{
|
||||
height: 3px; border-radius: 2px; margin: 0 20px 28px;
|
||||
background: rgba(99,102,241,.15); overflow: hidden;
|
||||
animation: fadeUp .5s .6s ease both;
|
||||
}}
|
||||
.countdown-bar .fill {{
|
||||
height: 100%; width: 100%; border-radius: 2px;
|
||||
background: linear-gradient(90deg, #6366f1, #8b5cf6);
|
||||
animation: shrink {close_seconds}s .8s linear forwards;
|
||||
}}
|
||||
@keyframes shrink {{ to {{ width: 0%; }} }}
|
||||
|
||||
.close-note {{
|
||||
font-size: 12px; color: #475569; margin-bottom: 28px;
|
||||
animation: fadeUp .5s .65s ease both;
|
||||
}}
|
||||
|
||||
/* ---- CTA link ---- */
|
||||
.cta {{
|
||||
display: inline-flex; align-items: center; gap: 6px;
|
||||
font-size: 14px; font-weight: 600; color: #a5b4fc;
|
||||
text-decoration: none; padding: 10px 0;
|
||||
transition: color .2s;
|
||||
animation: fadeUp .5s .7s ease both;
|
||||
}}
|
||||
.cta:hover {{ color: #c4b5fd; }}
|
||||
.cta svg {{ width:16px; height:16px; transition: transform .2s; }}
|
||||
.cta:hover svg {{ transform: translateX(3px); }}
|
||||
|
||||
/* ---- footer links ---- */
|
||||
.footer {{
|
||||
display: flex; justify-content: center; gap: 20px;
|
||||
flex-wrap: wrap; margin-bottom: 28px;
|
||||
margin-top: 24px; padding-top: 20px;
|
||||
border-top: 1px solid rgba(255,255,255,.06);
|
||||
animation: fadeUp .5s .8s ease both;
|
||||
}}
|
||||
.links a {{
|
||||
font-size: 13px; color: #64748b; text-decoration: none;
|
||||
transition: color 0.2s;
|
||||
.footer a {{
|
||||
font-size: 12px; color: #475569; text-decoration: none;
|
||||
transition: color .2s;
|
||||
}}
|
||||
.links a:hover {{ color: #6366f1; }}
|
||||
.visit-btn {{
|
||||
display: inline-block;
|
||||
background: linear-gradient(135deg, #6366f1, #8b5cf6);
|
||||
color: #fff; font-size: 14px; font-weight: 600;
|
||||
padding: 12px 28px; border-radius: 8px; text-decoration: none;
|
||||
transition: opacity 0.2s;
|
||||
}}
|
||||
.visit-btn:hover {{ opacity: 0.85; }}
|
||||
.close-note {{ font-size: 12px; color: #475569; margin-top: 20px; }}
|
||||
.footer a:hover {{ color: #94a3b8; }}
|
||||
</style>
|
||||
<script>
|
||||
// Auto-close after 4 seconds
|
||||
setTimeout(function() {{ window.close(); }}, 4000);
|
||||
setTimeout(function() {{ window.close(); }}, {close_ms});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="particles"><span></span><span></span><span></span><span></span><span></span><span></span></div>
|
||||
<div class="card">
|
||||
<div class="icon">✓</div>
|
||||
<h1>You're logged in to Agos</h1>
|
||||
<p class="subtitle">Authentication successful. Return to your terminal.</p>
|
||||
{user_block}
|
||||
<a class="visit-btn" href="https://agos.armco.dev" target="_blank">Open Agos →</a>
|
||||
<div class="links" style="margin-top:20px">
|
||||
<a href="https://agos.armco.dev/docs" target="_blank">Docs</a>
|
||||
<a href="https://agos.armco.dev/privacy" target="_blank">Privacy</a>
|
||||
<a href="https://agos.armco.dev/terms" target="_blank">Terms</a>
|
||||
<div class="check-ring">
|
||||
<svg viewBox="0 0 72 72">
|
||||
<defs><linearGradient id="grad" x1="0" y1="0" x2="1" y2="1">
|
||||
<stop offset="0%" stop-color="#6366f1"/><stop offset="100%" stop-color="#8b5cf6"/>
|
||||
</linearGradient></defs>
|
||||
<circle class="ring" cx="36" cy="36" r="32.5"/>
|
||||
<polyline class="tick" points="22,37 32,47 50,27"/>
|
||||
</svg>
|
||||
</div>
|
||||
<h1>You\u2019re signed in</h1>
|
||||
<p class="subtitle">You may close this tab and return to your terminal.</p>
|
||||
<div class="countdown-bar"><div class="fill"></div></div>
|
||||
<p class="close-note">Auto-closing in {close_seconds} seconds\u2026</p>
|
||||
<a class="cta" href="https://agos.stuffle.ai" target="_blank">
|
||||
Check out Agos
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M3 8h10M9 4l4 4-4 4"/></svg>
|
||||
</a>
|
||||
<div class="footer">
|
||||
<a href="https://agos.stuffle.ai/docs" target="_blank">Docs</a>
|
||||
<a href="https://agos.stuffle.ai/privacy" target="_blank">Privacy</a>
|
||||
<a href="https://agos.stuffle.ai/terms" target="_blank">Terms</a>
|
||||
</div>
|
||||
<p class="close-note">This tab will close automatically in a few seconds.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>"""
|
||||
@@ -309,44 +421,112 @@ _CALLBACK_ERROR_HTML = """<!DOCTYPE html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Agos — Login failed</title>
|
||||
<title>Agos \u2014 Login failed</title>
|
||||
<style>
|
||||
*, *::before, *::after {{ box-sizing: border-box; margin: 0; padding: 0; }}
|
||||
|
||||
body {{
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
background: #0f1117; color: #e2e8f0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
background: #07080d; color: #e2e8f0;
|
||||
min-height: 100vh;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
overflow: hidden; position: relative;
|
||||
}}
|
||||
body::before {{
|
||||
content: "";
|
||||
position: fixed; inset: 0;
|
||||
background:
|
||||
radial-gradient(ellipse 50% 50% at 30% 40%, rgba(239,68,68,.08) 0%, transparent 70%),
|
||||
radial-gradient(ellipse 50% 50% at 70% 60%, rgba(185,28,28,.06) 0%, transparent 70%);
|
||||
animation: drift 12s ease-in-out infinite alternate;
|
||||
z-index: 0;
|
||||
}}
|
||||
@keyframes drift {{
|
||||
0% {{ transform: translate(0, 0) scale(1); }}
|
||||
100% {{ transform: translate(2%, -2%) scale(1.03); }}
|
||||
}}
|
||||
|
||||
.card {{
|
||||
background: #1a1d27; border: 1px solid #3f2d2d;
|
||||
border-radius: 16px; padding: 48px 40px 40px;
|
||||
max-width: 440px; width: 90%; text-align: center;
|
||||
box-shadow: 0 24px 64px rgba(0,0,0,0.5);
|
||||
position: relative; z-index: 1;
|
||||
background: rgba(15,17,26,.82);
|
||||
backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
|
||||
border: 1px solid rgba(239,68,68,.15);
|
||||
border-radius: 20px;
|
||||
padding: 52px 44px 44px;
|
||||
max-width: 460px; width: 92%;
|
||||
text-align: center;
|
||||
box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 32px 80px rgba(0,0,0,.55);
|
||||
animation: cardIn .6s cubic-bezier(.16,1,.3,1) both;
|
||||
}}
|
||||
.icon {{
|
||||
width: 64px; height: 64px; background: #7f1d1d;
|
||||
border-radius: 50%; display: flex; align-items: center; justify-content: center;
|
||||
margin: 0 auto 24px; font-size: 28px;
|
||||
@keyframes cardIn {{
|
||||
0% {{ opacity: 0; transform: translateY(24px) scale(.97); }}
|
||||
100% {{ opacity: 1; transform: translateY(0) scale(1); }}
|
||||
}}
|
||||
h1 {{ font-size: 22px; font-weight: 700; color: #fca5a5; margin-bottom: 8px; }}
|
||||
.subtitle {{ font-size: 14px; color: #94a3b8; margin-bottom: 24px; }}
|
||||
.error {{ font-size: 13px; color: #f87171; background: #1e1010;
|
||||
border-radius: 8px; padding: 10px 16px; margin-bottom: 24px; }}
|
||||
.retry-btn {{
|
||||
display: inline-block; background: #374151; color: #e2e8f0;
|
||||
font-size: 14px; font-weight: 600; padding: 12px 28px; border-radius: 8px;
|
||||
text-decoration: none;
|
||||
|
||||
.err-icon {{
|
||||
width: 72px; height: 72px; margin: 0 auto 28px; position: relative;
|
||||
}}
|
||||
.err-icon svg {{ width: 72px; height: 72px; }}
|
||||
.err-icon .ring {{
|
||||
fill: none; stroke: #ef4444; stroke-width: 3;
|
||||
stroke-dasharray: 204; stroke-dashoffset: 204;
|
||||
animation: drawRing .7s .3s ease-out forwards;
|
||||
}}
|
||||
.err-icon .x1, .err-icon .x2 {{
|
||||
fill: none; stroke: #fca5a5; stroke-width: 3.5;
|
||||
stroke-linecap: round;
|
||||
stroke-dasharray: 22; stroke-dashoffset: 22;
|
||||
}}
|
||||
.err-icon .x1 {{ animation: drawTick .35s .85s ease-out forwards; }}
|
||||
.err-icon .x2 {{ animation: drawTick .35s .95s ease-out forwards; }}
|
||||
@keyframes drawRing {{ to {{ stroke-dashoffset: 0; }} }}
|
||||
@keyframes drawTick {{ to {{ stroke-dashoffset: 0; }} }}
|
||||
|
||||
h1 {{
|
||||
font-size: 24px; font-weight: 700; color: #fca5a5; margin-bottom: 8px;
|
||||
animation: fadeUp .5s .4s ease both;
|
||||
}}
|
||||
.subtitle {{
|
||||
font-size: 14px; color: #94a3b8; margin-bottom: 24px;
|
||||
animation: fadeUp .5s .5s ease both;
|
||||
}}
|
||||
@keyframes fadeUp {{
|
||||
0% {{ opacity:0; transform:translateY(8px); }}
|
||||
100% {{ opacity:1; transform:translateY(0); }}
|
||||
}}
|
||||
|
||||
.error-detail {{
|
||||
font-family: "SF Mono", Menlo, Consolas, monospace;
|
||||
font-size: 13px; color: #f87171; background: rgba(127,29,29,.18);
|
||||
border: 1px solid rgba(239,68,68,.15);
|
||||
border-radius: 10px; padding: 14px 18px; margin-bottom: 28px;
|
||||
animation: fadeUp .5s .6s ease both;
|
||||
word-break: break-word;
|
||||
}}
|
||||
|
||||
.hint {{
|
||||
font-size: 13px; color: #64748b;
|
||||
animation: fadeUp .5s .7s ease both;
|
||||
}}
|
||||
.hint code {{
|
||||
background: rgba(99,102,241,.12); color: #a5b4fc;
|
||||
padding: 2px 7px; border-radius: 4px; font-size: 12px;
|
||||
}}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="card">
|
||||
<div class="icon">✗</div>
|
||||
<div class="err-icon">
|
||||
<svg viewBox="0 0 72 72">
|
||||
<circle class="ring" cx="36" cy="36" r="32.5"/>
|
||||
<line class="x1" x1="26" y1="26" x2="46" y2="46"/>
|
||||
<line class="x2" x1="46" y1="26" x2="26" y2="46"/>
|
||||
</svg>
|
||||
</div>
|
||||
<h1>Login failed</h1>
|
||||
<p class="subtitle">Something went wrong during authentication.</p>
|
||||
<div class="error">{error_detail}</div>
|
||||
<p style="font-size:13px;color:#64748b">Return to your terminal and run <code>agos login</code> to try again.</p>
|
||||
<div class="error-detail">{error_detail}</div>
|
||||
<p class="hint">Return to your terminal and run <code>agos login</code> to try again.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>"""
|
||||
@@ -369,9 +549,12 @@ def _start_callback_server(host, port, expected_state, timeout_seconds, correlat
|
||||
callback_payload['valid_state'] = callback_payload.get('state') == expected_state
|
||||
|
||||
success = callback_payload['valid_state'] and not callback_payload.get('error')
|
||||
_auto_close_sec = 5
|
||||
if success:
|
||||
user_block = '' # filled in post-token-exchange; safe placeholder
|
||||
body = _CALLBACK_SUCCESS_HTML.format(user_block=user_block)
|
||||
body = _CALLBACK_SUCCESS_HTML.format(
|
||||
close_seconds=_auto_close_sec,
|
||||
close_ms=_auto_close_sec * 1000,
|
||||
)
|
||||
status = 200
|
||||
else:
|
||||
error_detail = (
|
||||
|
||||
Reference in New Issue
Block a user