diff --git a/lama_cleaner/app/src/components/Shortcuts/Shortcuts.scss b/lama_cleaner/app/src/components/Shortcuts/Shortcuts.scss index a971410..c353ae1 100644 --- a/lama_cleaner/app/src/components/Shortcuts/Shortcuts.scss +++ b/lama_cleaner/app/src/components/Shortcuts/Shortcuts.scss @@ -34,11 +34,10 @@ .shortcut-key { justify-self: end; - font-family: 'WorkSans-Bold'; border: 1px solid var(--modal-hotkey-border-color); - padding: 0.4rem 1rem; + padding: 0.4rem 0.4rem; width: max-content; - border-radius: 0.4rem; + border-radius: 0.2rem; @include mobile { padding: 0.2rem 0.4rem; @@ -48,7 +47,6 @@ .shortcut-description { justify-self: start; text-align: left; - width: 18rem; @include mobile { text-align: left; diff --git a/lama_cleaner/app/src/components/Shortcuts/ShortcutsModal.tsx b/lama_cleaner/app/src/components/Shortcuts/ShortcutsModal.tsx index be160b9..ef8efbb 100644 --- a/lama_cleaner/app/src/components/Shortcuts/ShortcutsModal.tsx +++ b/lama_cleaner/app/src/components/Shortcuts/ShortcutsModal.tsx @@ -4,21 +4,37 @@ import { shortcutsState } from '../../store/Atoms' import Modal from '../shared/Modal' interface Shortcut { - children: ReactNode content: string + keys: string[] } function ShortCut(props: Shortcut) { - const { children, content } = props + const { content, keys } = props return (
{content}
-
{children}
+
+ {keys.map((k, index) => ( +
+ {k} +
+ ))} +
) } +const isMac = (function () { + return /macintosh|mac os x/i.test(navigator.userAgent) +})() + +const isWindows = (function () { + return /windows|win32/i.test(navigator.userAgent) +})() + +const CmdOrCtrl = isMac ? 'Cmd' : 'Ctrl' + export default function ShortcutsModal() { const [shortcutsShow, setShortcutState] = useRecoilState(shortcutsState) @@ -34,39 +50,20 @@ export default function ShortcutsModal() { show={shortcutsShow} >
- -

Hold Cmd/Ctrl

-
- -

Cmd/Ctrl + Z

-
- -

Space & Drag

-
- -

Hold Tab

-
- -

Esc

-
- -

Esc

-
- -

Shift + R

-
- -

[

-
- -

]

-
- -

Shift + D

-
- -

H

-
+ + + + + + + + + + +
) diff --git a/lama_cleaner/app/src/components/shared/Modal.scss b/lama_cleaner/app/src/components/shared/Modal.scss index 2beef78..53291f0 100644 --- a/lama_cleaner/app/src/components/shared/Modal.scss +++ b/lama_cleaner/app/src/components/shared/Modal.scss @@ -4,7 +4,10 @@ inset: 0; background-color: var(--model-mask-bg); backdrop-filter: blur(12px); - animation: opacityReveal 150ms cubic-bezier(0.16, 1, 0.3, 1) forwards; + + @media (prefers-reduced-motion: no-preference) { + animation: opacityReveal 150ms cubic-bezier(0.16, 1, 0.3, 1) forwards; + } } @keyframes contentShow { @@ -46,5 +49,7 @@ } } - animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1) forwards; + @media (prefers-reduced-motion: no-preference) { + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1) forwards; + } }