-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(story): create mixed content gallery component
- Loading branch information
1 parent
9b79593
commit fe18fee
Showing
25 changed files
with
439 additions
and
244 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
76 changes: 0 additions & 76 deletions
76
src/scripts/components/stories/story-gallery-image/story-gallery-image.tsx
This file was deleted.
Oops, something went wrong.
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
44 changes: 44 additions & 0 deletions
44
src/scripts/components/stories/story-gallery-item/story-gallery-item.tsx
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,44 @@ | ||
import React, {FunctionComponent} from 'react'; | ||
import cx from 'classnames'; | ||
|
||
import styles from './story-gallery-item.module.styl'; | ||
|
||
interface Props { | ||
children: React.ReactNode[]; | ||
currentIndex: number; | ||
showLightbox: boolean; | ||
} | ||
|
||
const StoryGalleryItem: FunctionComponent<Props> = ({ | ||
children, | ||
currentIndex, | ||
showLightbox | ||
}) => { | ||
const containerWidth = children.length * 100; | ||
const itemWidth = 100 / children.length; | ||
const imgClasses = cx( | ||
styles.slider, | ||
showLightbox && styles.lightboxStoryGallery, | ||
children.length > 1 && styles.transition | ||
); | ||
|
||
return ( | ||
<div | ||
className={imgClasses} | ||
style={{ | ||
width: `${containerWidth}%`, | ||
transform: `translateX(-${itemWidth * currentIndex}%)` | ||
}}> | ||
{children.map((child, index) => ( | ||
<div | ||
className={styles.sliderItem} | ||
key={index} | ||
style={{width: `${itemWidth}%`}}> | ||
<div className={styles.itemContainer}>{child}</div> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default StoryGalleryItem; |
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
41 changes: 41 additions & 0 deletions
41
src/scripts/components/stories/story-globe/story-globe.module.styl
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,41 @@ | ||
.globeContainer | ||
position: relative | ||
display: flex | ||
flex-direction: column | ||
height: 100% | ||
padding: 0 emCalc(50px) | ||
background-color: $plainBlack | ||
|
||
.layerDetails | ||
position: absolute | ||
right: 0 | ||
bottom: 0 | ||
left: 0 | ||
padding: inherit | ||
|
||
.storySlider | ||
position: unset | ||
padding: emCalc(40px) 0 | ||
background: none | ||
|
||
> div | ||
min-width: 25% | ||
width: 60% | ||
|
||
@media screen and (max-width: 1025px) | ||
.layerDetails | ||
height: inherit | ||
background: none | ||
pointer-events: none | ||
|
||
> * | ||
position: relative | ||
z-index: 1 | ||
pointer-events: all | ||
|
||
.storySlider | ||
position: absolute | ||
right: 0 | ||
bottom: 0 | ||
padding: emCalc(40px) 0 emCalc(20px) | ||
|
Oops, something went wrong.