-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow both scrolling via swipe and clicking hotspots
Render invisible areas as click targets in sticky container in pan-zoom scroller. Apply same scroll timeline based transform animation to keep invisible areas in sync. REDMINE-20673
- Loading branch information
Showing
9 changed files
with
156 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
entry_types/scrolled/package/src/contentElements/hotspots/ImageArea.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
|
||
import {Area} from './Area'; | ||
|
||
import { | ||
Image, | ||
useContentElementLifecycle, | ||
useFile | ||
} from 'pageflow-scrolled/frontend'; | ||
|
||
import styles from './ImageArea.module.css'; | ||
|
||
export function ImageArea({ | ||
panZoomEnabled, | ||
activeImageVisible, | ||
...props | ||
}) { | ||
const {shouldLoad} = useContentElementLifecycle(); | ||
|
||
const activeImageFile = useFile({ | ||
collectionName: 'imageFiles', permaId: props.area.activeImage | ||
}); | ||
const portraitActiveImageFile = useFile({ | ||
collectionName: 'imageFiles', permaId: props.area.portraitActiveImage | ||
}); | ||
|
||
const imageFile = props.portraitMode && portraitActiveImageFile ? | ||
portraitActiveImageFile : | ||
activeImageFile | ||
|
||
return ( | ||
<Area {...props} | ||
className={classNames(styles.area, | ||
{[styles.activeImageVisible]: activeImageVisible})}> | ||
<Image imageFile={imageFile} | ||
load={shouldLoad} | ||
variant={panZoomEnabled ? 'ultra' : 'large'} | ||
preferSvg={true} /> | ||
</Area> | ||
); | ||
} |
Oops, something went wrong.