Consistent thumbnail hover actions

This commit is contained in:
James Barnsley
2020-04-09 09:02:53 +12:00
parent b5cf8bc6d9
commit 21bbd4c20e
11 changed files with 107 additions and 143 deletions

View File

@ -60,8 +60,10 @@ export default memo((props) => {
<div className="thumbnail__image" style={{ backgroundImage: `url("${image || '/iris/assets/no-image.svg'}")` }} />
)}
{props.glow && image && <div className="thumbnail__image thumbnail__image--glow" style={{ backgroundImage: `url("${image}")` }} />}
{zoom_icon}
{props.children}
<div className="thumbnail__actions">
{props.canZoom && image && <Link className="thumbnail__actions__item thumbnail__actions__item--zoom" to={`/image-zoom?url=${image}`}><Icon name="search" /></Link>}
{props.children}
</div>
</div>
);
});

View File

@ -134,14 +134,12 @@ class Queue extends React.Component {
return (
<div className="current-track__artwork">
<Thumbnail glow image={image}>
<div className="current-track__artwork__actions">
<URILink uri={uri} className="current-track__artwork__actions__item">
<Icon name="album" />
</URILink>
<Link to="/kiosk-mode" className="current-track__artwork__actions__item">
<Icon name="expand" type="fontawesome" />
</Link>
</div>
<URILink uri={uri} className="thumbnail__actions__item">
<Icon name="art_track" />
</URILink>
<Link to="/kiosk-mode" className="thumbnail__actions__item">
<Icon name="expand" type="fontawesome" />
</Link>
</Thumbnail>
</div>
);

View File

@ -39,23 +39,40 @@
}
}
&__zoom {
&__actions {
@include animate();
display: none;
position: absolute;
bottom: 5px;
right: 5px;
z-index: 3;
padding: 10px;
border-radius: 100%;
background: rgba(0,0,0,0.4);
font-size: 12px;
cursor: pointer;
color: colour(white);
border: 0 !important;
display: flex;
opacity: 0;
top: 0;
left: 0;
bottom: 0;
right: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
transform: translateY(-3px);
&:hover {
background: colour(black);
&__item {
@include animate();
display: inline-flex;
z-index: 3;
width: 4.2rem;
height: 4.2rem;
align-items: center;
justify-content: center;
border-radius: 100%;
background: rgba(0,0,0,0.4);
font-size: 2rem;
cursor: pointer;
color: colour(white);
border: 0 !important;
margin: 0 5px;
&:hover {
background: colour(black);
}
}
}
@ -78,10 +95,9 @@
}
&:hover {
.thumbnail {
&__zoom {
display: block;
}
.thumbnail__actions {
opacity: 1;
transform: translateY(0px);
}
}
}

View File

@ -21,47 +21,6 @@
.thumbnail {
width: 30vh;
display: inline-block;
&:hover {
.current-track__artwork__actions {
opacity: 1;
}
}
}
&__actions {
position: absolute;
display: flex;
opacity: 0;
top: 0;
left: 0;
bottom: 0;
right: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
&__item {
@include animate();
display: inline-flex;
z-index: 3;
width: 4.2rem;
height: 4.2rem;
align-items: center;
justify-content: center;
border-radius: 100%;
background: rgba(0,0,0,0.4);
font-size: 2rem;
cursor: pointer;
color: colour(white);
border: 0 !important;
margin: 0 5px;
&:hover {
background: colour(black);
}
}
}
}