diff --git a/src/components/Loading.svelte b/src/components/Progress.svelte similarity index 95% rename from src/components/Loading.svelte rename to src/components/Progress.svelte index d530b46..78d42ec 100644 --- a/src/components/Loading.svelte +++ b/src/components/Progress.svelte @@ -13,9 +13,10 @@ ) function updateState(value) { + const max = 359.99999 const R = 50 let alpha = (360 / 1) * value - if (alpha === 360) alpha = 359.99999 + alpha = Math.min(alpha, max) const a = ((90 - alpha) * Math.PI) / 180 const x = R + R * Math.cos(a) * 2 const y = R - R * Math.sin(a) * 2 diff --git a/src/routes/_layout.svelte b/src/routes/_layout.svelte index 51999bd..ebec330 100644 --- a/src/routes/_layout.svelte +++ b/src/routes/_layout.svelte @@ -4,7 +4,7 @@ import { scroll } from '../lib/scroll' import Nav from '../components/Nav.svelte' - import Loading from '../components/Loading.svelte' + import Progress from '../components/Progress.svelte' export let segment let wrapper @@ -49,7 +49,7 @@ {#if $page.path !== '/'} - + {/if} @@ -69,7 +69,6 @@ overflow: auto; max-width: calc(100% - 4em); height: 100%; - scroll-behavior: smooth; } @media (max-width: 30em) { diff --git a/static/global.css b/static/global.css index 11ec597..c3bb12e 100644 --- a/static/global.css +++ b/static/global.css @@ -3,6 +3,7 @@ * { box-sizing: border-box; -webkit-overflow-scrolling: touch; + scroll-behavior: smooth; } :root {