Skip to content

Commit c38e93a

Browse files
committed
update stores and course layout
1 parent 27bd61e commit c38e93a

12 files changed

Lines changed: 60 additions & 209 deletions

File tree

‎apps/codingcatdev/src/content/course/css-animations/index.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ slug: css-animations
77
start: July 22, 2022
88
title: CSS Animations
99
updated: July 23, 2022 7:13 AM
10+
youtube: https://youtu.be/5Z7v2LasFCU
1011
---
1112

1213
## Let’s Have Fun!
1314

1415
Why would you want to learn something boring, why not learn about raining cats, dogs, and unicorns! You will find examples of fun animations that you can take away with you in your projects. Each one of the lessons will have an associated [codepen](https://codepen.io/codercatdev) so you can [fork](https://blog.codepen.io/documentation/forks/#:~:text=%23How%20to%20Fork,ready%20to%20save%20your%20changes.) the example and keep it for yourself!
15-
16-
[https://media.codingcat.dev/video/upload/main-codingcatdev-video/raining-cats-dogs.mp4](https://media.codingcat.dev/video/upload/main-codingcatdev-video/raining-cats-dogs.mp4)

‎apps/codingcatdev/src/lib/stores/content/lesson.ts‎

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

‎apps/codingcatdev/src/lib/stores/layout/store.ts‎

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

apps/codingcatdev/src/routes/(layout-partials)/stores.ts renamed to apps/codingcatdev/src/lib/stores/stores.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Writable } from 'svelte/store';
33

44
// Set within root layout, persists current SvelteKit $page.url.pathname
55
export const storeCurrentUrl: Writable<string | undefined> = writable(undefined);
6+
export const overlayMenuActive = writable(false);
67

78
export interface User {
89
email?: string;

‎apps/codingcatdev/src/routes/(content-single)/(non-course)/+layout.svelte‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@
88
</script>
99

1010
<!-- App Shell -->
11-
<AppShell regionPage="overflow-y-scroll" slotPageFooter="pt-4 bg-surface-50-900-token" }>
11+
<AppShell
12+
regionPage="overflow-y-scroll"
13+
slotPageFooter="pt-4 bg-surface-50-900-token block xl:hidden"
14+
slotSidebarRight="hidden xl:block"
15+
>
1216
<!-- Page Content -->
1317
<slot />
1418
<svelte:fragment slot="bcu-app-shell-sidebar-right">
1519
<!-- Div takes up same room as fixed -->
1620
<div class="w-[19.5rem] xl:w-96" />
17-
<div
18-
class="fixed z-20 top-[5.125rem] bottom-24 w-[19.5rem] xl:w-96 py-10 overflow-y-auto hidden xl:block"
19-
>
21+
<div class="fixed z-20 top-[5.125rem] bottom-24 w-[19.5rem] xl:w-96 py-10 overflow-y-auto">
2022
<div class="px-8 flex flex-col gap-2 md:gap-8">
2123
<TableOfContents target=".markdown" />
2224
<RecentPostsList contentType={ContentType.course} list={data.course} />
@@ -26,5 +28,12 @@
2628
</div>
2729
</div>
2830
</svelte:fragment>
29-
<!-- <svelte:fragment slot="bcu-app-shell-page-footer">new</svelte:fragment> -->
31+
<svelte:fragment slot="bcu-app-shell-page-footer">
32+
<div class="px-2 flex flex-col gap-2 md:gap-8">
33+
<RecentPostsList contentType={ContentType.course} list={data.course} />
34+
<RecentPostsList contentType={ContentType.tutorial} list={data.tutorial} />
35+
<RecentPostsList contentType={ContentType.podcast} list={data.podcast} />
36+
<RecentPostsList contentType={ContentType.post} list={data.post} />
37+
</div>
38+
</svelte:fragment>
3039
</AppShell>

‎apps/codingcatdev/src/routes/(content-single)/course/[slug]/Course.svelte‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<script lang="ts">
22
import 'prism-themes/themes/prism-shades-of-purple.min.css';
33
import Video from '$lib/components/content/Video.svelte';
4-
import type { Lesson } from '$lib/types';
4+
import type { Course } from '$lib/types';
5+
import LessonCards from './LessonCards.svelte';
56
export let data: {
6-
course: Lesson;
7+
course: Course;
78
};
89
</script>
910

1011
{#if data?.course}
11-
<div class="flex justify-center !text-token">
12-
<section class="justify-center p-1 course-single xl:p-8 sm:flex">
13-
<div class="p-1">
12+
<div class="flex flex-col justify-center !text-token p-1 xl:p-8">
13+
<section class="justify-center flex flex-col gap-2 md:gap-8">
14+
<div class="flex flex-col gap-2 md:gap-8">
1415
{#if data?.course?.youtube}
1516
<Video
1617
sources={[
@@ -22,10 +23,16 @@
2223
/>
2324
{/if}
2425

25-
<section class="flex-grow w-full prose lg:prose-xl xl:prose-2xl">
26+
<section class="flex-grow w-full markdown flex flex-col gap-2 md:gap-8">
2627
{@html data.course.html}
2728
</section>
2829
</div>
30+
{#if data?.course?.lesson}
31+
<div class="flex flex-col gap-2 md:gap-8">
32+
<h2>Lessons</h2>
33+
<LessonCards lesson={data.course.lesson} courseSlug={data.course.slug} />
34+
</div>
35+
{/if}
2936
</section>
3037
</div>
3138
{:else}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<script lang="ts">
2+
import type { Lesson } from '$lib/types';
3+
4+
export let lesson: Lesson[];
5+
export let courseSlug: string;
6+
</script>
7+
8+
<section class="flex gap-2 md:gap-8">
9+
{#each lesson as l}
10+
<a href={`/course/${courseSlug}/lesson/${l.slug}`} class="link-primary">
11+
<div class="bcu-card">
12+
<header class="bcu-card-header capitalize pb-2 text-xl font-bold">{l.title}</header>
13+
</div>
14+
</a>
15+
{/each}
16+
</section>

apps/codingcatdev/src/routes/(content-single)/course/[slug]/+layout.svelte renamed to apps/codingcatdev/src/routes/(content-single)/course/[slug]/lesson/[lessonSlug]/+layout.svelte

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,28 @@
88
</script>
99

1010
<!-- App Shell -->
11-
<AppShell regionPage="overflow-y-scroll" slotPageFooter="pt-4 bg-surface-50-900-token" }>
11+
<AppShell
12+
regionPage="overflow-y-scroll"
13+
slotPageFooter="pt-4 bg-surface-50-900-token block lg:hidden"
14+
slotSidebarRight="hidden lg:block"
15+
>
1216
<!-- Page Content -->
1317
<slot />
1418
<svelte:fragment slot="bcu-app-shell-sidebar-right">
1519
<!-- Div takes up same room as fixed -->
1620
<div class="w-[19.5rem] xl:w-96" />
17-
<div
18-
class="fixed z-20 top-[5.125rem] bottom-24 w-[19.5rem] xl:w-96 py-10 overflow-y-auto hidden xl:block"
19-
>
21+
<div class="fixed z-20 top-[5.125rem] bottom-24 w-[19.5rem] xl:w-96 py-10 overflow-y-auto ">
2022
<div class="px-8 flex flex-col gap-2 md:gap-8">
2123
<TableOfContents target=".markdown" />
2224
{#if data?.course?.lesson && data?.course?.lesson.length > 0 && data?.course?.slug}
23-
<div class="hidden xl:block">
24-
<LessonList courseSlug={data?.course?.slug} lesson={data.course.lesson} />
25-
</div>
25+
<LessonList courseSlug={data?.course?.slug} lesson={data.course.lesson} />
2626
{/if}
2727
</div>
2828
</div>
2929
</svelte:fragment>
30-
<!-- <svelte:fragment slot="bcu-app-shell-page-footer">new</svelte:fragment> -->
30+
<svelte:fragment slot="bcu-app-shell-page-footer">
31+
{#if data?.course?.lesson && data?.course?.lesson.length > 0 && data?.course?.slug}
32+
<LessonList courseSlug={data?.course?.slug} lesson={data.course.lesson} />
33+
{/if}
34+
</svelte:fragment>
3135
</AppShell>

apps/codingcatdev/src/routes/(content-single)/course/[slug]/LessonList.svelte renamed to apps/codingcatdev/src/routes/(content-single)/course/[slug]/lesson/[lessonSlug]/LessonList.svelte

File renamed without changes.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
drawerStore.open(s);
2020
}
2121
22-
import { storeCurrentUrl, storeUser } from '../(layout-partials)/stores';
22+
import { storeCurrentUrl, storeUser } from '$lib/stores/stores';
2323
import LogoutButton from '../login/LogoutButton.svelte';
2424
2525
$: classesActive = (href: string) =>

0 commit comments

Comments
 (0)