Skip to content

Commit

Permalink
Merge pull request #268 from COS301-SE-2024/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
bukhosi-eugene-mpande authored Sep 30, 2024
2 parents 95cbfe0 + 8b87ca9 commit 1485cd1
Show file tree
Hide file tree
Showing 63 changed files with 1,846 additions and 951 deletions.
6 changes: 6 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ignore:
- '**/*.svelte'
- '**/*.config.js'
- '**/*.config.ts'
- '**/*.d.ts'
- '**/database/schemas/*.ts'
6 changes: 6 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.17.0
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
Expand Down
Binary file modified src/bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"type": "module",
"dependencies": {
"@dimforge/rapier3d-compat": "^0.14.0",
"@google/model-viewer": "^3.5.0",
"@lucia-auth/adapter-mongodb": "^1.0.3",
"@node-rs/argon2": "^1.8.3",
"@sendgrid/mail": "^8.1.3",
Expand All @@ -85,6 +86,7 @@
"axios": "^1.7.2",
"bcrypt": "^5.1.1",
"canvas-confetti": "^1.9.3",
"csv-parse": "^5.5.6",
"date-fns": "^4.1.0",
"mongodb": "^6.8.0",
"mongoose": "^8.4.5",
Expand Down
10 changes: 10 additions & 0 deletions src/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
<title>ClassConnect</title>
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Loads <model-viewer> for modern browsers: -->
<script
type="module"
src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"
></script>
<!-- Loads <model-viewer> for old browsers like IE11: -->
<script
nomodule
src="https://unpkg.com/@google/model-viewer/dist/model-viewer-legacy.js"
></script>
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover" class="bg-white dark:bg-gray-700">
Expand Down
20 changes: 13 additions & 7 deletions src/src/lib/components/annotations/3dAnnotations.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@
annotations[text] = { position, text, labelDiv, sprite };
}
export function removeAnnotation(text: string) {
function removeAnnotation(text: string) {
const annotation = annotations[text];
if (annotation) {
document.body.removeChild(annotation.labelDiv);
console.log('Removing annotation', annotation.labelDiv);
if (annotation && annotation.labelDiv.parentNode) {
console.log('Removing annotation', annotation.labelDiv);
annotation.labelDiv.remove();
scene.remove(annotation.sprite);
delete annotations[text];
}
Expand Down Expand Up @@ -135,6 +137,12 @@
}
window.addEventListener('click', onMouseClick);
window.addEventListener('beforeunload', handleBeforeUnload);
document.addEventListener('removeAllAnnotations', () => {
Object.keys(annotations).forEach((text) => {
removeAnnotation(text);
});
});
return () => {
window.removeEventListener('beforeunload', handleBeforeUnload);
window.removeEventListener('click', onMouseClick);
Expand All @@ -153,7 +161,7 @@
raycaster = new THREE.Raycaster();
mouse = new THREE.Vector2();
const ambientLight = new THREE.AmbientLight(0x404040);
const ambientLight = new THREE.AmbientLight(0xffffff, 0.9);
scene.add(ambientLight);
const directionalLight = new THREE.DirectionalLight(0xffffff, 0.5);
directionalLight.position.set(1, 1, 1).normalize();
Expand All @@ -179,6 +187,7 @@
}
function removeAllAnnotations() {
console.log('removeAllAnnotations called');
Object.keys(annotations).forEach((text) => {
removeAnnotation(text);
});
Expand All @@ -187,9 +196,6 @@
function handleModelSelection(file_path: string) {
removeAllAnnotations();
loadModel(file_path);
const url = new URL(window.location.href);
url.searchParams.set('model', file_path);
window.history.pushState({}, '', url);
}
function animate() {
Expand Down
2 changes: 0 additions & 2 deletions src/src/lib/components/common/Navbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
const navLinks = {
admin: [
{ name: 'Dashboard', href: '/dashboard' },
{ name: 'Announcements', href: '/announcements' },
{ name: 'Organisation', href: '/organisation' },
{ name: 'Workspaces', href: '/workspaces' },
Expand All @@ -19,7 +18,6 @@
{ name: 'Announcements', href: '/announcements' }
],
student: [
{ name: 'Dashboard', href: '/dashboard' },
{ name: 'Workspaces', href: '/workspaces' },
{ name: 'Announcements', href: '/announcements' },
{ name: 'Grades', href: '/grades' }
Expand Down
2 changes: 1 addition & 1 deletion src/src/lib/components/forms/interactive/Notes.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

<Toaster />

<main class="container mx-auto p-4">
<main class="container mx-auto p-4 dark:bg-gray-700">
<div class="p-2 md:px-5 md:py-2">
<form method="POST" action="?/editContent" use:enhance={save}>
<div class="grid grid-cols-12 gap-6">
Expand Down
Loading

0 comments on commit 1485cd1

Please sign in to comment.