1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00

Add thumbnail replacement for new logo

This commit is contained in:
Tim Daubenschütz 2015-10-22 10:39:11 +02:00
parent 7f97ce9828
commit b2a9eb1c7c
3 changed files with 43 additions and 20 deletions

View File

@ -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>
);
}

View File

@ -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;
}
}

View File

@ -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;