Skip to content

Commit fde072c

Browse files
authored
feat: Redesign direct auth redirect screen (#3639)
Redesign direct auth redirect screen. # Changes - Replaced Caffeine light and dark logos with yellow bg logo. - Implement progress ring around logo. - Update auth redirect screen to match new design.
1 parent 26b82d9 commit fde072c

File tree

6 files changed

+95
-90
lines changed

6 files changed

+95
-90
lines changed

src/frontend/src/lib/components/ui/AuthorizeHeader.svelte

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,10 @@
3434
<img
3535
src={dapp.logoSrc}
3636
alt={`${dapp.name} logo`}
37-
class={[
38-
"h-16 max-w-50 object-contain",
39-
dapp.logoDarkSrc !== undefined && "dark:hidden",
40-
]}
37+
class={["h-20 max-w-50 object-contain"]}
4138
/>
42-
{#if dapp.logoDarkSrc !== undefined}
43-
<img
44-
src={dapp.logoDarkSrc}
45-
alt={`${dapp.name} logo`}
46-
class="hidden h-16 max-w-50 object-contain dark:block"
47-
aria-hidden="true"
48-
/>
49-
{/if}
5039
{:else}
51-
<div class="flex size-16 items-center justify-center" aria-hidden="true">
40+
<div class="flex size-20 items-center justify-center" aria-hidden="true">
5241
<GlobeIcon class="size-6" />
5342
</div>
5443
{/if}
Lines changed: 1 addition & 7 deletions
Loading

src/frontend/src/lib/icons/caffeine_logo_dark.svg

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/frontend/src/lib/legacy/flows/dappsExplorer/dapps.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,6 @@
649649
"https://dev.caffeine.ai"
650650
],
651651
"logo": "caffeine_logo.svg",
652-
"logoDark": "caffeine_logo_dark.svg",
653652
"certified_attributes": true
654653
}
655654
]

src/frontend/src/lib/legacy/flows/dappsExplorer/dapps.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,6 @@ export class KnownDapp {
4949
] as string;
5050
}
5151

52-
public get logoDarkSrc(): string | undefined {
53-
if (this.descr.logoDark === undefined) {
54-
return;
55-
}
56-
return iconFiles[
57-
`/src/frontend/src/lib/icons/${this.descr.logoDark}`
58-
] as string;
59-
}
60-
6152
public get name(): string {
6253
return this.descr.name;
6354
}

src/frontend/src/routes/(new-styling)/(resuming-channel)/resume-openid-authorize/+page.svelte

