Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

11.1 release: Skeleton V3 + theme overhaul #882

Merged
merged 86 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
5fed89d
first skeleton 3 attempt
edeleastar Nov 22, 2024
43e682f
incorporate new card component + sidebars for toc
edeleastar Nov 23, 2024
13a4398
style updates
edeleastar Nov 23, 2024
359c7c3
style adjustments
edeleastar Nov 23, 2024
200ba6e
change progress component
edeleastar Nov 23, 2024
4ed7e0d
implement compact layout
emmaroche Nov 23, 2024
168aa46
Merge pull request #857 from emmaroche/ux/skeleton-3
edeleastar Nov 24, 2024
74cffd8
connected menus implemented
edeleastar Nov 24, 2024
b53ae97
toolbar adjustments
edeleastar Nov 24, 2024
bd9da1c
simplify navigators + introduce tooltips
edeleastar Nov 24, 2024
06cd5c8
card adjustments
edeleastar Nov 24, 2024
1d0e84a
more style adjustments
edeleastar Nov 24, 2024
90aa31b
menu refactors
edeleastar Nov 25, 2024
e10e32c
bring back calendar + include close buttons in popovers
edeleastar Nov 25, 2024
268dda7
generalise menu handling + fix display mode persistence
edeleastar Nov 25, 2024
1238584
student online implemented
edeleastar Nov 25, 2024
091a741
remove redundant code
edeleastar Nov 25, 2024
5ee96c0
fix for wall title issue
edeleastar Nov 25, 2024
6570a84
remove light mode change from theme change
edeleastar Nov 25, 2024
321030a
reorganise ui component structure
edeleastar Nov 25, 2024
ffe5938
library updates
edeleastar Nov 26, 2024
7cc32fe
Merge pull request #858 from tutors-sdk/ux/skeleton-3
edeleastar Nov 26, 2024
62ae305
set light as default mode
edeleastar Nov 26, 2024
24ab337
Merge pull request #859 from tutors-sdk/fix/mode-fix
edeleastar Nov 26, 2024
b728316
Update default tutors theme
emmaroche Nov 26, 2024
06ef291
Create classic theme
emmaroche Nov 26, 2024
a4930f9
Merge pull request #860 from emmaroche/ux/update-themes
edeleastar Nov 26, 2024
f4376b6
persist theme choice in local storage
edeleastar Nov 26, 2024
31d8ca7
Merge pull request #861 from tutors-sdk/fix/persist-theme
edeleastar Nov 26, 2024
7f1307b
+ additional themes
edeleastar Nov 26, 2024
9ac9033
Merge pull request #862 from tutors-sdk/fix/persist-theme
edeleastar Nov 26, 2024
92af419
update dyslexia theme
emmaroche Nov 26, 2024
75102c3
Merge pull request #863 from emmaroche/ux/update-themes
edeleastar Nov 26, 2024
6ad0863
change icon lookup
edeleastar Nov 27, 2024
8577fdd
Merge pull request #864 from tutors-sdk/fix/theme-lookup
edeleastar Nov 27, 2024
067f02e
enhance lab nav respnsiveness
edeleastar Nov 27, 2024
52f151e
Merge pull request #865 from tutors-sdk/fix/lab-responsive
edeleastar Nov 27, 2024
134155a
sign in screen styles
edeleastar Nov 27, 2024
43b1d63
updated styles
edeleastar Nov 27, 2024
65f02b1
dynamic footer
edeleastar Nov 27, 2024
97c7867
Merge pull request #866 from tutors-sdk/ux/dynamic-footer
edeleastar Nov 27, 2024
8361913
Add border to lab navbar
emmaroche Nov 27, 2024
95f242e
Add active styling to theme menu
emmaroche Nov 27, 2024
40c31bf
Merge pull request #867 from emmaroche/ux/theme-updates
edeleastar Nov 27, 2024
4790e1a
animate footer + correct z-axis on tooltips
edeleastar Nov 27, 2024
2d3117e
Merge pull request #868 from tutors-sdk/ux/animate-footer
edeleastar Nov 27, 2024
58dd7f4
bump to 11.1.0
edeleastar Nov 27, 2024
f0fe50a
start favourites on dashboard
edeleastar Nov 28, 2024
96854e7
complete favourites implementation
edeleastar Nov 28, 2024
c27a582
Merge pull request #869 from tutors-sdk/features/favourites
edeleastar Nov 28, 2024
841dd4a
links style update
edeleastar Nov 28, 2024
8e20a38
disable tooltip
edeleastar Nov 28, 2024
35b6951
Merge pull request #870 from tutors-sdk/ux/links-style
edeleastar Nov 28, 2024
e2c7c02
animation effect
edeleastar Nov 28, 2024
a7cc0d9
Merge pull request #871 from tutors-sdk/ux/links-style
edeleastar Nov 28, 2024
1a3664b
home page animation - remove redundant
edeleastar Dec 2, 2024
2b56c40
correct sign in animation
edeleastar Dec 2, 2024
09e74f5
define animation styles
edeleastar Dec 2, 2024
02627d4
formatting adjusements
edeleastar Dec 2, 2024
0e1ed7f
formatting adjustments
edeleastar Dec 2, 2024
3922edc
core animations
edeleastar Dec 2, 2024
e708ca7
core animations
edeleastar Dec 2, 2024
75392d0
Merge pull request #872 from tutors-sdk/ux/animations
edeleastar Dec 2, 2024
4057161
introduce christmas theme
emmaroche Dec 2, 2024
a228bb0
Merge pull request #873 from emmaroche/theme/festive-theme
edeleastar Dec 2, 2024
373425d
animation adjustments
edeleastar Dec 2, 2024
c000fb3
Merge pull request #874 from tutors-sdk/ux/animations
edeleastar Dec 2, 2024
70f9d2c
tsParticles snow associated with festive theme
edeleastar Dec 3, 2024
24ef846
Merge pull request #875 from tutors-sdk/ux/particles
edeleastar Dec 3, 2024
f6264f1
update snow background for light mode
emmaroche Dec 3, 2024
5bd48aa
add christmas icons to festive theme
emmaroche Dec 3, 2024
3b77e99
Merge pull request #876 from emmaroche/theme/festive-theme
edeleastar Dec 3, 2024
ff9f1a1
festive theme adjustments
edeleastar Dec 3, 2024
2f5e43a
responsive improvements
edeleastar Dec 4, 2024
d3ba5d8
Merge pull request #877 from tutors-sdk/tweaks/navigator-fixes
edeleastar Dec 4, 2024
9354f03
refine archive link transform strategy
edeleastar Dec 4, 2024
6ad2406
Merge pull request #878 from tutors-sdk/fix/archives-link
edeleastar Dec 4, 2024
f561666
first pass
edeleastar Dec 5, 2024
bfc6481
second pass
edeleastar Dec 5, 2024
51f49f3
restructure themes
edeleastar Dec 5, 2024
07f667f
intorduce theme types - refactor as a service object
edeleastar Dec 5, 2024
9a4b538
Merge pull request #879 from tutors-sdk/refactor/ux-taxonomy
edeleastar Dec 5, 2024
fdfbb0e
change to relative path for pdfdist (experiment)
edeleastar Dec 5, 2024
6b8ccdf
Merge pull request #880 from tutors-sdk/refactor/ux-taxonomy
edeleastar Dec 5, 2024
cadbd32
one off force theme
edeleastar Dec 6, 2024
752c2e4
Merge pull request #881 from tutors-sdk/ux/force-theme
edeleastar Dec 6, 2024
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
988 changes: 766 additions & 222 deletions package-lock.json

