diff --git a/src/App/styles.less b/src/App/styles.less index 1a1f50dcc..11b52de8b 100644 --- a/src/App/styles.less +++ b/src/App/styles.less @@ -17,6 +17,8 @@ @calculated-bottom-safe-inset: ~"min(env(safe-area-inset-bottom, 0rem), max(1rem, calc(100lvh - 100svh - env(safe-area-inset-top, 0rem))))"; @html-width: ~"calc(max(100svw, 100dvw))"; @html-height: ~"calc(max(100svh, 100dvh))"; +@html-standalone-width: ~"calc(max(100%, 100lvw))"; +@html-standalone-height: ~"calc(max(100%, 100lvh))"; @safe-area-inset-top: env(safe-area-inset-top, 0rem); @safe-area-inset-right: env(safe-area-inset-right, 0rem); @safe-area-inset-bottom: env(safe-area-inset-bottom, 0rem); @@ -119,6 +121,12 @@ html { touch-action: manipulation; -webkit-tap-highlight-color: transparent; + + @media (display-mode: standalone) { + width: @html-standalone-width; + height: @html-standalone-height; + } + body { width: 100%; height: 100%; diff --git a/src/common/animations.less b/src/common/animations.less index 6ca879343..c7a30d2fb 100644 --- a/src/common/animations.less +++ b/src/common/animations.less @@ -6,13 +6,29 @@ } animation-timing-function: ease-in-out; - animation-duration: 100ms; + animation-duration: 350ms; + + @media (prefers-reduced-motion) { + :local { + animation-name: fade-in-no-motion; + } + } } @keyframes fade-in { 0% { + opacity: 0; + transform: translateY(4px); + } + + 40% { + opacity: 0; + transform: translateY(4px); + } + + 70% { opacity: 0.6; - transform: translateY(0.2vh); + transform: translateY(2px); } 100% { @@ -51,4 +67,22 @@ .slide-left-exit { transform: translateX(100%); +} + +@keyframes fade-in-no-motion { + 0% { + opacity: 0; + } + + 40% { + opacity: 0; + } + + 70% { + opacity: 0.6; + } + + 100% { + opacity: 1; + } } \ No newline at end of file diff --git a/src/components/NavBar/HorizontalNavBar/SearchBar/SearchBar.js b/src/components/NavBar/HorizontalNavBar/SearchBar/SearchBar.js index b87c555e5..0bc95cd73 100644 --- a/src/components/NavBar/HorizontalNavBar/SearchBar/SearchBar.js +++ b/src/components/NavBar/HorizontalNavBar/SearchBar/SearchBar.js @@ -7,7 +7,8 @@ const debounce = require('lodash.debounce'); const { useTranslation } = require('react-i18next'); const { default: Icon } = require('@stremio/stremio-icons/react'); const { useRouteFocused } = require('stremio-router'); -const { Button, TextInput } = require('stremio/components'); +const Button = require('stremio/components/Button').default; +const TextInput = require('stremio/components/TextInput').default; const useTorrent = require('stremio/common/useTorrent'); const { withCoreSuspender } = require('stremio/common/CoreSuspender'); const useSearchHistory = require('./useSearchHistory'); diff --git a/src/routes/Calendar/Calendar.less b/src/routes/Calendar/Calendar.less index 7f7925bf5..b606fa2aa 100644 --- a/src/routes/Calendar/Calendar.less +++ b/src/routes/Calendar/Calendar.less @@ -14,7 +14,7 @@ gap: 0.5rem; width: 100%; height: 100%; - padding: 0 0 2rem 2rem; + padding: 0 0 calc(1.5rem + var(--safe-area-inset-bottom)) 2rem; .main { flex: auto; @@ -37,7 +37,7 @@ @media only screen and (max-width: @small) and (orientation: landscape) { .calendar { .content { - padding: 0 0 0 1rem; + padding: 0 0 calc(1.5rem + var(--safe-area-inset-bottom)) 1rem; } } } diff --git a/src/routes/Calendar/Calendar.tsx b/src/routes/Calendar/Calendar.tsx index 6d9fbe90e..93f1bbe77 100644 --- a/src/routes/Calendar/Calendar.tsx +++ b/src/routes/Calendar/Calendar.tsx @@ -11,6 +11,7 @@ import Placeholder from './Placeholder'; import useCalendar from './useCalendar'; import useCalendarDate from './useCalendarDate'; import styles from './Calendar.less'; +import classNames from 'classnames'; type Props = { urlParams: UrlParams, @@ -34,7 +35,7 @@ const Calendar = ({ urlParams }: Props) => { { profile.auth !== null ? -
+
{ onClick && onClick(date); }; + const onPosterClick = useCallback((event: MouseEvent) => { + event.stopPropagation(); + }, []); + return (