improve modals on mobile (sadly no blur because animations wont be smooth :((()

This commit is contained in:
hippoz 2022-11-29 21:49:29 +02:00
parent faf8d3a518
commit 402807995c
No known key found for this signature in database
GPG key ID: 7C52899193467641
2 changed files with 17 additions and 2 deletions

View file

@ -190,12 +190,23 @@ body {
@media screen and (max-width: 768px) {
.modal {
width: 100%;
height: 100%;
border-radius: 0px;
border-radius: var(--radius-xl);
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.modal-backdrop {
align-items: flex-end;
justify-content: center;
backdrop-filter: unset;
}
.modal-backdrop-opaque {
display: block;
}
.modal-backdrop-opaque .modal {
width: 100%;
height: 100%;
border-radius: 0;
}
}
/* input */

View file

@ -1,12 +1,16 @@
import { fade, fly, scale } from "svelte/transition";
import { cubicInOut } from "svelte/easing";
import { getItem } from "./storage";
import { smallViewport } from "./stores";
export function maybeModalFade(node) {
return maybeFade(node, { duration: 175, easing: cubicInOut });
}
export function maybeModalScale(node) {
if (smallViewport.value) {
return maybeFly(node, { duration: 175, easing: cubicInOut, y: 20 })
}
return maybeScale(node, { duration: 175, easing: cubicInOut, start: 0.93 });
}