Skip to content

Commit

Permalink
feat(story-selector): restyle story images layout
Browse files Browse the repository at this point in the history
  • Loading branch information
pwambach committed Sep 9, 2020
1 parent b637e5b commit 38a0ebd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@require '../../../../variables.styl'

.storyItem
.storyListItem
display: flex
flex-direction: column
justify-content: flex-end
Expand Down Expand Up @@ -29,17 +29,25 @@
text-align: center
line-height: 30px

.imageInfo
.image
height: 220px
background: black
background-position: center
background-size: cover

.info
overflow-y: auto
box-sizing: border-box
padding: emCalc(16px)
min-height: 50%
min-height: 45%
width: 100%
height: fit-content
border-bottom-right-radius: 2px
border-bottom-left-radius: 2px
background-color: $darkGrey1
opacity: 0.95

.storyListItem:hover .info
background-color: lighten($darkGrey1, 5)

.title
margin: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const StoryListItemContent: FunctionComponent<Props> = ({
onSelectStory
}) => {
const classes = cx(
styles.storyItem,
styles.storyListItem,
mode === StoryMode.Present && styles.present,
selectedIndex >= 0 && styles.selected
);
Expand All @@ -41,13 +41,15 @@ const StoryListItemContent: FunctionComponent<Props> = ({

return (
<div
style={{backgroundImage: `url(${imageUrl})`}}
className={classes}
onClick={() => mode === StoryMode.Showcase && onSelectStory(story.id)}>
{selectedIndex >= 0 && (
<div className={styles.storyNumber}>{selectedIndex + 1}</div>
)}
<div className={styles.imageInfo}>
<div
className={styles.image}
style={{backgroundImage: `url(${imageUrl})`}}></div>
<div className={styles.info}>
<p className={styles.title}>{story.title}</p>
<p className={styles.description}>{story.description}</p>
{story.tags && <StoryTags tags={story.tags} selected={selectedTags} />}
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/components/stories/story-list/story-list.styl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
display: grid
padding: emCalc(20px)
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr))
grid-auto-rows: 300px
grid-auto-rows: 340px
grid-gap: 16px

.present
Expand Down
1 change: 1 addition & 0 deletions src/scripts/components/stories/story-tags/story-tags.styl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
cursor: pointer

&:hover
border-color: lighten($darkGrey4, 10)
background: $darkGrey2

.selected, .selected:hover
Expand Down

0 comments on commit 38a0ebd

Please sign in to comment.