diff --git a/infrastructure/eid-wallet/src/app.css b/infrastructure/eid-wallet/src/app.css index 5333d875..5f3ffe2e 100644 --- a/infrastructure/eid-wallet/src/app.css +++ b/infrastructure/eid-wallet/src/app.css @@ -76,3 +76,96 @@ body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); } + +/* Ensure background remains correct during transitions */ +:root[data-transition]::view-transition-group(root), +:root[data-transition]::view-transition-old(root), +:root[data-transition]::view-transition-new(root) { + background-color: white !important; /* Default to white */ +} + +.dark:root[data-transition]::view-transition-group(root), +.dark:root[data-transition]::view-transition-old(root), +.dark:root[data-transition]::view-transition-new(root) { + background-color: #0b0d13 !important; /* Use dark background in dark mode */ +} + +/* Prevent flickering */ +:root[data-transition]::view-transition-old(root), +:root[data-transition]::view-transition-new(root) { + contain: paint; + will-change: transform, opacity; +} + +/* Slide-in from the right without fade */ +@keyframes slide-from-right { + from { + transform: translateX(100%); /* Start from the right */ + opacity: 1; /* Ensure fully visible */ + } + to { + transform: translateX(0); /* Move to original position */ + opacity: 1; + } +} + +/* Slide-out to the right without fade */ +@keyframes slide-to-right { + from { + transform: translateX(0); /* Start at original position */ + opacity: 1; + } + to { + transform: translateX(100%); /* Move to the right */ + opacity: 1; + } +} + +/* Slide-in from the left without fade */ +@keyframes slide-from-left { + from { + transform: translateX(-100%); /* Start from the left */ + opacity: 1; + } + to { + transform: translateX(0); /* Move to original position */ + opacity: 1; + } +} + +/* Slide-out to the left without fade */ +@keyframes slide-to-left { + from { + transform: translateX(0); /* Start at original position */ + opacity: 1; + } + to { + transform: translateX(-100%); /* Move to the left */ + opacity: 1; + } +} + +@keyframes fade-out { + from { + opacity: 1; + } + to { + opacity: 0; + } +} + +:root[data-transition]::view-transition-old(root) { + animation: 400ms ease-out both fade-out; +} + +:root[data-transition="right"]::view-transition-new(root) { + animation: 200ms cubic-bezier(0.4, 0, 0.2, 1) both slide-from-right; + position: relative; + z-index: 1; +} + +:root[data-transition="left"]::view-transition-new(root) { + animation: 200ms cubic-bezier(0.4, 0, 0.2, 1) both slide-from-left; + position: relative; + z-index: 1; +} diff --git a/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte b/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte index 44c60354..c2dae005 100644 --- a/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte +++ b/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte @@ -53,16 +53,21 @@ const baseClasses = `relative ${variant === "eName" ? "bg-black-900" : variant =
{#if variant === 'eName'} -
+
+ {#if shareBtn} + {/if} + {#if viewBtn} + {/if}
{:else if variant === 'ePassport'}

HIGH SECURITY

+ {#if viewBtn} - + {/if} {:else if variant === 'eVault'} -

{state.progressWidth} Used

+

{state.progressWidth} Used

{/if}
diff --git a/infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte b/infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte index 12ccc1df..3ed84005 100644 --- a/infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte +++ b/infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte @@ -7,7 +7,6 @@ import type { HTMLAttributes } from "svelte/elements"; interface IDrawerProps extends HTMLAttributes { isPaneOpen?: boolean; - isCancelRequired?: boolean; children?: Snippet; handleSwipe?: (isOpen: boolean | undefined) => void; } @@ -17,7 +16,6 @@ let pane: CupertinoPane; let { isPaneOpen = $bindable(), - isCancelRequired = false, children = undefined, handleSwipe, ...restProps @@ -36,7 +34,7 @@ $effect(() => { backdropOpacity: 0.5, backdropBlur: true, bottomClose: true, - buttonDestroy: isCancelRequired, + buttonDestroy: false, showDraggable: true, upperThanTop: true, breaks: { @@ -89,6 +87,7 @@ $effect(() => { } :global(.move) { + display: none !important; margin-block: 6px !important; } diff --git a/infrastructure/eid-wallet/src/routes/(app)/+layout.svelte b/infrastructure/eid-wallet/src/routes/(app)/+layout.svelte index b7c77c23..e7af1510 100644 --- a/infrastructure/eid-wallet/src/routes/(app)/+layout.svelte +++ b/infrastructure/eid-wallet/src/routes/(app)/+layout.svelte @@ -15,6 +15,6 @@ let currentRoute = $derived(page.url.pathname.split("/").pop() || "home");
{/if} -
+
{@render children()}
\ No newline at end of file diff --git a/infrastructure/eid-wallet/src/routes/(app)/+page.svelte b/infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte similarity index 94% rename from infrastructure/eid-wallet/src/routes/(app)/+page.svelte rename to infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte index 572f85c7..2924f3a3 100644 --- a/infrastructure/eid-wallet/src/routes/(app)/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte @@ -59,14 +59,15 @@ function shareQR() { /> {/snippet} -{@render Section("eName", eName)} -{@render Section("ePassport", ePassport)} -{@render Section("eVault", eVault)} +
+ {@render Section("eName", eName)} + {@render Section("ePassport", ePassport)} + {@render Section("eVault", eVault)} +
diff --git a/infrastructure/eid-wallet/src/routes/(app)/scan-qr/+page.svelte b/infrastructure/eid-wallet/src/routes/(app)/scan-qr/+page.svelte index d521efa5..3f61726e 100644 --- a/infrastructure/eid-wallet/src/routes/(app)/scan-qr/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(app)/scan-qr/+page.svelte @@ -61,7 +61,6 @@ let flashlightOn = $state(false);
@@ -108,7 +107,6 @@ let flashlightOn = $state(false);
diff --git a/infrastructure/eid-wallet/src/routes/(app)/settings/+layout.svelte b/infrastructure/eid-wallet/src/routes/(app)/settings/+layout.svelte index 364a0709..7801d03d 100644 --- a/infrastructure/eid-wallet/src/routes/(app)/settings/+layout.svelte +++ b/infrastructure/eid-wallet/src/routes/(app)/settings/+layout.svelte @@ -5,7 +5,7 @@ import { runtime } from "$lib/global/runtime.svelte"; const { children } = $props(); -
+
{@render children?.()}
\ No newline at end of file diff --git a/infrastructure/eid-wallet/src/routes/(app)/settings/pin/+page.svelte b/infrastructure/eid-wallet/src/routes/(app)/settings/pin/+page.svelte index 71fa9508..8607c2c1 100644 --- a/infrastructure/eid-wallet/src/routes/(app)/settings/pin/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(app)/settings/pin/+page.svelte @@ -45,7 +45,7 @@ $effect(() => { Change PIN
- +
diff --git a/infrastructure/eid-wallet/src/routes/(auth)/e-passport/+page.svelte b/infrastructure/eid-wallet/src/routes/(auth)/e-passport/+page.svelte index 7761b328..90cf9095 100644 --- a/infrastructure/eid-wallet/src/routes/(auth)/e-passport/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(auth)/e-passport/+page.svelte @@ -1,9 +1,12 @@ @@ -15,7 +18,6 @@ const handleFinish = async () => {}; class="mb-2" /> alert("View")} userData= {{ Name: "Ananya", Dob: "29 Nov 2003", @@ -25,7 +27,7 @@ const handleFinish = async () => {};

Your eVault

-

We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.

+

We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.

diff --git a/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte b/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte index f1f1bff4..e910a576 100644 --- a/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte @@ -81,7 +81,7 @@ $effect(() => { {/if} - + {#if !isBiometricScreen}
diff --git a/infrastructure/eid-wallet/src/routes/(auth)/review/+page.svelte b/infrastructure/eid-wallet/src/routes/(auth)/review/+page.svelte index 15741f2a..1490cbc0 100644 --- a/infrastructure/eid-wallet/src/routes/(auth)/review/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(auth)/review/+page.svelte @@ -15,7 +15,7 @@ const handleNext = async () => { subtitle="This identifier is permanently yours, and it stays with you for your whole life." class="mb-4" /> - null} viewBtn={() => null}/> +
Next \ No newline at end of file diff --git a/infrastructure/eid-wallet/src/routes/(auth)/verify/+page.svelte b/infrastructure/eid-wallet/src/routes/(auth)/verify/+page.svelte index 3c7c166c..9940fb04 100644 --- a/infrastructure/eid-wallet/src/routes/(auth)/verify/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(auth)/verify/+page.svelte @@ -12,5 +12,5 @@ import { ButtonAction } from "$lib/ui"; /> passport - goto("/verify/id")}>I'm ready + goto("/register")}>I'm ready \ No newline at end of file diff --git a/infrastructure/eid-wallet/src/routes/+layout.svelte b/infrastructure/eid-wallet/src/routes/+layout.svelte index 2ebf7008..10cf01da 100644 --- a/infrastructure/eid-wallet/src/routes/+layout.svelte +++ b/infrastructure/eid-wallet/src/routes/+layout.svelte @@ -2,10 +2,13 @@ import SplashScreen from "$lib/fragments/SplashScreen/SplashScreen.svelte"; import { onMount } from "svelte"; import "../app.css"; +import { onNavigate } from "$app/navigation"; const { children } = $props(); let showSplashScreen = $state(false); +let previousRoute = null; +let navigationStack: string[] = []; // replace with actual data loading logic async function loadData() { @@ -18,11 +21,46 @@ async function ensureMinimumDelay() { onMount(async () => { showSplashScreen = true; // Can't set up the original state to true or animation won't start + navigationStack.push(window.location.pathname); await Promise.all([loadData(), ensureMinimumDelay()]); showSplashScreen = false; }); + +onNavigate((navigation) => { + if (!document.startViewTransition) return; + + const from = navigation.from?.url.pathname; + const to = navigation.to?.url.pathname; + + if (!from || !to || from === to) return; + + let direction: "left" | "right" = "right"; + + const fromIndex = navigationStack.lastIndexOf(from); + const toIndex = navigationStack.lastIndexOf(to); + + if (toIndex !== -1 && toIndex < fromIndex) { + // Backward navigation + direction = "left"; + navigationStack = navigationStack.slice(0, toIndex + 1); + } else { + // Forward navigation (or new path) + direction = "right"; + navigationStack.push(to); + } + + document.documentElement.setAttribute("data-transition", direction); + previousRoute = to; + + return new Promise((resolve) => { + document.startViewTransition(async () => { + resolve(); + await navigation.complete; + }); + }); +}); {#if showSplashScreen} diff --git a/infrastructure/eid-wallet/src/routes/+page.svelte b/infrastructure/eid-wallet/src/routes/+page.svelte new file mode 100644 index 00000000..b709cedf --- /dev/null +++ b/infrastructure/eid-wallet/src/routes/+page.svelte @@ -0,0 +1,7 @@ +