limit range of progress

This commit is contained in:
cupcakearmy 2021-02-10 11:23:38 +01:00
parent 564f3c57f8
commit ecba2ba7dc
No known key found for this signature in database
GPG Key ID: D28129AE5654D9D9
3 changed files with 5 additions and 4 deletions

View File

@ -13,9 +13,10 @@
) )
function updateState(value) { function updateState(value) {
const max = 359.99999
const R = 50 const R = 50
let alpha = (360 / 1) * value let alpha = (360 / 1) * value
if (alpha === 360) alpha = 359.99999 alpha = Math.min(alpha, max)
const a = ((90 - alpha) * Math.PI) / 180 const a = ((90 - alpha) * Math.PI) / 180
const x = R + R * Math.cos(a) * 2 const x = R + R * Math.cos(a) * 2
const y = R - R * Math.sin(a) * 2 const y = R - R * Math.sin(a) * 2

View File

@ -4,7 +4,7 @@
import { scroll } from '../lib/scroll' import { scroll } from '../lib/scroll'
import Nav from '../components/Nav.svelte' import Nav from '../components/Nav.svelte'
import Loading from '../components/Loading.svelte' import Progress from '../components/Progress.svelte'
export let segment export let segment
let wrapper let wrapper
@ -49,7 +49,7 @@
<slot /> <slot />
</main> </main>
{#if $page.path !== '/'} {#if $page.path !== '/'}
<Loading /> <Progress />
{/if} {/if}
</div> </div>
@ -69,7 +69,6 @@
overflow: auto; overflow: auto;
max-width: calc(100% - 4em); max-width: calc(100% - 4em);
height: 100%; height: 100%;
scroll-behavior: smooth;
} }
@media (max-width: 30em) { @media (max-width: 30em) {

View File

@ -3,6 +3,7 @@
* { * {
box-sizing: border-box; box-sizing: border-box;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
scroll-behavior: smooth;
} }
:root { :root {