This repository has been archived by the owner on Aug 31, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lepon01
committed
Oct 7, 2018
1 parent
1196a82
commit d0b813b
Showing
13 changed files
with
344 additions
and
2 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,32 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Slider from 'react-slick'; | ||
// import { Link } from 'react-router-dom' | ||
|
||
import './index.scss'; | ||
import 'slick-carousel/slick/slick.css'; | ||
import 'slick-carousel/slick/slick-theme.css'; | ||
|
||
export default class ImageStrip extends React.Component { | ||
render () { | ||
const settings = { | ||
dots: true, | ||
infinite: true, | ||
speed: 500, | ||
className: 'carousel', | ||
focusOnSelect: true, | ||
centerMode: true | ||
}; | ||
|
||
return ( | ||
<Slider {...settings}> | ||
{ this.props.children } | ||
</Slider> | ||
); | ||
} | ||
} | ||
|
||
ImageStrip.propTypes = { | ||
items: PropTypes.arrayOf(PropTypes.object), | ||
className: PropTypes.arrayOf(PropTypes.string) | ||
}; |
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,16 @@ | ||
.slick-slider { | ||
.slick-dots { | ||
li button { | ||
box-shadow: unset; | ||
&:before { | ||
color: #FFFFFF; | ||
} | ||
} | ||
li.slick-active button { | ||
box-shadow: unset; | ||
&:before { | ||
color: #FFFFFF; | ||
} | ||
} | ||
} | ||
} |
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,58 @@ | ||
import React from 'react'; | ||
import Link from 'gatsby-link'; | ||
import Avatar from './../Avatar'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import { ItemPropType } from './../../proptypes'; | ||
|
||
import './index.scss'; | ||
|
||
class CarouselItem extends React.Component { | ||
render() { | ||
const post = this.props.post; | ||
const githubButton = post.frontmatter.github | ||
&& post.frontmatter.github.owner | ||
&& post.frontmatter.github.repo | ||
? <a href={`https://github.com/${post.frontmatter.github.owner}/${post.frontmatter.github.repo}`} rel="noopener noreferrer" target="_blank"><FormattedMessage id="pages.list.github" /></a> | ||
: null; | ||
|
||
const carouselStyle = post.frontmatter.cover ? { | ||
backgroundImage: `url('/userassets${this.props.post.fields.filelink}-cover.png')` | ||
} : { | ||
backgroundColor: '#282828' | ||
}; | ||
|
||
const contentStyle = post.frontmatter.cover ? { | ||
backgroundImage: 'linear-gradient(to right, rgba(0,0,0,0.8), rgba(0,0,0,0.7), rgba(0,0,0,0.4))' | ||
} : null; | ||
|
||
return ( | ||
<section className="carousel-item" style={carouselStyle}> | ||
<div className="carousel-item-content" style={contentStyle}> | ||
<div className="avatar"> | ||
<Avatar post={post}></Avatar> | ||
</div> | ||
<div className="card-content"> | ||
<Link to={post.fields.permalink}> | ||
<h4 className="title"> | ||
{post.frontmatter.pagename} | ||
{post.frontmatter.nsfw ? <span className="nsfw-tag">NSFW</span> : null } | ||
</h4> | ||
</Link> | ||
<span className="description">{post.frontmatter.description}</span> | ||
</div> | ||
<div className="footer"> | ||
<a href={post.fields.filelink}><FormattedMessage id="pages.list.view" /></a> | ||
<a href={post.frontmatter.link}><FormattedMessage id="pages.list.invite" /></a> | ||
{githubButton} | ||
</div> | ||
</div> | ||
</section> | ||
); | ||
} | ||
} | ||
|
||
CarouselItem.propTypes = { | ||
post: ItemPropType | ||
}; | ||
|
||
export default CarouselItem; |
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,35 @@ | ||
.carousel-item { | ||
margin: 1em; | ||
height: 25em; | ||
box-shadow: 0 2px 10px 0 rgba(0,0,0,0.2), | ||
0 0 0 1px #20222599; | ||
background-size: cover; | ||
border-radius: 6px; | ||
position: relative; | ||
} | ||
|
||
.carousel-item-content { | ||
position: absolute; | ||
display: flex; | ||
flex-direction: column; | ||
padding: 3em; | ||
width: 100%; | ||
height: 25em; | ||
box-sizing: border-box; | ||
top: 0; | ||
left: 0; | ||
.card-content { | ||
flex-grow: 1; | ||
} | ||
.footer { | ||
display: flex; | ||
margin-top: 2em; | ||
flex: 1; | ||
a { | ||
display: block; | ||
line-height: 1; | ||
margin-right: 1em; | ||
padding: 0; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.