Large diffs are not rendered by default.

43 changes: 21 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,27 @@
"lint": "prettier --check . && eslint ."
},
"devDependencies": {
"@auth/core": "^0.37.3",
"@auth/sveltekit": "^1.7.3",
"@floating-ui/dom": "^1.6.12",
"@auth/core": "^0.37.4",
"@auth/sveltekit": "^1.7.4",
"@iconify/svelte": "^4.0.2",
"@iktakahiro/markdown-it-katex": "^4.0.1",
"@skeletonlabs/skeleton": "^2.10.3",
"@skeletonlabs/tw-plugin": "^0.4.0",
"@skeletonlabs/skeleton": "^3.0.0-next.9",
"@skeletonlabs/skeleton-svelte": "^1.0.0-next.14",
"@supabase/supabase-js": "^2.46.1",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-auto": "^3.3.1",
"@sveltejs/adapter-netlify": "^4.3.6",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@sveltejs/kit": "^2.8.4",
"@sveltejs/vite-plugin-svelte": "^4.0.2",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15",
"@types/eslint": "^9.6.0",
"@types/node": "^22.9.0",
"@types/eslint": "^9.6.1",
"@types/node": "^22.10.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.7.0",
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"eslint-plugin-svelte": "^2.46.0",
"file-saver": "^2.0.5",
"globals": "^15.0.0",
"globals": "^15.12.0",
"highlight.js": "^11.10.0",
"markdown-it": "^14.1.0",
"markdown-it-anchor": "^9.2.0",
Expand All @@ -47,14 +46,14 @@
"markdown-it-table-of-contents": "^0.8.0",
"partysocket": "^1.0.2",
"pdfjs-dist": "^4.8.69",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.5",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"tailwindcss": "^3.4.9",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"vite": "^5.0.3"
"prettier": "^3.4.0",
"prettier-plugin-svelte": "^3.3.2",
"prettier-plugin-tailwindcss": "^0.6.9",
"svelte": "^5.2.8",
"svelte-check": "^4.1.0",
"tailwindcss": "^3.4.15",
"typescript": "^5.7.2",
"typescript-eslint": "^8.16.0",
"vite": "^5.4.11"
}
}
3 changes: 0 additions & 3 deletions src/app.css