Lines changed: 92 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
authorizationContextStore,
55
authorizationStore,
66
} from "$lib/stores/authorization.store";
7-
import Button from "$lib/components/ui/Button.svelte";
8-
import { ArrowRightIcon } from "@lucide/svelte";
97
import { getDapps } from "$lib/legacy/flows/dappsExplorer/dapps";
108
import { decodeJWT, findConfig } from "$lib/utils/openID";
119
import { AuthFlow } from "$lib/flows/authFlow.svelte";
@@ -25,6 +23,10 @@
2523
DirectOpenIdEvents,
2624
directOpenIdFunnel,
2725
} from "$lib/utils/analytics/DirectOpenIdFunnel";
26+
import { draw, fade, scale } from "svelte/transition";
27+
import { cubicOut } from "svelte/easing";
28+
import { triggerDropWaveAnimation } from "$lib/utils/animation-dispatcher";
29+
import Logo from "$lib/components/ui/Logo.svelte";
2830
2931
const dapps = getDapps();
3032
const dapp = $derived(
@@ -33,6 +35,8 @@
3335
),
3436
);
3537
38+
let animateTransitions = $state(false);
39+
3640
const createAttributesListener =
3741
(issuer: string) => async (request: JsonRequest) => {
3842
if (request.id === undefined || request.method !== "ii_attributes") {
@@ -139,6 +143,11 @@
139143
if (config === undefined) {
140144
return;
141145
}
146+
// Animate transitions and background
147+
animateTransitions = true;
148+
triggerDropWaveAnimation();
149+
150+
// Authenticate and respond to requests
142151
directOpenIdFunnel.addProperties({
143152
openid_issuer: config.issuer,
144153
});
@@ -170,57 +179,86 @@
170179
</script>
171180

172181
<div class="flex min-h-[100dvh] flex-col items-center justify-center px-8">
173-
{#if dapp?.logoSrc !== undefined}
174-
<img
175-
src={dapp.logoSrc}
176-
alt={$t`${dapp.name} logo`}
177-
class={[
178-
"mb-10 h-16 max-w-50 object-contain",
179-
dapp.logoDarkSrc !== undefined && "dark:hidden",
180-
]}
181-
/>
182-
{#if dapp.logoDarkSrc !== undefined}
183-
<img
184-
src={dapp.logoDarkSrc}
185-
alt={$t`${dapp.name} logo`}
186-
class="mb-10 hidden h-16 max-w-50 object-contain dark:block"
187-
aria-hidden="true"
188-
/>
189-
{/if}
182+
{#if animateTransitions}
183+
<div
184+
transition:scale={{ duration: 500, easing: cubicOut, start: 0.9 }}
185+
class="flex flex-col items-center justify-center"
186+
>
187+
{#if dapp?.logoSrc !== undefined}
188+
<div class="relative">
189+
<svg viewBox="0 0 92 92" width="92" height="92" class="mb-4">
190+
<path
191+
d="M 46 1 H 71 A 20 20 0 0 1 91 21 V 71 A 20 20 0 0 1 71 91 H 21 A 20 20 0 0 1 1 71 V 21 A 20 20 0 0 1 21 1 H 46"
192+
class="stroke-fg-primary/10 fill-none stroke-2"
193+
/>
194+
<g
195+
transition:fade|global={{
196+
duration: 500,
197+
easing: cubicOut,
198+
delay: 500,
199+
}}
200+
>
201+
<path
202+
transition:draw|global={{
203+
duration: 6000,
204+
easing: cubicOut,
205+
delay: 500,
206+
}}
207+
d="M 46 1 H 71 A 20 20 0 0 1 91 21 V 71 A 20 20 0 0 1 71 91 H 21 A 20 20 0 0 1 1 71 V 21 A 20 20 0 0 1 21 1 H 46"
208+
stroke-linecap="round"
209+
class="stroke-fg-primary fill-none stroke-2"
210+
/>
211+
</g>
212+
</svg>
213+
<img
214+
src={dapp.logoSrc}
215+
alt={$t`${dapp.name} logo`}
216+
class="absolute inset-1 size-[84px] rounded-[18px] object-cover"
217+
/>
218+
</div>
219+
{:else}
220+
<svg viewBox="0 0 92 92" width="92" height="92" class="mb-4">
221+
<circle
222+
cx="46"
223+
cy="46"
224+
r="45"
225+
stroke-width="2"
226+
class="stroke-fg-primary/10 fill-none stroke-2"
227+
/>
228+
<g
229+
transition:fade|global={{
230+
duration: 500,
231+
easing: cubicOut,
232+
delay: 500,
233+
}}
234+
>
235+
<circle
236+
transition:draw|global={{
237+
duration: 6000,
238+
easing: cubicOut,
239+
delay: 500,
240+
}}
241+
cx="46"
242+
cy="46"
243+
r="45"
244+
stroke-linecap="round"
245+
class="stroke-fg-primary origin-center -rotate-90 fill-none stroke-2"
246+
/>
247+
</g>
248+
</svg>
249+
{/if}
250+
<p class="text-text-primary mb-2 text-2xl font-medium">
251+
{$t`Signing in securely`}
252+
</p>
253+
<a
254+
href={window.location.origin}
255+
target="_blank"
256+
class="text-text-secondary flex flex-row items-center gap-2 text-base"
257+
>
258+
<span>{$t`Powered by`}</span>
259+
<Logo class="text-text-secondary h-2" />
260+
<span>{window.location.hostname}</span>
261+
</a>
262+
</div>
190263
{/if}
191-
<p class="text-text-secondary mb-1 text-xl font-semibold">
192-
{$t`Signing in securely`}
193-
</p>
194-
<p class="text-text-tertiary text-sm">{$t`This takes a few seconds.`}</p>
195-
<div class="bg-bg-quaternary my-6 h-0.5 w-full max-w-74 rounded-full">
196-
<div class="bg-fg-brand-primary animate-grow h-full rounded-full"></div>
197-
</div>
198-
<p class="text-text-secondary text-base">
199-
{$t`Powered by Internet Identity`}
200-
</p>
201-
<Button
202-
href={window.location.origin}
203-
target="_blank"
204-
variant="tertiary"
205-
class="mt-10"
206-
size="sm"
207-
>
208-
<span>{$t`How it works`}</span>
209-
<ArrowRightIcon class="size-4" />
210-
</Button>
211264
</div>
212-
213-
<style>
214-
@keyframes grow {
215-
from {
216-
width: 0;
217-
}
218-
to {
219-
width: 100%;
220-
}
221-
}
222-
223-
.animate-grow {
224-
animation: grow 6s ease-out forwards;
225-
}
226-
</style>

0 commit comments

Comments
 (0)