1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +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() { 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 ( return (
<AccordionListItem <AccordionListItem
className={this.props.className} className={className}
thumbnail={<div style={{backgroundImage: 'url("' + this.props.piece.thumbnail.url_safe + '")'}}/>} thumbnail={thumbnail}
heading={<h1>{this.props.piece.title}</h1>} heading={<h1>{piece.title}</h1>}
subheading={ subheading={
<h3> <h3>
{getLangText('by ')} {getLangText('by ')}
{this.props.artistName ? this.props.artistName : this.props.piece.artist_name} {artistName ? artistName : piece.artist_name}
</h3> </h3>
} }
subsubheading={this.props.subsubheading} subsubheading={subsubheading}
buttons={this.props.buttons} buttons={buttons}
badge={this.props.badge} badge={badge}
linkData={this.getLinkData()} linkData={this.getLinkData()}
> >
{this.props.children} {children}
</AccordionListItem> </AccordionListItem>
); );
} }

View File

@ -249,17 +249,20 @@
padding: 4px 12px 0 10px padding: 4px 12px 0 10px
} }
@font-face { .ascribe-logo-circle {
font-family: mercury_regular; border: 5px solid white;
src: url(Mercury_Regular.otf); border-radius: 10em;
}
@font-face { display: block;
font-family: mercury_medium; width: 100%;
src: url(Mercury_Medium.otf); height: 100%;
}
@font-face { > span {
font-family: mercury_light; color: white;
src: url(Mercury_Light.otf); 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 // ToDo: Include media queries for thumbnail
.thumbnail-wrapper { .thumbnail-wrapper {
background-color: #EEEEEE;
margin-right: 2em; margin-right: 2em;
width: $ascribe-accordion-list-item-height; width: $ascribe-accordion-list-item-height;
height: $ascribe-accordion-list-item-height; height: $ascribe-accordion-list-item-height;