diff --git a/ui/v2.5/package.json b/ui/v2.5/package.json index 8f4ad36a3..9be6ccd81 100644 --- a/ui/v2.5/package.json +++ b/ui/v2.5/package.json @@ -46,6 +46,7 @@ "graphql": "^15.4.0", "graphql-tag": "^2.11.0", "i18n-iso-countries": "^6.4.0", + "intersection-observer": "^0.12.0", "jimp": "^0.16.1", "localforage": "1.9.0", "lodash": "^4.17.20", diff --git a/ui/v2.5/src/components/Changelog/versions/v060.md b/ui/v2.5/src/components/Changelog/versions/v060.md index 0cbc0caf1..f03ccad4f 100644 --- a/ui/v2.5/src/components/Changelog/versions/v060.md +++ b/ui/v2.5/src/components/Changelog/versions/v060.md @@ -1,3 +1,8 @@ ### 🎨 Improvements +* Auto-play video previews on mobile devices. +* Replace hover menu with dropdown menu for O-Counter. * Support random strings for scraper cookie values. * Added Rescan button to scene, image, gallery details overflow button. + +### 🐛 Bug fixes +* Prevent scene card previews playing in full-screen on iOS devices. diff --git a/ui/v2.5/src/components/Scenes/SceneCard.tsx b/ui/v2.5/src/components/Scenes/SceneCard.tsx index c9ea31e82..a5db7d230 100644 --- a/ui/v2.5/src/components/Scenes/SceneCard.tsx +++ b/ui/v2.5/src/components/Scenes/SceneCard.tsx @@ -29,17 +29,14 @@ export const ScenePreview: React.FC = ({ const videoEl = useRef(null); useEffect(() => { - const observer = new IntersectionObserver( - (entries) => { - entries.forEach((entry) => { - if (entry.intersectionRatio > 0) - // Catch is necessary due to DOMException if user hovers before clicking on page - videoEl.current?.play().catch(() => {}); - else videoEl.current?.pause(); - }); - }, - { root: document.documentElement } - ); + const observer = new IntersectionObserver((entries) => { + entries.forEach((entry) => { + if (entry.intersectionRatio > 0) + // Catch is necessary due to DOMException if user hovers before clicking on page + videoEl.current?.play().catch(() => {}); + else videoEl.current?.pause(); + }); + }); if (videoEl.current) observer.observe(videoEl.current); }); @@ -53,6 +50,8 @@ export const ScenePreview: React.FC = ({
- } - enterDelay={1000} - placement="bottom" - onOpen={props.onMenuOpened} - onClose={props.onMenuClosed} - > - {renderButton()} - - ); - } - return renderButton(); + const maybeRenderDropdown = () => { + if (props.value) { + return ( + + + + Decrement + + + + Reset + + + ); + } + }; + + return ( + + {renderButton()} + {maybeRenderDropdown()} + + ); }; diff --git a/ui/v2.5/src/components/Scenes/styles.scss b/ui/v2.5/src/components/Scenes/styles.scss index 73538c968..e04288211 100644 --- a/ui/v2.5/src/components/Scenes/styles.scss +++ b/ui/v2.5/src/components/Scenes/styles.scss @@ -209,15 +209,36 @@ textarea.scene-description { } } - &:hover { - .scene-specs-overlay, - .rating-banner, - .scene-studio-overlay { - opacity: 0; - transition: opacity 0.5s; - } + @media (pointer: fine) { + &:hover { + .scene-specs-overlay, + .rating-banner, + .scene-studio-overlay { + opacity: 0; + transition: opacity 0.5s; + } - .scene-studio-overlay:hover { + .scene-studio-overlay:hover { + opacity: 0.75; + transition: opacity 0.5s; + } + + .scene-card-check { + opacity: 0.75; + transition: opacity 0.5s; + } + + .scene-card-preview-video { + top: 0; + transition-delay: 0.2s; + } + } + } + + /* replicate hover for non-hoverable interfaces */ + @media (hover: none), (pointer: coarse), (pointer: none) { + /* don't hide overlays */ + .scene-studio-overlay { opacity: 0.75; transition: opacity 0.5s; } @@ -545,3 +566,10 @@ input[type="range"].blue-slider { color: #664c3f; } } + +.o-counter .dropdown-toggle { + background-color: rgba(0, 0, 0, 0); + border: none; + padding-left: 0; + padding-right: 0.25rem; +} diff --git a/ui/v2.5/src/components/Wall/WallItem.tsx b/ui/v2.5/src/components/Wall/WallItem.tsx index 4d2b36c3d..24ccdb92d 100644 --- a/ui/v2.5/src/components/Wall/WallItem.tsx +++ b/ui/v2.5/src/components/Wall/WallItem.tsx @@ -57,6 +57,8 @@ const Preview: React.FC<{ ); const video = (