nathanielfernandes / cps630-project

4 stars 0 forks source link

responsive website nav #15

Closed Dev-Zhao closed 5 months ago

Dev-Zhao commented 5 months ago

Created a responsive website nav that supports both light and dark mode. image image

Features:

Most links don't work atm, they are just placeholder, same with the search.

nathanielfernandes commented 5 months ago

move images/assets to /static

nathanielfernandes commented 5 months ago

https://github.com/nathanielfernandes/cps630-project/blob/t2_Charlie/src/routes/%2Blayout.svelte#L50-L75

is just the regular js way of doing things, use svelte to get this done in a cleaner way

ex. https://svelte.dev/repl/af08522f04c74850959f00c978db00f7?version=3.29.0

nathanielfernandes commented 5 months ago

https://github.com/nathanielfernandes/cps630-project/blob/t2_Charlie/src/routes/%2Blayout.svelte#L29-L45

could you explain replace image with bad image is doing, as well as the handle profile image error

Dev-Zhao commented 5 months ago

https://github.com/nathanielfernandes/cps630-project/blob/t2_Charlie/src/routes/%2Blayout.svelte#L50-L75

is just the regular js way of doing things, use svelte to get this done in a cleaner way

ex. https://svelte.dev/repl/af08522f04c74850959f00c978db00f7?version=3.29.0

The point of the function is to hide the menu when something on the page is clicked that's not the menu or the menu trigger button. The method you linked doesn't do that.

Dev-Zhao commented 5 months ago

move images/assets to /static

done

Dev-Zhao commented 5 months ago

https://github.com/nathanielfernandes/cps630-project/blob/t2_Charlie/src/routes/%2Blayout.svelte#L29-L45

could you explain replace image with bad image is doing, as well as the handle profile image error

The point of using on:error is to replace a bad profile image (doesn't load) with the default one. It sometimes doesn't get called for the very first image load: https://github.com/sveltejs/kit/issues/8271

We utilize the use: directive to call the replaceBadImageWithDefault function after the image loads, and we check if the image actually loaded or not (loaded image width/height is 0). If not, we replace the bad image with the default one.

nathanielfernandes commented 5 months ago

other than that, looks great

Dev-Zhao commented 5 months ago