diff --git a/messages/en.json b/messages/en.json index caf3e1a3..c2e3a69b 100644 --- a/messages/en.json +++ b/messages/en.json @@ -47,6 +47,10 @@ "Nothing_in_your_wallet": "Nothing in your wallet", "Start_getting_your_first_credential": "Start getting your first credential", "See_issuance_services": "See issuance services", + "Welcome_to_DID_Wallet": "Welcome to DID Wallet", + "your_friendly_and_trustable_opensource_wallet_": "your friendly and trustable open-source wallet.", + "Create_your_DID": "Create your DID", + "Manage_VC_verifiable_credentials_in_one_place": "Manage VC (verifiable credentials) in one place", "Enter_your_email": "Enter your email", "enter_your_email_to_get_started": "enter your email to get started", "Email": "Email", diff --git a/src/lib/components/onBoarding/First.svelte b/src/lib/components/onBoarding/First.svelte new file mode 100644 index 00000000..b84235a4 --- /dev/null +++ b/src/lib/components/onBoarding/First.svelte @@ -0,0 +1,18 @@ + + +placeholder +
+ {m.Welcome_to_DID_Wallet()}, + {m.your_friendly_and_trustable_opensource_wallet_()} + Lorem ipsum dolor sit amet consectetur. Adipiscing mauris sagittis amet arcu mauris leo. + stepController.move(e.detail.value)} /> +
diff --git a/src/lib/components/onBoarding/Second.svelte b/src/lib/components/onBoarding/Second.svelte new file mode 100644 index 00000000..9fe5efa2 --- /dev/null +++ b/src/lib/components/onBoarding/Second.svelte @@ -0,0 +1,19 @@ + + +placeholder +
+ {m.Create_your_DID()} + Lorem ipsum dolor sit amet consectetur. Adipiscing mauris sagittis amet arcu mauris leo. + stepController.move(e.detail.value)} /> +
diff --git a/src/lib/components/onBoarding/StepsController.svelte b/src/lib/components/onBoarding/StepsController.svelte new file mode 100644 index 00000000..abca9cd2 --- /dev/null +++ b/src/lib/components/onBoarding/StepsController.svelte @@ -0,0 +1,46 @@ + + +
+
+ {#each Array.from(Array(total).keys()) as page} + {#if page === index} + + {:else} + + {/if} + {/each} +
+ + + {#if index === total - 1} + Complete + {:else} + Skip + {/if} + +
diff --git a/src/lib/components/onBoarding/Third.svelte b/src/lib/components/onBoarding/Third.svelte new file mode 100644 index 00000000..c5903e5b --- /dev/null +++ b/src/lib/components/onBoarding/Third.svelte @@ -0,0 +1,19 @@ + + +placeholder +
+ {m.Manage_VC_verifiable_credentials_in_one_place()} + Lorem ipsum dolor sit amet consectetur. Adipiscing mauris sagittis amet arcu mauris leo. + stepController.move(e.detail.value)} /> +
diff --git a/src/lib/components/onBoarding/dot.svelte b/src/lib/components/onBoarding/dot.svelte new file mode 100644 index 00000000..17d25c82 --- /dev/null +++ b/src/lib/components/onBoarding/dot.svelte @@ -0,0 +1,3 @@ + + + diff --git a/src/lib/components/onBoarding/utils.ts b/src/lib/components/onBoarding/utils.ts new file mode 100644 index 00000000..c7c3f252 --- /dev/null +++ b/src/lib/components/onBoarding/utils.ts @@ -0,0 +1,14 @@ +import { goto } from "$app/navigation"; +import { getPreference, setPreference } from "$lib/preferences"; + +const ISBOARDED_KEY = 'isBoarded'; + +export const completeOnBoarding = async ()=>{ + await setPreference(ISBOARDED_KEY, 'true', false) + goto("/home") +} +export async function isAlreadyBoarded(): Promise { + const isAlreadyBoardedString = await getPreference(ISBOARDED_KEY, false); + if (!isAlreadyBoardedString) return false; + return true +} \ No newline at end of file diff --git a/src/lib/ionic/forms/input.svelte b/src/lib/ionic/forms/input.svelte index 7cf1d33e..642005fc 100644 --- a/src/lib/ionic/forms/input.svelte +++ b/src/lib/ionic/forms/input.svelte @@ -27,9 +27,26 @@ class:ion-invalid={errorText} class:ion-touched={errorText} label-placement="stacked" + fill="outline" + class="custom" {value} on:ionInput={(e) => { updateValue(e.detail.value); }} /> + diff --git a/src/routes/[[lang]]/(protected)/+layout.ts b/src/routes/[[lang]]/(protected)/+layout.ts index 2df3ba32..fe8e1f9e 100644 --- a/src/routes/[[lang]]/(protected)/+layout.ts +++ b/src/routes/[[lang]]/(protected)/+layout.ts @@ -4,6 +4,7 @@ import { getLanguagePreference } from '$lib/preferences/lang'; import { isAppLocked, lockApp } from '$lib/preferences/locked.js'; import { redirect } from '@sveltejs/kit'; import { availableLanguageTags } from '$paraglide/runtime'; +import { isAlreadyBoarded } from '$lib/components/onBoarding/utils'; const getLang = async () => { const lang = await getLanguagePreference(); @@ -14,6 +15,8 @@ const getLang = async () => { export const load = async () => { const lang = await getLang(); + const boarded = await isAlreadyBoarded(); + if (!Boolean(boarded)) throw redirect(303, r('/on-boarding', lang)); const keypair = await getKeypairPreference(); if (!keypair) redirect(303, r('/login', lang)); diff --git a/src/routes/[[lang]]/on-boarding/+page.svelte b/src/routes/[[lang]]/on-boarding/+page.svelte new file mode 100644 index 00000000..6e4af2e7 --- /dev/null +++ b/src/routes/[[lang]]/on-boarding/+page.svelte @@ -0,0 +1,23 @@ + + +