From 24a956c940690400bd18e229a77fa2b1477c7fc3 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Thu, 4 Aug 2022 21:31:02 +0300 Subject: [PATCH] refactor modal animations and add more padding to the modal footer --- frontend/public/global.css | 4 ++-- frontend/src/animations.js | 9 +++++++++ frontend/src/components/overlays/CreateAccount.svelte | 5 ++--- frontend/src/components/overlays/CreateChannel.svelte | 7 +++---- frontend/src/components/overlays/EditChannel.svelte | 7 +++---- frontend/src/components/overlays/EditMessage.svelte | 6 +++--- frontend/src/components/overlays/Login.svelte | 5 ++--- frontend/src/components/overlays/Prompt.svelte | 7 +++---- frontend/src/components/overlays/Settings.svelte | 7 +++---- frontend/src/components/overlays/Toast.svelte | 5 ++--- 10 files changed, 32 insertions(+), 30 deletions(-) diff --git a/frontend/public/global.css b/frontend/public/global.css index eb3570a..bf4849d 100644 --- a/frontend/public/global.css +++ b/frontend/public/global.css @@ -137,13 +137,13 @@ body { } .modal-header { - margin-bottom: var(--space-norm); + margin-bottom: var(--space-md); text-align: center; } .modal-footer { margin-top: auto; - padding-top: var(--space-norm); + padding-top: var(--space-lg); } .modal-primary-action { diff --git a/frontend/src/animations.js b/frontend/src/animations.js index d97be8d..a282c38 100644 --- a/frontend/src/animations.js +++ b/frontend/src/animations.js @@ -1,6 +1,15 @@ import { fade, fly } from "svelte/transition"; +import { cubicInOut } from "svelte/easing"; import { getItem } from "./storage"; +export function maybeModalFade(node) { + return maybeFade(node, { duration: 160, easing: cubicInOut }); +} + +export function maybeModalFly(node) { + return maybeFly(node, { duration: 210, easing: cubicInOut, y: 15 }); +} + export function maybeFly(...e) { if (getItem("ui:doAnimations")) return fly(...e); diff --git a/frontend/src/components/overlays/CreateAccount.svelte b/frontend/src/components/overlays/CreateAccount.svelte index 67152a7..065b7c9 100644 --- a/frontend/src/components/overlays/CreateAccount.svelte +++ b/frontend/src/components/overlays/CreateAccount.svelte @@ -1,9 +1,8 @@