Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

feat(cli): polish the OAuth callback page

kashorin7a2c694740ba
diff --git a/packages/cli/src/oauth.ts b/packages/cli/src/oauth.ts
index b97f141d..6b827677 100644
--- a/packages/cli/src/oauth.ts
+++ b/packages/cli/src/oauth.ts
@@ -7,6 +7,8 @@ import { encodeOAuth2Credential } from "@hypit/runtime";
import type { CliIo } from "./output.js";
+const CALLBACK_MARK_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" aria-hidden="true"><path d="M7.6 3.8H14.6L12.6 7.2H5.6L7.6 3.8Z" fill="currentColor"/><path d="M4.1 10.4H16.6L18.7 7H30.4L27.9 11.1H16.1L14.1 14.2H1.8L4.1 10.4Z" fill="currentColor"/><path d="M19.1 14.1H23.1L19.3 20.7H15.4L19.1 14.1Z" fill="currentColor"/></svg>`;
+
function base64url(bytes: Uint8Array): string {
return Buffer.from(bytes).toString("base64").replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/u, "");
}
@@ -131,9 +133,64 @@ function callbackPage(success: boolean): string {
? "Your credential is ready. You can close this window."
: "The sign-in could not be completed. You can close this window and try again.";
const tone = success ? "success" : "error";
+ const favicon = `data:image/svg+xml,${encodeURIComponent(CALLBACK_MARK_SVG)}`;
return `<!doctype html>
-<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
-<meta name="color-scheme" content="dark"><title>${title}</title><style>
-:root{color-scheme:dark;font-family:ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}body{margin:0;min-height:100vh;display:grid;place-items:center;color:#f7f2f4;background:#111114}main{width:min(100% - 40px,460px);padding:42px 38px 36px;border:1px solid #3a3036;background:#19171b}.brand{color:#ed98b9;font-weight:700}.mark{margin:34px 0 24px;color:#ed98b9}.mark.error{color:#f08d86}h1{margin:0;font-size:32px}p{color:#bdb3b8;line-height:1.6}
-</style></head><body><main><div class="brand">HYPIT</div><div class="mark ${tone}">${success ? "✓" : "×"}</div><h1>${heading}</h1><p>${message}</p></main></body></html>`;
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="color-scheme" content="light dark">
+ <link rel="icon" href="${favicon}">
+ <title>${title}</title>
+ <style>
+ :root {
+ color-scheme: light dark;
+ --accent: #de3b67;
+ --ink: #1b1a18;
+ --muted: #6b6963;
+ --line: #e5e2dd;
+ --paper: #fff;
+ --gutter: 80px;
+ --bad: #b8352a;
+ font-family: "Hanken Grotesk", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
+ }
+ * { box-sizing: border-box; }
+ html { min-width: 320px; }
+ body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
+ .site-header { height: 64px; flex: 0 0 64px; border-bottom: 1px solid var(--line); }
+ .shell { width: 100%; max-width: 1440px; height: 100%; margin: 0 auto; padding-inline: var(--gutter); display: flex; align-items: center; }
+ .brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 20px; font-weight: 650; letter-spacing: -.04em; }
+ .brand svg { width: 28px; height: 28px; color: var(--accent); }
+ main { flex: 1 1 auto; display: grid; place-items: center; padding: clamp(64px, 11vh, 144px) var(--gutter) clamp(72px, 12vh, 160px); }
+ .hero { width: min(100%, 720px); text-align: center; }
+ .status { display: flex; justify-content: center; margin-bottom: 28px; color: var(--accent); }
+ .status.error { color: var(--bad); }
+ .mark { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 8px; }
+ .mark svg { width: 32px; height: 32px; }
+ h1 { margin: 0; font-size: clamp(38px, 5vw, 62px); font-weight: 600; line-height: 1.18; letter-spacing: -2px; }
+ p { max-width: 540px; margin: 20px auto 0; color: var(--muted); font-size: clamp(17px, 1.6vw, 22px); line-height: 1.5; }
+ @media (prefers-color-scheme: dark) {
+ :root { --paper: #14110f; --ink: #e9e5db; --muted: #e9e5dba8; --line: #e9e5db1c; --accent: #de3c66; --bad: #ef8378; }
+ }
+ @media (max-width: 767px) { :root { --gutter: 20px; } main { padding-top: 64px; padding-bottom: 80px; } }
+ @media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
+ </style>
+ </head>
+ <body>
+ <header class="site-header">
+ <div class="shell"><div class="brand">${CALLBACK_MARK_SVG}<span>hypit</span></div></div>
+ </header>
+ <main>
+ <section class="hero" aria-labelledby="callback-heading">
+ <div class="status ${tone}">
+ <span class="mark" aria-hidden="true">
+ ${success ? '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m5 12 4 4L19 6"/></svg>' : '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><path d="M6 6 18 18M18 6 6 18"/></svg>'}
+ </span>
+ </div>
+ <h1 id="callback-heading">${heading}</h1>
+ <p>${message}</p>
+ </section>
+ </main>
+ </body>
+</html>`;
}