mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
Add thumbnail replacement for new logo
This commit is contained in:
parent
7f97ce9828
commit
b2a9eb1c7c
@ -34,23 +34,42 @@ let AccordionListItemPiece = React.createClass({
|
||||
},
|
||||
|
||||
render() {
|
||||
const { className, piece, artistName, buttons, badge, children, subsubheading } = this.props;
|
||||
const { url, url_safe } = piece.thumbnail;
|
||||
let thumbnail;
|
||||
|
||||
// Since we're going to refactor the thumbnail generation anyway at one point,
|
||||
// for not use the annoying ascribe_spiral.png, we're matching the url against
|
||||
// this name and replace it with a CSS version of the new logo.
|
||||
if(url.match(/https:\/\/.*\/media\/thumbnails\/ascribe_spiral.png/)) {
|
||||
thumbnail = (
|
||||
<span className="ascribe-logo-circle">
|
||||
<span>A</span>
|
||||
</span>
|
||||
);
|
||||
} else {
|
||||
thumbnail = (
|
||||
<div style={{backgroundImage: 'url("' + url_safe + '")'}}/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<AccordionListItem
|
||||
className={this.props.className}
|
||||
thumbnail={<div style={{backgroundImage: 'url("' + this.props.piece.thumbnail.url_safe + '")'}}/>}
|
||||
heading={<h1>{this.props.piece.title}</h1>}
|
||||
className={className}
|
||||
thumbnail={thumbnail}
|
||||
heading={<h1>{piece.title}</h1>}
|
||||
subheading={
|
||||
<h3>
|
||||
{getLangText('by ')}
|
||||
{this.props.artistName ? this.props.artistName : this.props.piece.artist_name}
|
||||
{artistName ? artistName : piece.artist_name}
|
||||
</h3>
|
||||
}
|
||||
subsubheading={this.props.subsubheading}
|
||||
buttons={this.props.buttons}
|
||||
badge={this.props.badge}
|
||||
subsubheading={subsubheading}
|
||||
buttons={buttons}
|
||||
badge={badge}
|
||||
linkData={this.getLinkData()}
|
||||
>
|
||||
{this.props.children}
|
||||
{children}
|
||||
</AccordionListItem>
|
||||
);
|
||||
}
|
||||
|
@ -249,17 +249,20 @@
|
||||
padding: 4px 12px 0 10px
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: mercury_regular;
|
||||
src: url(Mercury_Regular.otf);
|
||||
}
|
||||
.ascribe-logo-circle {
|
||||
border: 5px solid white;
|
||||
border-radius: 10em;
|
||||
|
||||
@font-face {
|
||||
font-family: mercury_medium;
|
||||
src: url(Mercury_Medium.otf);
|
||||
}
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
@font-face {
|
||||
font-family: mercury_light;
|
||||
src: url(Mercury_Light.otf);
|
||||
}
|
||||
> span {
|
||||
color: white;
|
||||
position: absolute;
|
||||
top: -.35em;
|
||||
left: .11em;
|
||||
|
||||
font-size: 8.35em;
|
||||
}
|
||||
}
|
@ -39,6 +39,7 @@ $ascribe-accordion-list-item-height: 100px;
|
||||
|
||||
// ToDo: Include media queries for thumbnail
|
||||
.thumbnail-wrapper {
|
||||
background-color: #EEEEEE;
|
||||
margin-right: 2em;
|
||||
width: $ascribe-accordion-list-item-height;
|
||||
height: $ascribe-accordion-list-item-height;
|
||||
|
Loading…
Reference in New Issue
Block a user