Improved scene tile layout.

This commit is contained in:
ThePendulum 2019-05-09 01:58:47 +02:00
parent e3558fc0c5
commit 665b77fb4e
3 changed files with 56 additions and 42 deletions

View File

@ -17,5 +17,6 @@
"max-len": [2, {"code": 200, "tabWidth": 4, "ignoreUrls": true}], "max-len": [2, {"code": 200, "tabWidth": 4, "ignoreUrls": true}],
"react/jsx-uses-vars": 2, "react/jsx-uses-vars": 2,
"react/jsx-indent": ["error", 4], "react/jsx-indent": ["error", 4],
"react/jsx-indent-props": ["error", 4],
} }
} }

View File

@ -12,38 +12,16 @@ class Home extends React.Component {
<ul className="scenes"> <ul className="scenes">
{this.props.releases.map(release => ( {this.props.releases.map(release => (
<li key={release.id} className="scene"> <li key={release.id} className="scene">
<a <span
href={`/item/${release.id}`} className="scene-banner"
target="_blank"
> >
<img <span className="scene-details">
src={`/${release.site.id}/${release.id}/0.jpg`}
className="scene-thumbnail"
/>
</a>
<div className="scene-info">
<a
href={`/item/${release.id}`}
target="_blank"
rel="noopener noreferrer"
className="scene-row scene-link"
><h2 className="scene-title">{release.title}</h2></a>
<span className="scene-row">
<a <a
href={`/site/${release.site.id}`} href={`/site/${release.site.id}`}
className="scene-site site-link" className="scene-site site-link"
title={release.network.name}
>{release.site.name}</a> >{release.site.name}</a>
<span>
<a
className="scene-network"
href={`/network/${release.network.id}`}
target="_blank"
rel="noopener noreferrer"
>{release.network.name}</a>
<a <a
href={release.url} href={release.url}
target="_blank" target="_blank"
@ -51,8 +29,21 @@ class Home extends React.Component {
className="scene-date" className="scene-date"
>{moment(release.date).format('YYYY-MM-DD')}</a> >{moment(release.date).format('YYYY-MM-DD')}</a>
</span> </span>
<img
src={`/${release.site.id}/${release.id}/0.jpg`}
className="scene-thumbnail"
/>
</span> </span>
<div className="scene-info">
<a
href={`/item/${release.id}`}
target="_blank"
rel="noopener noreferrer"
className="scene-row scene-link"
><h2 className="scene-title">{release.title}</h2></a>
<span className="scene-row"> <span className="scene-row">
<ul className="scene-actors nolist">{release.actors.map(actor => <ul className="scene-actors nolist">{release.actors.map(actor =>
<li <li
@ -67,7 +58,10 @@ class Home extends React.Component {
)}</ul> )}</ul>
</span> </span>
<span className="scene-row"> <span
title={release.tags.map(tag => tag.tag).join(', ')}
className="scene-row"
>
<ul className="scene-tags nolist">{release.tags.map(tag => <ul className="scene-tags nolist">{release.tags.map(tag =>
<li <li
key={tag.tag} key={tag.tag}

View File

@ -14,7 +14,7 @@ body {
.scenes { .scenes {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
list-style: none; list-style: none;
padding: 0; padding: 0;
margin: 0; margin: 0;
@ -24,11 +24,23 @@ body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
box-sizing: border-box; box-sizing: border-box;
padding: 0 0 .5rem 0;;
margin: .5rem; margin: .5rem;
height: 22rem;
box-shadow: 0 0 3px rgba(0, 0, 0, .5); box-shadow: 0 0 3px rgba(0, 0, 0, .5);
} }
.scene-banner {
position: relative;
}
.scene-details {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
position: absolute;
}
.scene-thumbnail { .scene-thumbnail {
width: 100%; width: 100%;
height: 200px; height: 200px;
@ -40,7 +52,9 @@ body {
.scene-row { .scene-row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: .25rem .5rem; align-items: center;
box-sizing: border-box;
padding: .1rem .5rem;
} }
.scene-info { .scene-info {
@ -55,16 +69,19 @@ body {
color: #000; color: #000;
margin: 0; margin: 0;
font-size: 1rem; font-size: 1rem;
word-wrap: break-word;
overflow: hidden;
max-height: 3rem;
line-height: 1.5rem;
} }
.scene-site { .scene-site,
font-weight: bold;
font-size: .8rem;
}
.scene-date { .scene-date {
color: #555; color: #fff;
background: rgba(0, 0, 0, .5);
font-size: .8rem; font-size: .8rem;
padding: .25rem;
text-decoration: none;
} }
.scene-network { .scene-network {
@ -74,8 +91,10 @@ body {
} }
.scene-tags { .scene-tags {
white-space: nowrap; word-wrap: break-word;
overflow: hidden; overflow: hidden;
max-height: 2.5rem;
line-height: 1.25rem;
} }
.scene-actor, .scene-actor,
@ -83,6 +102,10 @@ body {
margin: 0 .25rem 0 0; margin: 0 .25rem 0 0;
} }
.scene-actor {
font-size: .9rem;
}
.scene-tag { .scene-tag {
font-size: .75rem; font-size: .75rem;
} }
@ -92,10 +115,6 @@ body {
content: ","; content: ",";
} }
.site-link {
color: #000;
}
.actor-link, .actor-link,
.tag-link { .tag-link {
color: #000; color: #000;