tag: add overlay

Signed-off-by: Varun Patil <varunpatil@ucla.edu>
pull/504/head
Varun Patil 2023-03-15 16:49:59 -07:00
parent 8044298ab8
commit dd29e00eb0
1 changed files with 17 additions and 16 deletions

View File

@ -23,6 +23,7 @@
:src="previewUrl" :src="previewUrl"
@error="failed" @error="failed"
/> />
<div class="overlay fill-block" />
</div> </div>
</div> </div>
</router-link> </router-link>
@ -184,13 +185,12 @@ img {
.name { .name {
z-index: 100; z-index: 100;
position: absolute; position: absolute;
top: 50%; bottom: 7%;
width: 100%; width: 100%;
transform: translateY(-50%);
color: white; color: white;
padding: 0 5%; padding: 0 5%;
text-align: center; text-align: center;
font-size: 1.1em; font-size: 1em;
word-wrap: break-word; word-wrap: break-word;
text-overflow: ellipsis; text-overflow: ellipsis;
line-height: 1.2em; line-height: 1.2em;
@ -201,18 +201,12 @@ img {
display: block; display: block;
} }
.tag.face > & {
top: unset;
bottom: 10%;
transform: unset;
}
.tag.error > & { .tag.error > & {
color: unset; color: unset;
} }
@media (max-width: 768px) { @media (max-width: 768px) {
font-size: 0.95em; font-size: 0.9em;
} }
} }
@ -231,6 +225,7 @@ img {
box-sizing: border-box; box-sizing: border-box;
> .img-outer { > .img-outer {
position: relative;
background-color: var(--color-background-dark); background-color: var(--color-background-dark);
border-radius: 10px; border-radius: 10px;
padding: 0; padding: 0;
@ -244,16 +239,22 @@ img {
> img { > img {
object-fit: cover; object-fit: cover;
padding: 0; padding: 0;
filter: brightness(60%);
cursor: pointer; cursor: pointer;
transition: filter 0.2s ease-in-out;
&.error { &.error {
display: none; display: none;
} }
.tag:hover & { }
filter: brightness(100%);
} > .overlay {
pointer-events: none;
position: absolute;
top: 0;
left: 0;
background: linear-gradient(
0deg,
rgba(0, 0, 0, 0.7) 10%,
transparent 35%
);
} }
} }
} }