Skip to content

Commit

Permalink
ui tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
hexxt-git committed Mar 23, 2024
1 parent 4c27238 commit 771bc6e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
--background-2: #26292a;
--background-3: #282828;
--strong-shadow: #8883 0px 0px 10px;
--strong-shadow: #8882 0px 0px 50px;
--medium-shadow: #0002 0px 5px 10px;
--weak-shadow: #fff3 0px 0px 14px;
--window-shadow: #4442 0px 5px 10px;
Expand Down
9 changes: 6 additions & 3 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
import { load } from './helper.js';
import { notify } from './notification_store';
import { onMount } from 'svelte';
// load("https://walrus-app-mwr59.ondigitalocean.app/api/fac/all").then(faculties => {
// console.table(faculties);
// })
notify({
state: "notification",
message: "the website is still a work in progress please be patient and report any bugs you find. dont start contributing just yet",
onMount(()=>{
notify({
state: "notification",
message: "the website is still a work in progress please be patient and report any bugs you find. dont start contributing just yet",
})
})
</script>
Expand Down
4 changes: 4 additions & 0 deletions src/routes/Faculty.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
</div>
{/each}
</div>
{#if selected_group_id != -1}
<hr>
{/if}
<div class="collumn">
{#each modules as module}
<!-- svelte-ignore a11y-click-events-have-key-events -->
Expand All @@ -56,7 +58,9 @@
</div>
{/each}
</div>
{#if selected_group_id != -1 && selected_module_id != -1}
<hr>
{/if}
<div class="collumn">
{#if selected_module_id !== -1}
{#await load(`https://walrus-app-mwr59.ondigitalocean.app/api/module/${selected_module_id}/getcount/`) then counts}
Expand Down
25 changes: 17 additions & 8 deletions src/routes/Notification.svelte
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
<script>
import { onMount } from 'svelte';
import { onMount, onDestroy } from 'svelte';
export let state = "error"
export let message = "an error must have occured"
export let id = 0
export let duration = 30*1000
import {delete_notification} from './notification_store'
setTimeout(()=>delete_notification(id), duration)
let time = 0;
onMount(()=>{
let update_time = _ => {
time += 16
requestAnimationFrame(update_time)
let interval;
onMount(() => {
interval = setInterval(() => {
time += 50;
if (time >= duration) {
delete_notification(id);
clearInterval(interval);
}
}, 50);
});
onDestroy(() => {
if (interval) {
clearInterval(interval);
}
update_time()
})
});
</script>

<main class={state}>
Expand Down

0 comments on commit 771bc6e

Please sign in to comment.