diff --git a/src/components/Dashboard.svelte b/src/components/Dashboard.svelte index 0e2b5cc0..35abd556 100644 --- a/src/components/Dashboard.svelte +++ b/src/components/Dashboard.svelte @@ -24,19 +24,40 @@ ) check = true; })(navigator.userAgent || navigator.vendor || window.opera); + const aspectratio=window.innerWidth/window.innerHeight; + if(aspectratio<=0.765){ + check=true; + } return check; } $: mobile = ismobile(); + window.addEventListener('resize', function(){ + const aspectratio=window.innerWidth/window.innerHeight; + if(aspectratio<=0.765){ + navOpen=false; + mobile=true; + }else{ + navOpen=true; + mobile=false; + + } + }); +// $: if (mobile===true) { +// console.log("changed to mobile"); +// } +// $: if (mobile===false) { +// console.log("changed to md"); +// } function logout() { localForage.clear(); location.replace("/"); } -
+