| ... | @@ -1,4 +1,22 @@ | ... | @@ -1,4 +1,22 @@ |
| 1 | export function renderLoopbackAuthorizationCompleteHtml(): string { | 1 | export type LoopbackAuthorizationStage = "dev" | "nightly" | "latest"; |
| | 2 | |
| | 3 | declare const __T3CODE_BUILD_CHANNEL__: "nightly" | "latest" | undefined; |
| | 4 | |
| | 5 | export function resolveLoopbackAuthorizationStage(): LoopbackAuthorizationStage { |
| | 6 | return typeof __T3CODE_BUILD_CHANNEL__ === "undefined" ? "dev" : __T3CODE_BUILD_CHANNEL__; |
| | 7 | } |
| | 8 | |
| | 9 | const stageBrands = { |
| | 10 | dev: "T3 Code (Dev)", |
| | 11 | nightly: "T3 Code (Nightly)", |
| | 12 | latest: "T3 Code", |
| | 13 | } as const satisfies Record<LoopbackAuthorizationStage, string>; |
| | 14 | |
| | 15 | export function renderLoopbackAuthorizationCompleteHtml( |
| | 16 | stage: LoopbackAuthorizationStage = resolveLoopbackAuthorizationStage(), |
| | 17 | ): string { |
| | 18 | const stageBrand = stageBrands[stage]; |
| | 19 | |
| 2 | return `<!doctype html> | 20 | return `<!doctype html> |
| 3 | <html lang="en"> | 21 | <html lang="en"> |
| 4 | <head> | 22 | <head> |
| ... | @@ -38,9 +56,16 @@ export function renderLoopbackAuthorizationCompleteHtml(): string { | ... | @@ -38,9 +56,16 @@ export function renderLoopbackAuthorizationCompleteHtml(): string { |
| 38 | overflow: hidden; | 56 | overflow: hidden; |
| 39 | padding: 22px 24px; | 57 | padding: 22px 24px; |
| 40 | color: white; | 58 | color: white; |
| | 59 | } |
| | 60 | .stage-latest { |
| | 61 | background: |
| | 62 | radial-gradient(circle at 76% 18%, rgba(136, 204, 255, 0.52), transparent 38%), |
| | 63 | linear-gradient(135deg, #2468df, #172f82); |
| | 64 | } |
| | 65 | .stage-dev { |
| 41 | background: linear-gradient(145deg, #5ab8fa 0%, #347ff8 46%, #1939bd 100%); | 66 | background: linear-gradient(145deg, #5ab8fa 0%, #347ff8 46%, #1939bd 100%); |
| 42 | } | 67 | } |
| 43 | .stage::before { | 68 | .stage-dev::before { |
| 44 | content: ""; | 69 | content: ""; |
| 45 | position: absolute; | 70 | position: absolute; |
| 46 | inset: 0; | 71 | inset: 0; |
| ... | @@ -52,6 +77,22 @@ export function renderLoopbackAuthorizationCompleteHtml(): string { | ... | @@ -52,6 +77,22 @@ export function renderLoopbackAuthorizationCompleteHtml(): string { |
| 52 | linear-gradient(90deg, rgba(234, 246, 255, 0.12) 1px, transparent 1px); | 77 | linear-gradient(90deg, rgba(234, 246, 255, 0.12) 1px, transparent 1px); |
| 53 | background-size: 32px 32px, 32px 32px, 8px 8px, 8px 8px; | 78 | background-size: 32px 32px, 32px 32px, 8px 8px, 8px 8px; |
| 54 | } | 79 | } |
| | 80 | .stage-nightly { |
| | 81 | background: |
| | 82 | radial-gradient(22rem 8rem at 78% 18%, rgba(81, 101, 216, 0.42), transparent 58%), |
| | 83 | linear-gradient(145deg, #07152f 0%, #151443 52%, #32155b 100%); |
| | 84 | } |
| | 85 | .stage-nightly::before { |
| | 86 | content: ""; |
| | 87 | position: absolute; |
| | 88 | inset: 0; |
| | 89 | opacity: 0.78; |
| | 90 | background-image: |
| | 91 | radial-gradient(circle at 12px 12px, rgba(228, 234, 255, 0.9) 0 1px, transparent 1.5px), |
| | 92 | radial-gradient(circle at 38px 28px, rgba(228, 234, 255, 0.58) 0 0.8px, transparent 1.3px), |
| | 93 | radial-gradient(circle at 58px 9px, rgba(200, 215, 255, 0.72) 0 0.9px, transparent 1.4px); |
| | 94 | background-size: 72px 48px, 96px 64px, 128px 56px; |
| | 95 | } |
| 55 | .stage::after { | 96 | .stage::after { |
| 56 | content: ""; | 97 | content: ""; |
| 57 | position: absolute; | 98 | position: absolute; |
| ... | @@ -63,6 +104,10 @@ export function renderLoopbackAuthorizationCompleteHtml(): string { | ... | @@ -63,6 +104,10 @@ export function renderLoopbackAuthorizationCompleteHtml(): string { |
| 63 | .stage-content { | 104 | .stage-content { |
| 64 | position: relative; | 105 | position: relative; |
| 65 | z-index: 1; | 106 | z-index: 1; |
| | 107 | height: 100%; |
| | 108 | display: flex; |
| | 109 | align-items: center; |
| | 110 | justify-content: space-between; |
| 66 | } | 111 | } |
| 67 | .brand { | 112 | .brand { |
| 68 | margin: 0; | 113 | margin: 0; |
| ... | @@ -73,21 +118,6 @@ export function renderLoopbackAuthorizationCompleteHtml(): string { | ... | @@ -73,21 +118,6 @@ export function renderLoopbackAuthorizationCompleteHtml(): string { |
| 73 | } | 118 | } |
| 74 | .brand { color: rgba(255, 255, 255, 0.82); } | 119 | .brand { color: rgba(255, 255, 255, 0.82); } |
| 75 | .content { padding: 30px 32px 34px; } | 120 | .content { padding: 30px 32px 34px; } |
| 76 | .status { | | |
| 77 | width: 42px; | | |
| 78 | height: 42px; | | |
| 79 | display: grid; | | |
| 80 | place-items: center; | | |
| 81 | margin-top: -52px; | | |
| 82 | margin-bottom: 22px; | | |
| 83 | border: 4px solid white; | | |
| 84 | border-radius: 50%; | | |
| 85 | background: #2065df; | | |
| 86 | color: white; | | |
| 87 | font-size: 22px; | | |
| 88 | font-weight: 700; | | |
| 89 | box-shadow: 0 8px 22px rgba(25, 72, 177, 0.3); | | |
| 90 | } | | |
| 91 | .eyebrow { | 121 | .eyebrow { |
| 92 | margin: 0 0 8px; | 122 | margin: 0 0 8px; |
| 93 | color: #2866cc; | 123 | color: #2866cc; |
| ... | @@ -98,41 +128,26 @@ export function renderLoopbackAuthorizationCompleteHtml(): string { | ... | @@ -98,41 +128,26 @@ export function renderLoopbackAuthorizationCompleteHtml(): string { |
| 98 | } | 128 | } |
| 99 | h1 { margin: 0; font-size: clamp(26px, 5vw, 34px); line-height: 1.12; letter-spacing: -0.035em; } | 129 | h1 { margin: 0; font-size: clamp(26px, 5vw, 34px); line-height: 1.12; letter-spacing: -0.035em; } |
| 100 | .description { margin: 12px 0 0; color: #646975; font-size: 15px; line-height: 1.6; } | 130 | .description { margin: 12px 0 0; color: #646975; font-size: 15px; line-height: 1.6; } |
| 101 | .next { | | |
| 102 | margin-top: 24px; | | |
| 103 | padding: 14px 16px; | | |
| 104 | border: 1px solid rgba(23, 25, 31, 0.1); | | |
| 105 | border-radius: 12px; | | |
| 106 | background: #f7f8fa; | | |
| 107 | color: #454a55; | | |
| 108 | font-size: 13px; | | |
| 109 | } | | |
| 110 | .next strong { color: #17191f; } | | |
| 111 | @media (prefers-color-scheme: dark) { | 131 | @media (prefers-color-scheme: dark) { |
| 112 | :root { background: #101115; color: #f1f3f7; } | 132 | :root { background: #101115; color: #f1f3f7; } |
| 113 | body { background: radial-gradient(48rem 22rem at 50% -8rem, rgba(55, 102, 210, 0.2), transparent), #101115; } | 133 | body { background: radial-gradient(48rem 22rem at 50% -8rem, rgba(55, 102, 210, 0.2), transparent), #101115; } |
| 114 | main { border-color: rgba(255, 255, 255, 0.1); background: rgba(25, 27, 33, 0.96); } | 134 | main { border-color: rgba(255, 255, 255, 0.1); background: rgba(25, 27, 33, 0.96); } |
| 115 | .status { border-color: #191b21; } | | |
| 116 | .eyebrow { color: #77a8ff; } | 135 | .eyebrow { color: #77a8ff; } |
| 117 | .description { color: #a8adb8; } | 136 | .description { color: #a8adb8; } |
| 118 | .next { border-color: rgba(255, 255, 255, 0.1); background: #20232a; color: #b9bec8; } | | |
| 119 | .next strong { color: #f1f3f7; } | | |
| 120 | } | 137 | } |
| 121 | </style> | 138 | </style> |
| 122 | </head> | 139 | </head> |
| 123 | <body> | 140 | <body> |
| 124 | <main> | 141 | <main> |
| 125 | <header class="stage"> | 142 | <header class="stage stage-${stage}" data-stage="${stage}"> |
| 126 | <div class="stage-content"> | 143 | <div class="stage-content"> |
| 127 | <p class="brand">T3 Code</p> | 144 | <p class="brand">${stageBrand}</p> |
| 128 | </div> | 145 | </div> |
| 129 | </header> | 146 | </header> |
| 130 | <section class="content"> | 147 | <section class="content"> |
| 131 | <div class="status" aria-hidden="true">✓</div> | | |
| 132 | <p class="eyebrow">Browser authorization complete</p> | 148 | <p class="eyebrow">Browser authorization complete</p> |
| 133 | <h1>You're connected</h1> | 149 | <h1>You're connected</h1> |
| 134 | <p class="description">The authorization code was delivered securely to your waiting terminal.</p> | 150 | <p class="description">Return to your terminal to finish setting up T3 Connect. You can close this window.</p> |
| 135 | <div class="next"><strong>Next:</strong> return to the terminal to finish T3 Connect setup. You can close this window.</div> | | |
| 136 | </section> | 151 | </section> |
| 137 | </main> | 152 | </main> |
| 138 | </body> | 153 | </body> |