This file was deleted.

1 change: 1 addition & 0 deletions src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap"
rel="stylesheet"
/>
<script src="https://cdn.jsdelivr.net/npm/@tsparticles/preset-snow@3/tsparticles.preset.snow.bundle.min.js"></script>
</head>

<body data-theme="tutors">
Expand Down
9 changes: 9 additions & 0 deletions src/app.postcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind variants;

html,
body {
@apply h-full overflow-hidden;
}
14 changes: 13 additions & 1 deletion src/lib/runes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@ import type { Lo, Course } from "$lib/services/models/lo-types";
import { rune } from "./services/utils/runes.svelte";

export const transitionKey = rune("");

export const layout = rune("expanded");
export const lightMode = rune("light");
export const currentTheme = rune("tutors");

export const currentLo = rune<Lo | null>(null);
export const currentCourse = rune<Course | null>(null);
export const courseUrl = rune("");
export const currentLabStepIndex = rune(0);
export const currentTheme = rune("tutors");

export const cardHeight = rune("380px");
export const headingText = rune("!text-lg font-semibold");
export const cardWidths = rune("w-60 h-[21rem]");
export const iconHeight = rune("140");
export const imageHeight = rune("h-32");
export const textSize = rune("text-base");
export const avatarWidth = rune("w-12");

export const animationDelay = rune(200);
12 changes: 10 additions & 2 deletions src/lib/services/connect.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,16 @@ export const tutorsConnectService: TutorsConnectService = {
}
},

