-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
88 changed files
with
3,923 additions
and
1,702 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "dependencies": { "@types/three": "^0.168.0" } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare module '*.svelte' { | ||
import type { ComponentType } from 'svelte'; | ||
const component: ComponentType; | ||
export default component; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,92 @@ | ||
<!-- | ||
<script> | ||
import { Avatar, Navbar, DarkMode } from 'flowbite-svelte'; | ||
import BreadCrumbs from '$lib/components/common/Breadcrumbs.svelte'; | ||
import { change } from '$lib/store'; | ||
import { getUserData } from '$lib/utils'; | ||
import { onMount } from 'svelte'; | ||
export let data; | ||
$: ({ name, image, maps } = data); | ||
let isMobile; | ||
async function updateUserData() { | ||
try { | ||
const user = await getUserData(); | ||
name = user.name; | ||
image = user.image; | ||
} catch (error) { | ||
console.error('There was a problem with the get operation:', error); | ||
} | ||
} | ||
onMount(async () => { | ||
updateUserData(); | ||
const checkMobile = () => { | ||
isMobile = window.innerWidth < 768; | ||
}; | ||
checkMobile(); | ||
window.addEventListener('resize', checkMobile); | ||
return () => { | ||
window.removeEventListener('resize', checkMobile); | ||
}; | ||
}); | ||
$: { | ||
change.subscribe(async () => { | ||
await updateUserData(); | ||
}); | ||
} | ||
</script> | ||
<Navbar data-testid="navbar"> | ||
<BreadCrumbs {maps} /> | ||
<div class="m-4 {isMobile ? 'ml-4' : 'ml-72'}"> | ||
<Navbar | ||
data-testid="navbar" | ||
class="glassmorphic rounded-xl bg-white/60 px-4 py-2 shadow-md dark:bg-gray-900/60 transition-all duration-300 ease-in-out" | ||
> | ||
{#if !isMobile} | ||
<BreadCrumbs {maps} /> | ||
{/if} | ||
<div class="flex items-center md:order-2"> | ||
<DarkMode | ||
class="mx-2 border text-gray-500 dark:border-gray-800 dark:text-gray-600" | ||
data-testid="darkmode" | ||
/> | ||
<div class="flex items-center md:order-2"> | ||
<DarkMode | ||
class="mx-2 border text-gray-500 dark:border-gray-800 dark:text-gray-600" | ||
data-testid="darkmode" | ||
/> | ||
<Avatar id="avatar-menu" src={image} class="mx-2" data-testid="avatar" /> | ||
<Avatar id="avatar-menu" src={image} class="mx-2" data-testid="avatar" /> | ||
<div class="mx-2"> | ||
<div class="text-lg font-semibold">{name}</div> | ||
{#if !isMobile} | ||
<div class="mx-2"> | ||
<div class="text-lg font-semibold">{name}</div> | ||
</div> | ||
{/if} | ||
</div> | ||
</div> | ||
</Navbar> | ||
</Navbar> | ||
</div> | ||
<style> | ||
.glassmorphic { | ||
backdrop-filter: blur(10px); | ||
-webkit-backdrop-filter: blur(10px); | ||
position: relative; | ||
overflow: hidden; | ||
} | ||
.glassmorphic::before { | ||
content: ""; | ||
position: absolute; | ||
top: -50%; | ||
left: -50%; | ||
width: 200%; | ||
height: 200%; | ||
background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%); | ||
transform: rotate(30deg); | ||
pointer-events: none; | ||
} | ||
</style> | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<script lang="ts"> | ||
import { Navbar, NavBrand, NavLi, NavUl, NavHamburger } from 'flowbite-svelte'; | ||
export let role: 'lecturer' | 'admin' | 'student'; | ||
export let activeUrl = ''; | ||
const navLinks = { | ||
admin: [ | ||
{ name: 'Dashboard', href: '/dashboard' }, | ||
{ name: 'Announcements', href: '/announcements' }, | ||
{ name: 'Organisation', href: '/organisation' }, | ||
{ name: 'Workspaces', href: '/workspaces' }, | ||
{ name: 'Admins', href: '/admins' }, | ||
{ name: 'Lecturers', href: '/lecturers' }, | ||
{ name: 'Students', href: '/students' } | ||
], | ||
lecturer: [ | ||
{ name: 'Workspaces', href: '/workspaces' }, | ||
{ name: 'Announcements', href: '/announcements' } | ||
], | ||
student: [ | ||
{ name: 'Dashboard', href: '/dashboard' }, | ||
{ name: 'Workspaces', href: '/workspaces' }, | ||
{ name: 'Announcements', href: '/announcements' }, | ||
{ name: 'Grades', href: '/grades' } | ||
] | ||
}; | ||
const commonLinks = [ | ||
{ name: 'Settings', href: '/settings' }, | ||
{ name: 'FAQ', href: '/faq' } | ||
]; | ||
const currentLinks = navLinks[role]; | ||
</script> | ||
|
||
<Navbar class="fixed start-0 top-0 z-20 w-full border-b px-2 py-2.5 sm:px-4"> | ||
<NavBrand href="/"> | ||
<img src="images/class-connect-logo.png" class="mr-3 h-8 sm:h-10" alt="ClassConnect Logo" /> | ||
<span | ||
class="self-center whitespace-nowrap text-xl font-semibold text-gray-800 transition-colors duration-300 dark:text-white" | ||
>ClassConnect</span | ||
> | ||
</NavBrand> | ||
<NavHamburger /> | ||
<NavUl> | ||
{#each currentLinks as { name, href }} | ||
<NavLi {href} active={activeUrl === href}> | ||
{name} | ||
</NavLi> | ||
{/each} | ||
{#each commonLinks as { name, href }} | ||
<NavLi {href} active={activeUrl === href}> | ||
{name} | ||
</NavLi> | ||
{/each} | ||
</NavUl> | ||
</Navbar> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.