Skip to content

Commit bf7e762

Browse files
committed
add dashboard
1 parent 4b80de8 commit bf7e762

7 files changed

Lines changed: 169 additions & 175 deletions

File tree

‎apps/codingcatdev/src/routes/(layout-partials)/CcdAppBar.svelte‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
<AjAlt />
4141
</a> -->
4242
<!-- Title -->
43-
<a href="/">
43+
<a href={$storeUser?.uid ? '/dashboard' : '/'} class="flex items-center">
4444
<div class="w-12">
4545
<AJAlt />
4646
</div>
47-
</a>
48-
<a class="hidden hover:brightness-110 xl:flex xl:gap-1 sm:text-xl md:text-3xl" href="/">
49-
CodingCat.dev
47+
<span class="hidden hover:brightness-110 xl:flex xl:gap-1 sm:text-xl md:text-3xl">
48+
CodingCat.dev
49+
</span>
5050
</a>
5151
</div>
5252
</svelte:fragment>
@@ -111,7 +111,7 @@
111111
<div class="flex flex-col gap-2 mt-2">
112112
<div class="text-sm text-ellipsis">{$storeUser?.email}</div>
113113
<div class="flex gap-2">
114-
<a class="bcu-button variant-ringed-primary" href="/account">Account</a>
114+
<a class="bcu-button variant-ringed-primary" href="/dashboard">Dashboard</a>
115115
<LogoutButton />
116116
</div>
117117
</div>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<script lang="ts">
2+
import { Icon } from '@steeze-ui/svelte-icon';
3+
import { RocketLaunch } from '@steeze-ui/heroicons';
4+
5+
import { modalStore, type ModalSettings } from '@codingcatdev/blackcatui';
6+
7+
import ProModal from './ProModal.svelte';
8+
9+
const showPro = () => {
10+
const d: ModalSettings = {
11+
type: 'component',
12+
component: {
13+
ref: ProModal
14+
}
15+
};
16+
modalStore.trigger(d);
17+
};
18+
</script>
19+
20+
<div class="flex flex-col gap-4 p-2">
21+
<div class="p-4 sm:p-10">
22+
<section class="">
23+
<div class="flex flex-col md:flex-row gap-2">
24+
<div class="flex flex-col w-full gap-2">
25+
<div class="bcu-card variant-filled">Welcome Message</div>
26+
<div class="bcu-card variant-filled">Join Discord for LBT</div>
27+
</div>
28+
<button
29+
class="bcu-card variant-filled-primary w-full max-w-sm p-8 relative hover:shadow-2xl hover:scale-105 hover:cursor-pointer ease-in-out duration-300"
30+
aria-label="open-pro-modal"
31+
on:click={showPro}
32+
>
33+
<div class="absolute top-0 right-0 mt-2 mr-2 md:mt-8 md:mr-8">
34+
<div class="bcu-button variant-filled-surface capitalize">Go Pro</div>
35+
</div>
36+
<h2>Pro</h2>
37+
<ul class="text-left text-md md:text-lg">
38+
<li class="my-2 flex flex-row gap-1 items-center">
39+
<Icon src={RocketLaunch} theme="solid" class="w-8" />
40+
Watch all PRO courses
41+
</li>
42+
<li class="my-2 flex flex-row gap-1 items-center">
43+
<Icon src={RocketLaunch} theme="solid" class="w-8" />
44+
Join PRO office hours
45+
</li>
46+
<li class="my-2 flex flex-row gap-1 items-center">
47+
<Icon src={RocketLaunch} theme="solid" class="w-8" />
48+
Read all PRO tutorials
49+
</li>
50+
<li class="my-2 flex flex-row gap-1 items-center">
51+
<Icon src={RocketLaunch} theme="solid" class="w-8" />
52+
Get PRO source code from GitHub
53+
</li>
54+
</ul>
55+
</button>
56+
</div>
57+
</section>
58+
</div>
59+
</div>
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<script lang="ts">
2+
import { Icon } from '@steeze-ui/svelte-icon';
3+
import { ArrowRightCircle, CheckCircle, RocketLaunch } from '@steeze-ui/heroicons';
4+
5+
import KcPrimary from '$lib/components/global/icons/KCPrimary.svelte';
6+
import AjPrimary from '$lib/components/global/icons/AJPrimary.svelte';
7+
8+
let monthly = true;
9+
10+
const onSelect = () => {
11+
monthly = !monthly;
12+
};
13+
const base = 'bcu-card p-2 md:p-8 flex flex-col items-center relative w-full hover:bg-opacity-90';
14+
</script>
15+
16+
<div class="bcu-card p-2 md:p-8 flex flex-col gap-2 md:gap-8">
17+
<div class="flex flex-col md:grid md:grid-cols-2 gap-2 md:gap-8">
18+
<button
19+
class={`${base} ${monthly ? 'variant-filled-primary' : 'variant-soft-primary'}`}
20+
on:click={onSelect}
21+
>
22+
{#if monthly}
23+
<div class="absolute top-0 right-0 mr-2 mt-2 ">
24+
<Icon src={CheckCircle} theme="solid" class="w-8" />
25+
</div>
26+
{/if}
27+
<span class="font-medium text-xl">Monthly</span>
28+
<div class="flex flex-row items-end justify-center mt-2">
29+
<span class="text-5xl font-bold">$25</span>
30+
<div class="mt-5">
31+
<span class="text-surface-50-900-token font-medium text-xl">/mo</span>
32+
</div>
33+
</div>
34+
<div class="mb-6">
35+
<span class="font-medium text-xs">Just $0.83 per day</span>
36+
</div>
37+
<KcPrimary />
38+
</button>
39+
<button
40+
class={`${base} ${!monthly ? 'variant-filled-primary' : 'variant-soft-primary'}`}
41+
on:click={onSelect}
42+
>
43+
{#if !monthly}
44+
<div class="absolute top-0 right-0 mr-2 mt-2 ">
45+
<Icon src={CheckCircle} theme="solid" class="w-8" />
46+
</div>
47+
{/if}
48+
<span class="font-medium text-xl">Annual</span>
49+
<div class="flex flex-row items-end justify-center mt-2">
50+
<span class="text-5xl font-bold">$225</span>
51+
<div class="mt-5">
52+
<span class="text-surface-50-900-token font-medium text-xl">/year</span>
53+
</div>
54+
</div>
55+
<div class="mb-6">
56+
<span class="font-medium text-xs">Save $75 compared to monthly</span>
57+
</div>
58+
<AjPrimary />
59+
</button>
60+
</div>
61+
<div>
62+
<div class="bcu-card variant-filled-primary p-2 md:p-8">
63+
<h2>Pro</h2>
64+
<ul class="text-left text-md md:text-lg">
65+
<li class="my-2 flex flex-row gap-1 items-center">
66+
<Icon src={RocketLaunch} theme="solid" class="w-8" />
67+
Watch all PRO courses
68+
</li>
69+
<li class="my-2 flex flex-row gap-1 items-center">
70+
<Icon src={RocketLaunch} theme="solid" class="w-8" />
71+
Join PRO office hours
72+
</li>
73+
<li class="my-2 flex flex-row gap-1 items-center">
74+
<Icon src={RocketLaunch} theme="solid" class="w-8" />
75+
Read all PRO tutorials
76+
</li>
77+
<li class="my-2 flex flex-row gap-1 items-center">
78+
<Icon src={RocketLaunch} theme="solid" class="w-8" />
79+
Get PRO source code from GitHub
80+
</li>
81+
</ul>
82+
</div>
83+
</div>
84+
85+
<button class="bcu-button variant-filled-surface flex self-end gap-2">
86+
Continue
87+
<Icon src={ArrowRightCircle} theme="solid" class="w-8" />
88+
</button>
89+
</div>

‎apps/codingcatdev/src/routes/+layout.server.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const load = (async ({ cookies }) => {
99
return {};
1010
}
1111
const decodedClaims = await ccdValidateSessionCookie(ccdsession);
12+
1213
return {
1314
user: decodedClaims
1415
};

‎apps/codingcatdev/src/routes/login/+page.svelte‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
1818
import type { PageData } from './$types';
1919
export let data: PageData;
20-
$: action = `?/login${data.redirectTo && '&redirectTo=' + data.redirectTo}`;
20+
$: action = `?/login&redirectTo=${data.redirectTo ? data.redirectTo : '/dashboard'}`;
2121
</script>
2222

2323
<LayoutWrapper>

‎apps/codingcatdev/src/styles/grid-card.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@layer components {
22
.ccd-grid-card {
3-
@apply bcu-card grid transition-all rounded-md shadow-lg hover:shadow-2xl hover:scale-105;
3+
@apply bcu-card grid transition-all rounded-md shadow-lg hover:shadow-2xl hover:scale-105 ease-in-out duration-150;
44
}
55
.ccd-grid-card a {
66
/* Override typograpy */

0 commit comments

Comments
 (0)