From cb51107ffd77ffcd4babba0733ba7585c53a05a6 Mon Sep 17 00:00:00 2001 From: geoffrey45 Date: Fri, 9 Dec 2022 11:16:17 +0300 Subject: [PATCH] reduce modal max-width --- src/components/WelcomeModal.vue | 58 +----------------------- src/components/modal.vue | 12 +++-- src/components/modals/NewPlaylist.vue | 9 +++- src/components/modals/updatePlaylist.vue | 2 +- src/composables/useKeyboard.ts | 2 +- src/stores/notification.ts | 2 +- 6 files changed, 19 insertions(+), 66 deletions(-) diff --git a/src/components/WelcomeModal.vue b/src/components/WelcomeModal.vue index 38bbab2d..41e31dde 100644 --- a/src/components/WelcomeModal.vue +++ b/src/components/WelcomeModal.vue @@ -10,40 +10,9 @@ for all your local music files 💿️.


-

- To get started, you need to have - alice server - running on your computer, and accessible via - localhost:1970. -

-

- On top of that, you need to enable loading mixed content in your browser - to to load local images 🖼️. Firefox usually supports this by default, but - you may need to enable it in Chrome. -

+

Let there be music!



-
-
How to enable loading mixed content in
- -
@@ -64,14 +33,6 @@ line-height: 1.5rem; } - .inline-code { - font-size: 0.9rem; - color: $red; - border-radius: $smaller; - font-family: "ui-monospace", "SFMono-Regular", "SF Mono", "Menlo", - "Consolas", "Liberation Mono"; - } - hr { border: none; border-bottom: 1px $gray3 solid; @@ -95,22 +56,7 @@ a { color: $red; - } - } - - .instructions { - background-color: $gray4; - padding: $small; - - .button-group { - margin-top: 1rem; - display: flex; - justify-content: space-evenly; - gap: 1rem; - - button { - padding: 0 $medium; - } + cursor: pointer !important; } } } diff --git a/src/components/modal.vue b/src/components/modal.vue index 5d556f57..96d230fb 100644 --- a/src/components/modal.vue +++ b/src/components/modal.vue @@ -3,7 +3,7 @@
{{ modal.title }}
-
+
import useModalStore from "../stores/modal"; + import NewPlaylist from "./modals/NewPlaylist.vue"; import UpdatePlaylist from "./modals/updatePlaylist.vue"; import WelcomeModal from "./WelcomeModal.vue"; @@ -53,6 +54,7 @@ function hideModal() { width: 100vw; display: grid; place-items: center; + // padding: 1rem; .bg { position: absolute; @@ -65,12 +67,12 @@ function hideModal() { .m-content { width: 100%; - max-width: 35rem; - padding: 1rem; + max-width: 30rem; + padding: 2rem; position: relative; - background-color: $gray; + background-color: $black; - .cancel { + .close { width: 2rem; height: 2rem; position: absolute; diff --git a/src/components/modals/NewPlaylist.vue b/src/components/modals/NewPlaylist.vue index 0962b52b..22f5ffed 100644 --- a/src/components/modals/NewPlaylist.vue +++ b/src/components/modals/NewPlaylist.vue @@ -8,8 +8,8 @@ name="name" id="modal-playlist-name-input" /> -
- +

+ @@ -95,6 +95,11 @@ function create(e: Event) { button { margin: 0 auto; width: 6rem; + transition: all .25s ease-out; + + &:hover { + width: 10rem; + } } } diff --git a/src/components/modals/updatePlaylist.vue b/src/components/modals/updatePlaylist.vue index d940f696..72190083 100644 --- a/src/components/modals/updatePlaylist.vue +++ b/src/components/modals/updatePlaylist.vue @@ -35,7 +35,7 @@ }" />
- diff --git a/src/composables/useKeyboard.ts b/src/composables/useKeyboard.ts index cb1e5bfc..206e412f 100644 --- a/src/composables/useKeyboard.ts +++ b/src/composables/useKeyboard.ts @@ -21,7 +21,7 @@ export default function (queue: typeof useQStore) { let ctrlKey = e.ctrlKey; function FocusedOnInput(target: HTMLElement) { - return target.tagName === "INPUT" || target.tagName === "TEXTAREA"; + return target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.tagName === "BUTTON"; } if (FocusedOnInput(target)) return; diff --git a/src/stores/notification.ts b/src/stores/notification.ts index dcd3b3df..894167d5 100644 --- a/src/stores/notification.ts +++ b/src/stores/notification.ts @@ -21,7 +21,7 @@ const useNotifStore = defineStore("notification", { }); class Notification { - constructor(text: string, type?: NotifType) { + constructor(text: string, type: NotifType = NotifType.Info) { useNotifStore().showNotification(text, type); } }