deleteCourseVisit(courseId: string) {
this.profile.deleteCourseVisit(courseId);
async favouriteCourse(courseId: string) {
await this.profile.favouriteCourse(courseId);
},

async unfavouriteCourse(courseId: string) {
await this.profile.unfavouriteCourse(courseId);
},

async deleteCourseVisit(courseId: string) {
await this.profile.deleteCourseVisit(courseId);
},

getCourseVisits(): Promise<CourseVisit[]> {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/services/models/course-utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addIcon } from "$lib/ui/themes/styles/icon-lib.svelte";
import { themeService } from "$lib/ui/themes/theme-controller.svelte";
import type { Composite, Course, IconNav, Lo, LoType, Topic } from "./lo-types";
import { filterByType, setShowHide } from "./lo-utils";

Expand Down Expand Up @@ -51,7 +51,7 @@ export function createCompanions(course: Course) {
if (course.properties.companions) {
for (const [key, value] of Object.entries(course.properties.companions)) {
const companion: any = value;
addIcon(key, companion.icon);
themeService.addIcon(key, companion.icon);
course.companions.bar.push({
link: companion.link,
type: key,
Expand Down
8 changes: 4 additions & 4 deletions src/lib/services/models/live-lab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ function getKeyIndex(map: Map<string, string>, targetKey: string) {
}

function truncate(input: string) {
if (input?.length > 16) {
return input.substring(0, 15) + "...";
if (input?.length > 24) {
return input.substring(0, 20) + "...";
}
return input;
}
Expand Down Expand Up @@ -77,7 +77,7 @@ export class LiveLab {
const prevTitle = prevChapter ? truncate(this.chaptersTitles.get(prevChapter.shortTitle)) : "";
if (prevTitle) number = this.autoNumber ? prevChapter.shortTitle + ": " : "";
this.horizontalNavbarHtml = prevChapter
? `<a class="btn btn-sm capitalize" href="${this.url}/${encodeURI(prevChapter.shortTitle)}"> <span aria-hidden="true">&larr;</span>&nbsp; ${number}${prevTitle} </a>`
? `<a class="btn btn-sm text-base capitalize" href="${this.url}/${encodeURI(prevChapter.shortTitle)}"> <span aria-hidden="true">&larr;</span>&nbsp; ${number}${prevTitle} </a>`
: "";

number = "";
Expand All @@ -87,7 +87,7 @@ export class LiveLab {
// @ts-ignore
const nextTitle = nextChapter ? truncate(this.chaptersTitles.get(nextChapter.shortTitle)) : "";
this.horizontalNavbarHtml += nextChapter
? `<a class="ml-auto btn btn-sm capitalize" style="margin-left: auto" href="${this.url}/${encodeURI(
? `<a class="ml-auto btn btn-sm capitalize text-base" style="margin-left: auto" href="${this.url}/${encodeURI(
nextChapter.shortTitle
)}"> ${number}${nextTitle} &nbsp;<span aria-hidden="true">&rarr;</span></a>`
: "";
Expand Down
7 changes: 7 additions & 0 deletions src/lib/services/models/lo-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ export type IconNavBar = {
bar: IconNav[];
};

export type IconLib = Record<string, IconType>;

export type Theme = {
name: string;
icons: IconLib;
};

export interface LearningRecord {
date: Date;
pageLoads: number;
Expand Down
9 changes: 6 additions & 3 deletions src/lib/services/models/markdown-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ function filter(src: string, url: string): string {
let filtered = replaceAll(src, "./img\\/", `img/`);
filtered = replaceAll(filtered, "img\\/", `https://${url}/img/`);
filtered = replaceAll(filtered, "./archives\\/", `archives/`);
filtered = replaceAll(filtered, "archives\\/", `https://${url}/archives/`);
filtered = replaceAll(filtered, "./archive\\/(?!refs)", `archive/`);
filtered = replaceAll(filtered, "archive\\/(?!refs)", `https://${url}/archive/`);

//filtered = replaceAll(filtered, "archives\\/", `https://${url}/archives/`);
filtered = replaceAll(filtered, "(?<!/)archives\\/", `https://${url}/archives/`);

// filtered = replaceAll(filtered, "./archive\\/(?!refs)", `archive/`);
filtered = replaceAll(filtered, "(?<!/)archive\\/(?!refs)", `https://${url}/archive/`);
filtered = replaceAll(filtered, "\\]\\(\\#", `](https://${url}#/`);
return filtered;
}
Expand Down
38 changes: 30 additions & 8 deletions src/lib/services/profiles/localStorageProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ import type { CourseVisit, ProfileStore } from "../types.svelte";
export const localStorageProfile: ProfileStore = {
courseVisits: [] as CourseVisit[],

reload(): void {},
save(): void {},

logCourseVisit(course: Course) {
reload(): void {
if (browser && localStorage.courseVisits) {
this.courseVisits = JSON.parse(localStorage.courseVisits);
}
},
save(): void {
if (browser) localStorage.courseVisits = JSON.stringify(this.courseVisits);
},

logCourseVisit(course: Course) {
this.reload();
const visit = this.courseVisits.find((c) => c.id === course.courseId);
if (visit) {
visit.visits++;
Expand All @@ -31,18 +35,36 @@ export const localStorageProfile: ProfileStore = {
}
this.courseVisits.unshift(courseVisit);
}
if (browser) localStorage.courseVisits = JSON.stringify(this.courseVisits);
this.save();
},

deleteCourseVisit(courseId: string) {
this.reload();
this.courseVisits = this.courseVisits.filter((c) => c.id !== courseId);
if (browser) localStorage.courseVisits = JSON.stringify(this.courseVisits);
this.save();
},

getCourseVisits(): Promise<CourseVisit[]> {
if (browser && localStorage.courseVisits) {
this.courseVisits = JSON.parse(localStorage.courseVisits);
}
this.reload();
return this.courseVisits;
},

favouriteCourse(courseId: string) {
this.reload();
const courseVisit = this.courseVisits.find((c) => c.id === courseId);
if (courseVisit) {
courseVisit.favourite = true;
}
this.save();
},

unfavouriteCourse(courseId: string) {
this.reload();
const courseVisit = this.courseVisits.find((c) => c.id === courseId);
if (courseVisit) {
courseVisit.favourite = false;
}
this.save();
}
};
18 changes: 18 additions & 0 deletions src/lib/services/profiles/supabaseProfile.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,23 @@ export const supabaseProfile: ProfileStore = {
async getCourseVisits(): Promise<CourseVisit[]> {
await this.reload();
return this.courseVisits;
},

async favouriteCourse(courseId: string) {
await this.reload();
const course = this.courseVisits.find((c) => c.id === courseId);
if (course) {
course.favourite = true;
}
await this.save();
},

async unfavouriteCourse(courseId: string) {
await this.reload();
const course = this.courseVisits.find((c) => c.id === courseId);
if (course) {
course.favourite = false;
}
await this.save();
}
};
18 changes: 18 additions & 0 deletions src/lib/services/types.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type CourseVisit = {
credits: string;
visits?: number;
private: boolean;
favourite: boolean;
};

export interface LoUser {
Expand All @@ -43,6 +44,19 @@ export class LoRecord {
}
}

export interface CardDetails {
route: string;
title: string;
type: string;
subtitle1?: string;
subtitle2?: string;
summary?: string;
icon?: IconType;
img?: string;
student?: LoUser;
video?: string;
}

export interface CourseService {
courses: Map<string, Course>;
labs: Map<string, LiveLab>;
Expand All @@ -62,6 +76,8 @@ export interface ProfileStore {
reload(): void;
save(): void;
logCourseVisit(course: Course): void;
favouriteCourse(courseId: string): void;
unfavouriteCourse(courseId: string): void;
deleteCourseVisit(courseId: string): void;
getCourseVisits(): Promise<CourseVisit[]>;
}
Expand All @@ -81,6 +97,8 @@ export interface TutorsConnectService {
courseVisit(course: Course, user: TutorsId): void;
deleteCourseVisit(courseId: string): void;
getCourseVisits(): Promise<CourseVisit[]>;
favouriteCourse(courseId: string): void;
unfavouriteCourse(courseId: string): void;

learningEvent(params: Record<string, string>): void;
startTimer(): void;
Expand Down
25 changes: 25 additions & 0 deletions src/lib/ui/TutorsShell.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script lang="ts">
import Footer from "$lib/ui/navigators/footers/Footer.svelte";
import SecondaryNavigator from "$lib/ui/navigators/SecondaryNavigator.svelte";
import { currentCourse, transitionKey } from "$lib/runes";
import type { Snippet } from "svelte";
import MainNavigator from "./navigators/MainNavigator.svelte";

type Props = { children: Snippet };
let { children }: Props = $props();
</script>

<div class="grid h-screen grid-rows-[auto_1fr_auto]">
<header class="sticky top-0 bg-surface-100 dark:bg-surface-950">
<MainNavigator />
{#if currentCourse?.value}
<SecondaryNavigator />
{/if}
</header>
<main class="mt-2 overflow-y-auto">
{@render children()}
</main>
<footer class="hidden lg:block">
<Footer />
</footer>
</div>
27 changes: 0 additions & 27 deletions src/lib/ui/animations.ts

This file was deleted.

Loading
Loading