Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions infrastructure/eid-wallet/src/app.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
}
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,16 +53,21 @@ const baseClasses = `relative ${variant === "eName" ? "bg-black-900" : variant =
<div class="flex justify-between">
{#if variant === 'eName'}
<HugeiconsIcon size={30} strokeWidth={2} className="text-secondary" icon={CheckmarkBadge02Icon} />
<div class="flex gap-3 items-center">
<div class="flex gap-3 items-center">
{#if shareBtn}
<Button.Icon icon={Upload03Icon} iconColor={"white"} strokeWidth={2} onclick={shareBtn} />
{/if}
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />
{/if}
</div>
{:else if variant === 'ePassport'}
<p class="bg-white text-black flex items-center leading-0 justify-center rounded-full h-7 px-5 text-xs font-medium">HIGH SECURITY</p>
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />

{/if}
{:else if variant === 'eVault'}
<h3 class="text-black-300 text-3xl font-semibold mb-3">{state.progressWidth} Used</h3>
<h3 class="text-black-300 text-3xl font-semibold mb-3 z-[1]">{state.progressWidth} Used</h3>
{/if}
</div>
<div>
Expand Down
5 changes: 2 additions & 3 deletions infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,6 @@ import type { HTMLAttributes } from "svelte/elements";

interface IDrawerProps extends HTMLAttributes<HTMLDivElement> {
isPaneOpen?: boolean;
isCancelRequired?: boolean;
children?: Snippet;
handleSwipe?: (isOpen: boolean | undefined) => void;
}
Expand All@@ -17,7 +16,6 @@ let pane: CupertinoPane;

let {
isPaneOpen = $bindable(),
isCancelRequired = false,
children = undefined,
handleSwipe,
...restProps
Expand All@@ -36,7 +34,7 @@ $effect(() => {
backdropOpacity: 0.5,
backdropBlur: true,
bottomClose: true,
buttonDestroy: isCancelRequired,
buttonDestroy: false,
showDraggable: true,
upperThanTop: true,
breaks: {
Expand DownExpand Up@@ -89,6 +87,7 @@ $effect(() => {
}

:global(.move) {
display: none !important;
margin-block: 6px !important;
}
</style>
2 changes: 1 addition & 1 deletion infrastructure/eid-wallet/src/routes/(app)/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@ let currentRoute = $derived(page.url.pathname.split("/").pop() || "home");
</div>
{/if}

<div class="p-6 mb-16">
<div class="p-6">
{@render children()}
</div>
Original file line numberDiff line numberDiff line change
Expand Up@@ -59,14 +59,15 @@ function shareQR() {
/>
{/snippet}

{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
<main class="pb-16">
{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
</main>

<Drawer
title="Scan QR Code"
bind:isPaneOpen={shareQRdrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center relative items-center overflow-hidden h-full bg-gray rounded-3xl p-8">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,7 +61,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={codeScannedDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand DownExpand Up@@ -108,7 +107,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={loggedInDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { runtime } from "$lib/global/runtime.svelte";
const { children } = $props();
</script>

<main class="h-[100vh] px-[5vw] pb-[4.5vh]">
<main>
<AppNav title={runtime.header.title ?? ""}/>
{@render children?.()}
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,7 +45,7 @@ $effect(() => {
<ButtonAction class="w-full" callback={handleChangePIN}>Change PIN</ButtonAction>
</main>

<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
<HugeiconsIcon icon={CircleLock01Icon} color="var(--color-primary)"/>
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { Hero } from "$lib/fragments";
import IdentityCard from "$lib/fragments/IdentityCard/IdentityCard.svelte";
import { ButtonAction } from "$lib/ui";

const handleFinish = async () => {};
const handleFinish = async () => {
await goto("/main");
};
</script>


Expand All@@ -15,7 +18,6 @@ const handleFinish = async () => {};
class="mb-2"
/>
<IdentityCard variant= "ePassport"
viewBtn= {() => alert("View")}
userData= {{
Name: "Ananya",
Dob: "29 Nov 2003",
Expand All@@ -25,7 +27,7 @@ const handleFinish = async () => {};
</section>
<section class="mt-[4vh] mb-[9vh]">
<h4>Your eVault</h4>
<p class="text-black-700">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<p class="text-black-700 mb-[1vh]">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<IdentityCard variant= "eVault"
usedStorage= {15}
totalStorage= {80}/>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -81,7 +81,7 @@ $effect(() => {
{/if}


<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
{#if !isBiometricScreen}
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"
/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412" shareBtn={() => null} viewBtn={() => null}/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412"/>
</section>
<ButtonAction class="w-full" callback={handleNext}>Next</ButtonAction>
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,5 +12,5 @@ import { ButtonAction } from "$lib/ui";
/>
<img class="mx-auto mt-20" src="images/Passport.svg" alt="passport">
</section>
<ButtonAction class="w-full" callback={async() => goto("/verify/id")}>I'm ready</ButtonAction>
<ButtonAction class="w-full" callback={async() => goto("/register")}>I'm ready</ButtonAction>
</main>
38 changes: 38 additions & 0 deletions infrastructure/eid-wallet/src/routes/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -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() {
Expand All@@ -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;
});
});
});
</script>

{#if showSplashScreen}
Expand Down
7 changes: 7 additions & 0 deletions infrastructure/eid-wallet/src/routes/+page.svelte
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
<script lang="ts">
import { goto } from "$app/navigation";

$effect(() => {
goto("/onboarding");
});
</script>
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions infrastructure/eid-wallet/src/app.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
}
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,16 +53,21 @@ const baseClasses = `relative ${variant === "eName" ? "bg-black-900" : variant =
<div class="flex justify-between">
{#if variant === 'eName'}
<HugeiconsIcon size={30} strokeWidth={2} className="text-secondary" icon={CheckmarkBadge02Icon} />
<div class="flex gap-3 items-center">
<div class="flex gap-3 items-center">
{#if shareBtn}
<Button.Icon icon={Upload03Icon} iconColor={"white"} strokeWidth={2} onclick={shareBtn} />
{/if}
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />
{/if}
</div>
{:else if variant === 'ePassport'}
<p class="bg-white text-black flex items-center leading-0 justify-center rounded-full h-7 px-5 text-xs font-medium">HIGH SECURITY</p>
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />

{/if}
{:else if variant === 'eVault'}
<h3 class="text-black-300 text-3xl font-semibold mb-3">{state.progressWidth} Used</h3>
<h3 class="text-black-300 text-3xl font-semibold mb-3 z-[1]">{state.progressWidth} Used</h3>
{/if}
</div>
<div>
Expand Down
5 changes: 2 additions & 3 deletions infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,6 @@ import type { HTMLAttributes } from "svelte/elements";

interface IDrawerProps extends HTMLAttributes<HTMLDivElement> {
isPaneOpen?: boolean;
isCancelRequired?: boolean;
children?: Snippet;
handleSwipe?: (isOpen: boolean | undefined) => void;
}
Expand All@@ -17,7 +16,6 @@ let pane: CupertinoPane;

let {
isPaneOpen = $bindable(),
isCancelRequired = false,
children = undefined,
handleSwipe,
...restProps
Expand All@@ -36,7 +34,7 @@ $effect(() => {
backdropOpacity: 0.5,
backdropBlur: true,
bottomClose: true,
buttonDestroy: isCancelRequired,
buttonDestroy: false,
showDraggable: true,
upperThanTop: true,
breaks: {
Expand DownExpand Up@@ -89,6 +87,7 @@ $effect(() => {
}

:global(.move) {
display: none !important;
margin-block: 6px !important;
}
</style>
2 changes: 1 addition & 1 deletion infrastructure/eid-wallet/src/routes/(app)/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@ let currentRoute = $derived(page.url.pathname.split("/").pop() || "home");
</div>
{/if}

<div class="p-6 mb-16">
<div class="p-6">
{@render children()}
</div>
Original file line numberDiff line numberDiff line change
Expand Up@@ -59,14 +59,15 @@ function shareQR() {
/>
{/snippet}

{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
<main class="pb-16">
{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
</main>

<Drawer
title="Scan QR Code"
bind:isPaneOpen={shareQRdrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center relative items-center overflow-hidden h-full bg-gray rounded-3xl p-8">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,7 +61,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={codeScannedDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand DownExpand Up@@ -108,7 +107,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={loggedInDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { runtime } from "$lib/global/runtime.svelte";
const { children } = $props();
</script>

<main class="h-[100vh] px-[5vw] pb-[4.5vh]">
<main>
<AppNav title={runtime.header.title ?? ""}/>
{@render children?.()}
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,7 +45,7 @@ $effect(() => {
<ButtonAction class="w-full" callback={handleChangePIN}>Change PIN</ButtonAction>
</main>

<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
<HugeiconsIcon icon={CircleLock01Icon} color="var(--color-primary)"/>
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { Hero } from "$lib/fragments";
import IdentityCard from "$lib/fragments/IdentityCard/IdentityCard.svelte";
import { ButtonAction } from "$lib/ui";

const handleFinish = async () => {};
const handleFinish = async () => {
await goto("/main");
};
</script>


Expand All@@ -15,7 +18,6 @@ const handleFinish = async () => {};
class="mb-2"
/>
<IdentityCard variant= "ePassport"
viewBtn= {() => alert("View")}
userData= {{
Name: "Ananya",
Dob: "29 Nov 2003",
Expand All@@ -25,7 +27,7 @@ const handleFinish = async () => {};
</section>
<section class="mt-[4vh] mb-[9vh]">
<h4>Your eVault</h4>
<p class="text-black-700">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<p class="text-black-700 mb-[1vh]">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<IdentityCard variant= "eVault"
usedStorage= {15}
totalStorage= {80}/>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -81,7 +81,7 @@ $effect(() => {
{/if}


<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
{#if !isBiometricScreen}
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"
/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412" shareBtn={() => null} viewBtn={() => null}/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412"/>
</section>
<ButtonAction class="w-full" callback={handleNext}>Next</ButtonAction>
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,5 +12,5 @@ import { ButtonAction } from "$lib/ui";
/>
<img class="mx-auto mt-20" src="images/Passport.svg" alt="passport">
</section>
<ButtonAction class="w-full" callback={async() => goto("/verify/id")}>I'm ready</ButtonAction>
<ButtonAction class="w-full" callback={async() => goto("/register")}>I'm ready</ButtonAction>
</main>
38 changes: 38 additions & 0 deletions infrastructure/eid-wallet/src/routes/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -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() {
Expand All@@ -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;
});
});
});
</script>

{#if showSplashScreen}
Expand Down
7 changes: 7 additions & 0 deletions infrastructure/eid-wallet/src/routes/+page.svelte
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
<script lang="ts">
import { goto } from "$app/navigation";

$effect(() => {
goto("/onboarding");
});
</script>
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions infrastructure/eid-wallet/src/app.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
}
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,16 +53,21 @@ const baseClasses = `relative ${variant === "eName" ? "bg-black-900" : variant =
<div class="flex justify-between">
{#if variant === 'eName'}
<HugeiconsIcon size={30} strokeWidth={2} className="text-secondary" icon={CheckmarkBadge02Icon} />
<div class="flex gap-3 items-center">
<div class="flex gap-3 items-center">
{#if shareBtn}
<Button.Icon icon={Upload03Icon} iconColor={"white"} strokeWidth={2} onclick={shareBtn} />
{/if}
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />
{/if}
</div>
{:else if variant === 'ePassport'}
<p class="bg-white text-black flex items-center leading-0 justify-center rounded-full h-7 px-5 text-xs font-medium">HIGH SECURITY</p>
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />

{/if}
{:else if variant === 'eVault'}
<h3 class="text-black-300 text-3xl font-semibold mb-3">{state.progressWidth} Used</h3>
<h3 class="text-black-300 text-3xl font-semibold mb-3 z-[1]">{state.progressWidth} Used</h3>
{/if}
</div>
<div>
Expand Down
5 changes: 2 additions & 3 deletions infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,6 @@ import type { HTMLAttributes } from "svelte/elements";

interface IDrawerProps extends HTMLAttributes<HTMLDivElement> {
isPaneOpen?: boolean;
isCancelRequired?: boolean;
children?: Snippet;
handleSwipe?: (isOpen: boolean | undefined) => void;
}
Expand All@@ -17,7 +16,6 @@ let pane: CupertinoPane;

let {
isPaneOpen = $bindable(),
isCancelRequired = false,
children = undefined,
handleSwipe,
...restProps
Expand All@@ -36,7 +34,7 @@ $effect(() => {
backdropOpacity: 0.5,
backdropBlur: true,
bottomClose: true,
buttonDestroy: isCancelRequired,
buttonDestroy: false,
showDraggable: true,
upperThanTop: true,
breaks: {
Expand DownExpand Up@@ -89,6 +87,7 @@ $effect(() => {
}

:global(.move) {
display: none !important;
margin-block: 6px !important;
}
</style>
2 changes: 1 addition & 1 deletion infrastructure/eid-wallet/src/routes/(app)/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@ let currentRoute = $derived(page.url.pathname.split("/").pop() || "home");
</div>
{/if}

<div class="p-6 mb-16">
<div class="p-6">
{@render children()}
</div>
Original file line numberDiff line numberDiff line change
Expand Up@@ -59,14 +59,15 @@ function shareQR() {
/>
{/snippet}

{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
<main class="pb-16">
{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
</main>

<Drawer
title="Scan QR Code"
bind:isPaneOpen={shareQRdrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center relative items-center overflow-hidden h-full bg-gray rounded-3xl p-8">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,7 +61,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={codeScannedDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand DownExpand Up@@ -108,7 +107,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={loggedInDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { runtime } from "$lib/global/runtime.svelte";
const { children } = $props();
</script>

<main class="h-[100vh] px-[5vw] pb-[4.5vh]">
<main>
<AppNav title={runtime.header.title ?? ""}/>
{@render children?.()}
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,7 +45,7 @@ $effect(() => {
<ButtonAction class="w-full" callback={handleChangePIN}>Change PIN</ButtonAction>
</main>

<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
<HugeiconsIcon icon={CircleLock01Icon} color="var(--color-primary)"/>
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { Hero } from "$lib/fragments";
import IdentityCard from "$lib/fragments/IdentityCard/IdentityCard.svelte";
import { ButtonAction } from "$lib/ui";

const handleFinish = async () => {};
const handleFinish = async () => {
await goto("/main");
};
</script>


Expand All@@ -15,7 +18,6 @@ const handleFinish = async () => {};
class="mb-2"
/>
<IdentityCard variant= "ePassport"
viewBtn= {() => alert("View")}
userData= {{
Name: "Ananya",
Dob: "29 Nov 2003",
Expand All@@ -25,7 +27,7 @@ const handleFinish = async () => {};
</section>
<section class="mt-[4vh] mb-[9vh]">
<h4>Your eVault</h4>
<p class="text-black-700">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<p class="text-black-700 mb-[1vh]">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<IdentityCard variant= "eVault"
usedStorage= {15}
totalStorage= {80}/>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -81,7 +81,7 @@ $effect(() => {
{/if}


<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
{#if !isBiometricScreen}
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"
/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412" shareBtn={() => null} viewBtn={() => null}/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412"/>
</section>
<ButtonAction class="w-full" callback={handleNext}>Next</ButtonAction>
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,5 +12,5 @@ import { ButtonAction } from "$lib/ui";
/>
<img class="mx-auto mt-20" src="images/Passport.svg" alt="passport">
</section>
<ButtonAction class="w-full" callback={async() => goto("/verify/id")}>I'm ready</ButtonAction>
<ButtonAction class="w-full" callback={async() => goto("/register")}>I'm ready</ButtonAction>
</main>
38 changes: 38 additions & 0 deletions infrastructure/eid-wallet/src/routes/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -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() {
Expand All@@ -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;
});
});
});
</script>

{#if showSplashScreen}
Expand Down
7 changes: 7 additions & 0 deletions infrastructure/eid-wallet/src/routes/+page.svelte
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
<script lang="ts">
import { goto } from "$app/navigation";

$effect(() => {
goto("/onboarding");
});
</script>
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions infrastructure/eid-wallet/src/app.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
}
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,16 +53,21 @@ const baseClasses = `relative ${variant === "eName" ? "bg-black-900" : variant =
<div class="flex justify-between">
{#if variant === 'eName'}
<HugeiconsIcon size={30} strokeWidth={2} className="text-secondary" icon={CheckmarkBadge02Icon} />
<div class="flex gap-3 items-center">
<div class="flex gap-3 items-center">
{#if shareBtn}
<Button.Icon icon={Upload03Icon} iconColor={"white"} strokeWidth={2} onclick={shareBtn} />
{/if}
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />
{/if}
</div>
{:else if variant === 'ePassport'}
<p class="bg-white text-black flex items-center leading-0 justify-center rounded-full h-7 px-5 text-xs font-medium">HIGH SECURITY</p>
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />

{/if}
{:else if variant === 'eVault'}
<h3 class="text-black-300 text-3xl font-semibold mb-3">{state.progressWidth} Used</h3>
<h3 class="text-black-300 text-3xl font-semibold mb-3 z-[1]">{state.progressWidth} Used</h3>
{/if}
</div>
<div>
Expand Down
5 changes: 2 additions & 3 deletions infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,6 @@ import type { HTMLAttributes } from "svelte/elements";

interface IDrawerProps extends HTMLAttributes<HTMLDivElement> {
isPaneOpen?: boolean;
isCancelRequired?: boolean;
children?: Snippet;
handleSwipe?: (isOpen: boolean | undefined) => void;
}
Expand All@@ -17,7 +16,6 @@ let pane: CupertinoPane;

let {
isPaneOpen = $bindable(),
isCancelRequired = false,
children = undefined,
handleSwipe,
...restProps
Expand All@@ -36,7 +34,7 @@ $effect(() => {
backdropOpacity: 0.5,
backdropBlur: true,
bottomClose: true,
buttonDestroy: isCancelRequired,
buttonDestroy: false,
showDraggable: true,
upperThanTop: true,
breaks: {
Expand DownExpand Up@@ -89,6 +87,7 @@ $effect(() => {
}

:global(.move) {
display: none !important;
margin-block: 6px !important;
}
</style>
2 changes: 1 addition & 1 deletion infrastructure/eid-wallet/src/routes/(app)/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@ let currentRoute = $derived(page.url.pathname.split("/").pop() || "home");
</div>
{/if}

<div class="p-6 mb-16">
<div class="p-6">
{@render children()}
</div>
Original file line numberDiff line numberDiff line change
Expand Up@@ -59,14 +59,15 @@ function shareQR() {
/>
{/snippet}

{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
<main class="pb-16">
{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
</main>

<Drawer
title="Scan QR Code"
bind:isPaneOpen={shareQRdrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center relative items-center overflow-hidden h-full bg-gray rounded-3xl p-8">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,7 +61,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={codeScannedDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand DownExpand Up@@ -108,7 +107,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={loggedInDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { runtime } from "$lib/global/runtime.svelte";
const { children } = $props();
</script>

<main class="h-[100vh] px-[5vw] pb-[4.5vh]">
<main>
<AppNav title={runtime.header.title ?? ""}/>
{@render children?.()}
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,7 +45,7 @@ $effect(() => {
<ButtonAction class="w-full" callback={handleChangePIN}>Change PIN</ButtonAction>
</main>

<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
<HugeiconsIcon icon={CircleLock01Icon} color="var(--color-primary)"/>
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { Hero } from "$lib/fragments";
import IdentityCard from "$lib/fragments/IdentityCard/IdentityCard.svelte";
import { ButtonAction } from "$lib/ui";

const handleFinish = async () => {};
const handleFinish = async () => {
await goto("/main");
};
</script>


Expand All@@ -15,7 +18,6 @@ const handleFinish = async () => {};
class="mb-2"
/>
<IdentityCard variant= "ePassport"
viewBtn= {() => alert("View")}
userData= {{
Name: "Ananya",
Dob: "29 Nov 2003",
Expand All@@ -25,7 +27,7 @@ const handleFinish = async () => {};
</section>
<section class="mt-[4vh] mb-[9vh]">
<h4>Your eVault</h4>
<p class="text-black-700">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<p class="text-black-700 mb-[1vh]">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<IdentityCard variant= "eVault"
usedStorage= {15}
totalStorage= {80}/>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -81,7 +81,7 @@ $effect(() => {
{/if}


<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
{#if !isBiometricScreen}
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"
/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412" shareBtn={() => null} viewBtn={() => null}/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412"/>
</section>
<ButtonAction class="w-full" callback={handleNext}>Next</ButtonAction>
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,5 +12,5 @@ import { ButtonAction } from "$lib/ui";
/>
<img class="mx-auto mt-20" src="images/Passport.svg" alt="passport">
</section>
<ButtonAction class="w-full" callback={async() => goto("/verify/id")}>I'm ready</ButtonAction>
<ButtonAction class="w-full" callback={async() => goto("/register")}>I'm ready</ButtonAction>
</main>
38 changes: 38 additions & 0 deletions infrastructure/eid-wallet/src/routes/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -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() {
Expand All@@ -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;
});
});
});
</script>

{#if showSplashScreen}
Expand Down
7 changes: 7 additions & 0 deletions infrastructure/eid-wallet/src/routes/+page.svelte
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
<script lang="ts">
import { goto } from "$app/navigation";

$effect(() => {
goto("/onboarding");
});
</script>
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions infrastructure/eid-wallet/src/app.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
}
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,16 +53,21 @@ const baseClasses = `relative ${variant === "eName" ? "bg-black-900" : variant =
<div class="flex justify-between">
{#if variant === 'eName'}
<HugeiconsIcon size={30} strokeWidth={2} className="text-secondary" icon={CheckmarkBadge02Icon} />
<div class="flex gap-3 items-center">
<div class="flex gap-3 items-center">
{#if shareBtn}
<Button.Icon icon={Upload03Icon} iconColor={"white"} strokeWidth={2} onclick={shareBtn} />
{/if}
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />
{/if}
</div>
{:else if variant === 'ePassport'}
<p class="bg-white text-black flex items-center leading-0 justify-center rounded-full h-7 px-5 text-xs font-medium">HIGH SECURITY</p>
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />

{/if}
{:else if variant === 'eVault'}
<h3 class="text-black-300 text-3xl font-semibold mb-3">{state.progressWidth} Used</h3>
<h3 class="text-black-300 text-3xl font-semibold mb-3 z-[1]">{state.progressWidth} Used</h3>
{/if}
</div>
<div>
Expand Down
5 changes: 2 additions & 3 deletions infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,6 @@ import type { HTMLAttributes } from "svelte/elements";

interface IDrawerProps extends HTMLAttributes<HTMLDivElement> {
isPaneOpen?: boolean;
isCancelRequired?: boolean;
children?: Snippet;
handleSwipe?: (isOpen: boolean | undefined) => void;
}
Expand All@@ -17,7 +16,6 @@ let pane: CupertinoPane;

let {
isPaneOpen = $bindable(),
isCancelRequired = false,
children = undefined,
handleSwipe,
...restProps
Expand All@@ -36,7 +34,7 @@ $effect(() => {
backdropOpacity: 0.5,
backdropBlur: true,
bottomClose: true,
buttonDestroy: isCancelRequired,
buttonDestroy: false,
showDraggable: true,
upperThanTop: true,
breaks: {
Expand DownExpand Up@@ -89,6 +87,7 @@ $effect(() => {
}

:global(.move) {
display: none !important;
margin-block: 6px !important;
}
</style>
2 changes: 1 addition & 1 deletion infrastructure/eid-wallet/src/routes/(app)/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@ let currentRoute = $derived(page.url.pathname.split("/").pop() || "home");
</div>
{/if}

<div class="p-6 mb-16">
<div class="p-6">
{@render children()}
</div>
Original file line numberDiff line numberDiff line change
Expand Up@@ -59,14 +59,15 @@ function shareQR() {
/>
{/snippet}

{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
<main class="pb-16">
{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
</main>

<Drawer
title="Scan QR Code"
bind:isPaneOpen={shareQRdrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center relative items-center overflow-hidden h-full bg-gray rounded-3xl p-8">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,7 +61,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={codeScannedDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand DownExpand Up@@ -108,7 +107,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={loggedInDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { runtime } from "$lib/global/runtime.svelte";
const { children } = $props();
</script>

<main class="h-[100vh] px-[5vw] pb-[4.5vh]">
<main>
<AppNav title={runtime.header.title ?? ""}/>
{@render children?.()}
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,7 +45,7 @@ $effect(() => {
<ButtonAction class="w-full" callback={handleChangePIN}>Change PIN</ButtonAction>
</main>

<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
<HugeiconsIcon icon={CircleLock01Icon} color="var(--color-primary)"/>
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { Hero } from "$lib/fragments";
import IdentityCard from "$lib/fragments/IdentityCard/IdentityCard.svelte";
import { ButtonAction } from "$lib/ui";

const handleFinish = async () => {};
const handleFinish = async () => {
await goto("/main");
};
</script>


Expand All@@ -15,7 +18,6 @@ const handleFinish = async () => {};
class="mb-2"
/>
<IdentityCard variant= "ePassport"
viewBtn= {() => alert("View")}
userData= {{
Name: "Ananya",
Dob: "29 Nov 2003",
Expand All@@ -25,7 +27,7 @@ const handleFinish = async () => {};
</section>
<section class="mt-[4vh] mb-[9vh]">
<h4>Your eVault</h4>
<p class="text-black-700">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<p class="text-black-700 mb-[1vh]">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<IdentityCard variant= "eVault"
usedStorage= {15}
totalStorage= {80}/>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -81,7 +81,7 @@ $effect(() => {
{/if}


<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
{#if !isBiometricScreen}
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"
/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412" shareBtn={() => null} viewBtn={() => null}/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412"/>
</section>
<ButtonAction class="w-full" callback={handleNext}>Next</ButtonAction>
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,5 +12,5 @@ import { ButtonAction } from "$lib/ui";
/>
<img class="mx-auto mt-20" src="images/Passport.svg" alt="passport">
</section>
<ButtonAction class="w-full" callback={async() => goto("/verify/id")}>I'm ready</ButtonAction>
<ButtonAction class="w-full" callback={async() => goto("/register")}>I'm ready</ButtonAction>
</main>
38 changes: 38 additions & 0 deletions infrastructure/eid-wallet/src/routes/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -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() {
Expand All@@ -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;
});
});
});
</script>

{#if showSplashScreen}
Expand Down
7 changes: 7 additions & 0 deletions infrastructure/eid-wallet/src/routes/+page.svelte
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
<script lang="ts">
import { goto } from "$app/navigation";

$effect(() => {
goto("/onboarding");
});
</script>
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions infrastructure/eid-wallet/src/app.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
}
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,16 +53,21 @@ const baseClasses = `relative ${variant === "eName" ? "bg-black-900" : variant =
<div class="flex justify-between">
{#if variant === 'eName'}
<HugeiconsIcon size={30} strokeWidth={2} className="text-secondary" icon={CheckmarkBadge02Icon} />
<div class="flex gap-3 items-center">
<div class="flex gap-3 items-center">
{#if shareBtn}
<Button.Icon icon={Upload03Icon} iconColor={"white"} strokeWidth={2} onclick={shareBtn} />
{/if}
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />
{/if}
</div>
{:else if variant === 'ePassport'}
<p class="bg-white text-black flex items-center leading-0 justify-center rounded-full h-7 px-5 text-xs font-medium">HIGH SECURITY</p>
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />

{/if}
{:else if variant === 'eVault'}
<h3 class="text-black-300 text-3xl font-semibold mb-3">{state.progressWidth} Used</h3>
<h3 class="text-black-300 text-3xl font-semibold mb-3 z-[1]">{state.progressWidth} Used</h3>
{/if}
</div>
<div>
Expand Down
5 changes: 2 additions & 3 deletions infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,6 @@ import type { HTMLAttributes } from "svelte/elements";

interface IDrawerProps extends HTMLAttributes<HTMLDivElement> {
isPaneOpen?: boolean;
isCancelRequired?: boolean;
children?: Snippet;
handleSwipe?: (isOpen: boolean | undefined) => void;
}
Expand All@@ -17,7 +16,6 @@ let pane: CupertinoPane;

let {
isPaneOpen = $bindable(),
isCancelRequired = false,
children = undefined,
handleSwipe,
...restProps
Expand All@@ -36,7 +34,7 @@ $effect(() => {
backdropOpacity: 0.5,
backdropBlur: true,
bottomClose: true,
buttonDestroy: isCancelRequired,
buttonDestroy: false,
showDraggable: true,
upperThanTop: true,
breaks: {
Expand DownExpand Up@@ -89,6 +87,7 @@ $effect(() => {
}

:global(.move) {
display: none !important;
margin-block: 6px !important;
}
</style>
2 changes: 1 addition & 1 deletion infrastructure/eid-wallet/src/routes/(app)/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@ let currentRoute = $derived(page.url.pathname.split("/").pop() || "home");
</div>
{/if}

<div class="p-6 mb-16">
<div class="p-6">
{@render children()}
</div>
Original file line numberDiff line numberDiff line change
Expand Up@@ -59,14 +59,15 @@ function shareQR() {
/>
{/snippet}

{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
<main class="pb-16">
{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
</main>

<Drawer
title="Scan QR Code"
bind:isPaneOpen={shareQRdrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center relative items-center overflow-hidden h-full bg-gray rounded-3xl p-8">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,7 +61,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={codeScannedDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand DownExpand Up@@ -108,7 +107,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={loggedInDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { runtime } from "$lib/global/runtime.svelte";
const { children } = $props();
</script>

<main class="h-[100vh] px-[5vw] pb-[4.5vh]">
<main>
<AppNav title={runtime.header.title ?? ""}/>
{@render children?.()}
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,7 +45,7 @@ $effect(() => {
<ButtonAction class="w-full" callback={handleChangePIN}>Change PIN</ButtonAction>
</main>

<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
<HugeiconsIcon icon={CircleLock01Icon} color="var(--color-primary)"/>
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { Hero } from "$lib/fragments";
import IdentityCard from "$lib/fragments/IdentityCard/IdentityCard.svelte";
import { ButtonAction } from "$lib/ui";

const handleFinish = async () => {};
const handleFinish = async () => {
await goto("/main");
};
</script>


Expand All@@ -15,7 +18,6 @@ const handleFinish = async () => {};
class="mb-2"
/>
<IdentityCard variant= "ePassport"
viewBtn= {() => alert("View")}
userData= {{
Name: "Ananya",
Dob: "29 Nov 2003",
Expand All@@ -25,7 +27,7 @@ const handleFinish = async () => {};
</section>
<section class="mt-[4vh] mb-[9vh]">
<h4>Your eVault</h4>
<p class="text-black-700">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<p class="text-black-700 mb-[1vh]">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<IdentityCard variant= "eVault"
usedStorage= {15}
totalStorage= {80}/>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -81,7 +81,7 @@ $effect(() => {
{/if}


<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
{#if !isBiometricScreen}
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"
/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412" shareBtn={() => null} viewBtn={() => null}/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412"/>
</section>
<ButtonAction class="w-full" callback={handleNext}>Next</ButtonAction>
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,5 +12,5 @@ import { ButtonAction } from "$lib/ui";
/>
<img class="mx-auto mt-20" src="images/Passport.svg" alt="passport">
</section>
<ButtonAction class="w-full" callback={async() => goto("/verify/id")}>I'm ready</ButtonAction>
<ButtonAction class="w-full" callback={async() => goto("/register")}>I'm ready</ButtonAction>
</main>
38 changes: 38 additions & 0 deletions infrastructure/eid-wallet/src/routes/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -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() {
Expand All@@ -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;
});
});
});
</script>

{#if showSplashScreen}
Expand Down
7 changes: 7 additions & 0 deletions infrastructure/eid-wallet/src/routes/+page.svelte
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
<script lang="ts">
import { goto } from "$app/navigation";

$effect(() => {
goto("/onboarding");
});
</script>
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions infrastructure/eid-wallet/src/app.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
}
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,16 +53,21 @@ const baseClasses = `relative ${variant === "eName" ? "bg-black-900" : variant =
<div class="flex justify-between">
{#if variant === 'eName'}
<HugeiconsIcon size={30} strokeWidth={2} className="text-secondary" icon={CheckmarkBadge02Icon} />
<div class="flex gap-3 items-center">
<div class="flex gap-3 items-center">
{#if shareBtn}
<Button.Icon icon={Upload03Icon} iconColor={"white"} strokeWidth={2} onclick={shareBtn} />
{/if}
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />
{/if}
</div>
{:else if variant === 'ePassport'}
<p class="bg-white text-black flex items-center leading-0 justify-center rounded-full h-7 px-5 text-xs font-medium">HIGH SECURITY</p>
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />

{/if}
{:else if variant === 'eVault'}
<h3 class="text-black-300 text-3xl font-semibold mb-3">{state.progressWidth} Used</h3>
<h3 class="text-black-300 text-3xl font-semibold mb-3 z-[1]">{state.progressWidth} Used</h3>
{/if}
</div>
<div>
Expand Down
5 changes: 2 additions & 3 deletions infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,6 @@ import type { HTMLAttributes } from "svelte/elements";

interface IDrawerProps extends HTMLAttributes<HTMLDivElement> {
isPaneOpen?: boolean;
isCancelRequired?: boolean;
children?: Snippet;
handleSwipe?: (isOpen: boolean | undefined) => void;
}
Expand All@@ -17,7 +16,6 @@ let pane: CupertinoPane;

let {
isPaneOpen = $bindable(),
isCancelRequired = false,
children = undefined,
handleSwipe,
...restProps
Expand All@@ -36,7 +34,7 @@ $effect(() => {
backdropOpacity: 0.5,
backdropBlur: true,
bottomClose: true,
buttonDestroy: isCancelRequired,
buttonDestroy: false,
showDraggable: true,
upperThanTop: true,
breaks: {
Expand DownExpand Up@@ -89,6 +87,7 @@ $effect(() => {
}

:global(.move) {
display: none !important;
margin-block: 6px !important;
}
</style>
2 changes: 1 addition & 1 deletion infrastructure/eid-wallet/src/routes/(app)/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@ let currentRoute = $derived(page.url.pathname.split("/").pop() || "home");
</div>
{/if}

<div class="p-6 mb-16">
<div class="p-6">
{@render children()}
</div>
Original file line numberDiff line numberDiff line change
Expand Up@@ -59,14 +59,15 @@ function shareQR() {
/>
{/snippet}

{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
<main class="pb-16">
{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
</main>

<Drawer
title="Scan QR Code"
bind:isPaneOpen={shareQRdrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center relative items-center overflow-hidden h-full bg-gray rounded-3xl p-8">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,7 +61,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={codeScannedDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand DownExpand Up@@ -108,7 +107,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={loggedInDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { runtime } from "$lib/global/runtime.svelte";
const { children } = $props();
</script>

<main class="h-[100vh] px-[5vw] pb-[4.5vh]">
<main>
<AppNav title={runtime.header.title ?? ""}/>
{@render children?.()}
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,7 +45,7 @@ $effect(() => {
<ButtonAction class="w-full" callback={handleChangePIN}>Change PIN</ButtonAction>
</main>

<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
<HugeiconsIcon icon={CircleLock01Icon} color="var(--color-primary)"/>
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { Hero } from "$lib/fragments";
import IdentityCard from "$lib/fragments/IdentityCard/IdentityCard.svelte";
import { ButtonAction } from "$lib/ui";

const handleFinish = async () => {};
const handleFinish = async () => {
await goto("/main");
};
</script>


Expand All@@ -15,7 +18,6 @@ const handleFinish = async () => {};
class="mb-2"
/>
<IdentityCard variant= "ePassport"
viewBtn= {() => alert("View")}
userData= {{
Name: "Ananya",
Dob: "29 Nov 2003",
Expand All@@ -25,7 +27,7 @@ const handleFinish = async () => {};
</section>
<section class="mt-[4vh] mb-[9vh]">
<h4>Your eVault</h4>
<p class="text-black-700">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<p class="text-black-700 mb-[1vh]">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<IdentityCard variant= "eVault"
usedStorage= {15}
totalStorage= {80}/>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -81,7 +81,7 @@ $effect(() => {
{/if}


<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
{#if !isBiometricScreen}
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"
/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412" shareBtn={() => null} viewBtn={() => null}/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412"/>
</section>
<ButtonAction class="w-full" callback={handleNext}>Next</ButtonAction>
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,5 +12,5 @@ import { ButtonAction } from "$lib/ui";
/>
<img class="mx-auto mt-20" src="images/Passport.svg" alt="passport">
</section>
<ButtonAction class="w-full" callback={async() => goto("/verify/id")}>I'm ready</ButtonAction>
<ButtonAction class="w-full" callback={async() => goto("/register")}>I'm ready</ButtonAction>
</main>
38 changes: 38 additions & 0 deletions infrastructure/eid-wallet/src/routes/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -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() {
Expand All@@ -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;
});
});
});
</script>

{#if showSplashScreen}
Expand Down
7 changes: 7 additions & 0 deletions infrastructure/eid-wallet/src/routes/+page.svelte
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
<script lang="ts">
import { goto } from "$app/navigation";

$effect(() => {
goto("/onboarding");
});
</script>
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions infrastructure/eid-wallet/src/app.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
}
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,16 +53,21 @@ const baseClasses = `relative ${variant === "eName" ? "bg-black-900" : variant =
<div class="flex justify-between">
{#if variant === 'eName'}
<HugeiconsIcon size={30} strokeWidth={2} className="text-secondary" icon={CheckmarkBadge02Icon} />
<div class="flex gap-3 items-center">
<div class="flex gap-3 items-center">
{#if shareBtn}
<Button.Icon icon={Upload03Icon} iconColor={"white"} strokeWidth={2} onclick={shareBtn} />
{/if}
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />
{/if}
</div>
{:else if variant === 'ePassport'}
<p class="bg-white text-black flex items-center leading-0 justify-center rounded-full h-7 px-5 text-xs font-medium">HIGH SECURITY</p>
{#if viewBtn}
<Button.Icon icon={ViewIcon} iconColor={"white"} strokeWidth={2} onclick={viewBtn} />

{/if}
{:else if variant === 'eVault'}
<h3 class="text-black-300 text-3xl font-semibold mb-3">{state.progressWidth} Used</h3>
<h3 class="text-black-300 text-3xl font-semibold mb-3 z-[1]">{state.progressWidth} Used</h3>
{/if}
</div>
<div>
Expand Down
5 changes: 2 additions & 3 deletions infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,6 @@ import type { HTMLAttributes } from "svelte/elements";

interface IDrawerProps extends HTMLAttributes<HTMLDivElement> {
isPaneOpen?: boolean;
isCancelRequired?: boolean;
children?: Snippet;
handleSwipe?: (isOpen: boolean | undefined) => void;
}
Expand All@@ -17,7 +16,6 @@ let pane: CupertinoPane;

let {
isPaneOpen = $bindable(),
isCancelRequired = false,
children = undefined,
handleSwipe,
...restProps
Expand All@@ -36,7 +34,7 @@ $effect(() => {
backdropOpacity: 0.5,
backdropBlur: true,
bottomClose: true,
buttonDestroy: isCancelRequired,
buttonDestroy: false,
showDraggable: true,
upperThanTop: true,
breaks: {
Expand DownExpand Up@@ -89,6 +87,7 @@ $effect(() => {
}

:global(.move) {
display: none !important;
margin-block: 6px !important;
}
</style>
2 changes: 1 addition & 1 deletion infrastructure/eid-wallet/src/routes/(app)/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,6 @@ let currentRoute = $derived(page.url.pathname.split("/").pop() || "home");
</div>
{/if}

<div class="p-6 mb-16">
<div class="p-6">
{@render children()}
</div>
Original file line numberDiff line numberDiff line change
Expand Up@@ -59,14 +59,15 @@ function shareQR() {
/>
{/snippet}

{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
<main class="pb-16">
{@render Section("eName", eName)}
{@render Section("ePassport", ePassport)}
{@render Section("eVault", eVault)}
</main>

<Drawer
title="Scan QR Code"
bind:isPaneOpen={shareQRdrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center relative items-center overflow-hidden h-full bg-gray rounded-3xl p-8">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,7 +61,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={codeScannedDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand DownExpand Up@@ -108,7 +107,6 @@ let flashlightOn = $state(false);
<Drawer
title="Scan QR Code"
bind:isPaneOpen={loggedInDrawerOpen}
isCancelRequired={true}
class="flex flex-col gap-4 items-center justify-center"
>
<div class="flex justify-center mb-4 relative items-center overflow-hidden bg-gray rounded-xl p-4 h-[72px] w-[72px]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { runtime } from "$lib/global/runtime.svelte";
const { children } = $props();
</script>

<main class="h-[100vh] px-[5vw] pb-[4.5vh]">
<main>
<AppNav title={runtime.header.title ?? ""}/>
{@render children?.()}
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,7 +45,7 @@ $effect(() => {
<ButtonAction class="w-full" callback={handleChangePIN}>Change PIN</ButtonAction>
</main>

<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
<HugeiconsIcon icon={CircleLock01Icon} color="var(--color-primary)"/>
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { Hero } from "$lib/fragments";
import IdentityCard from "$lib/fragments/IdentityCard/IdentityCard.svelte";
import { ButtonAction } from "$lib/ui";

const handleFinish = async () => {};
const handleFinish = async () => {
await goto("/main");
};
</script>


Expand All@@ -15,7 +18,6 @@ const handleFinish = async () => {};
class="mb-2"
/>
<IdentityCard variant= "ePassport"
viewBtn= {() => alert("View")}
userData= {{
Name: "Ananya",
Dob: "29 Nov 2003",
Expand All@@ -25,7 +27,7 @@ const handleFinish = async () => {};
</section>
<section class="mt-[4vh] mb-[9vh]">
<h4>Your eVault</h4>
<p class="text-black-700">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<p class="text-black-700 mb-[1vh]">We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p>
<IdentityCard variant= "eVault"
usedStorage= {15}
totalStorage= {80}/>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -81,7 +81,7 @@ $effect(() => {
{/if}


<Drawer bind:isPaneOpen={showDrawer} isCancelRequired={true}>
<Drawer bind:isPaneOpen={showDrawer}>
{#if !isBiometricScreen}
<div class="relative bg-gray w-[72px] h-[72px] rounded-[24px] flex justify-center items-center mb-[2.3vh]">
<span class="relative z-[1]">
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"
/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412" shareBtn={() => null} viewBtn={() => null}/>
<IdentityCard variant="eName" userId= "acbsdjk-14n14k43-12412"/>
</section>
<ButtonAction class="w-full" callback={handleNext}>Next</ButtonAction>
</main>
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,5 +12,5 @@ import { ButtonAction } from "$lib/ui";
/>
<img class="mx-auto mt-20" src="images/Passport.svg" alt="passport">
</section>
<ButtonAction class="w-full" callback={async() => goto("/verify/id")}>I'm ready</ButtonAction>
<ButtonAction class="w-full" callback={async() => goto("/register")}>I'm ready</ButtonAction>
</main>
38 changes: 38 additions & 0 deletions infrastructure/eid-wallet/src/routes/+layout.svelte
Original file line numberDiff line numberDiff line change
Expand Up@@ -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() {
Expand All@@ -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;
});
});
});
</script>

{#if showSplashScreen}
Expand Down
7 changes: 7 additions & 0 deletions infrastructure/eid-wallet/src/routes/+page.svelte
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
<script lang="ts">
import { goto } from "$app/navigation";

$effect(() => {
goto("/onboarding");
});
</script>