liebling/src/sass/components/articles/_article-card.scss
2020-07-07 17:13:29 +02:00

323 lines
5.6 KiB
SCSS

.m-article-card {
display: flex;
flex-direction: column;
position: relative;
margin-bottom: 20px;
height: 400px;
background-color: var(--background-color);
border-radius: 10px;
border: 1px solid var(--secondary-border-color);
z-index: 1;
@include transition(all .25s cubic-bezier(.02,.01,.47,1));
&:hover {
@include transform(translateY(-5px));
&:before {
@include bs(var(--article-shadow-hover));
}
.m-article-card__author {
@include bs(0 4px 8px rgba(0, 0, 0, 0.3));
}
}
@include respond-to('medium') {
width: calc((100% / 2) - 20px);
height: 420px;
margin-left: 10px;
margin-right: 10px;
margin-bottom: 20px;
}
@include respond-to('large') {
width: calc((100% / 3) - 40px);
margin-left: 20px;
margin-right: 20px;
margin-bottom: 40px;
}
&.no-picture {
.m-article-card__picture {
height: 85px !important;
}
.m-article-card__info {
background-color: var(--secondary-subtle-color);
}
.m-article-card__title {
line-height: 1.4;
font-size: 1.625rem;
}
}
&.as-author {
.m-article-card__picture {
background-color: $black;
}
.m-article-card__picture-link {
z-index: 2;
}
.m-article-card__picture-background {
opacity: 0.75;
}
.m-article-card__info {
padding: 0;
}
.m-article-card__info-link {
padding: $mobile-space $mobile-space 60px $mobile-space;
}
}
&:before {
content: '';
position: absolute;
top: 10px;
right: 10px;
bottom: 0;
left: 10px;
border-radius: 10px;
@include bs(var(--article-shadow-normal));
@include transition(all .25s cubic-bezier(.02,.01,.47,1));
}
}
.m-article-card__picture {
position: relative;
height: 200px;
border-radius: 10px 10px 0 0;
background-color: var(--secondary-subtle-color);
overflow: hidden;
@include respond-to('medium') {
height: 220px;
}
}
.m-article-card__picture-link {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.m-article-card__picture-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
z-index: 0;
}
.m-article-card__name {
position: absolute;
left: $mobile-space;
right: $mobile-space;
bottom: $mobile-space;
color: $white;
letter-spacing: 0.4px;
line-height: 1.3;
font-size: 1.250rem;
font-weight: 600;
margin: 0;
z-index: 1;
@include respond-to('medium') {
left: 25px;
bottom: 25px;
}
}
.m-article-card__author {
position: absolute;
top: $mobile-space;
left: $mobile-space;
width: 35px;
height: 35px;
border-radius: 50%;
z-index: 2;
@include transition(all .25s cubic-bezier(.02,.01,.47,1));
@include respond-to('medium') {
top: 25px;
left: 25px;
}
div {
width: 100%;
height: 100%;
border-radius: 50%;
border: 2px solid $white;
background-color: $white;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
}
.m-article-card__featured {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 26px;
right: $mobile-space;
width: 24px;
height: 24px;
color: $black;
background-color: $white;
border-radius: 50%;
z-index: 2;
@include respond-to('medium') {
top: 31px;
right: 25px;
}
span {
color: inherit;
font-size: 0.750rem;
}
}
.m-article-card__info {
flex: 1;
position: relative;
padding-top: 48px;
height: 200px;
overflow: hidden;
border-radius: 0 0 10px 10px;
background-color: var(--background-color);
@include respond-to('medium') {
padding-top: 53px;
}
&.no-tag {
padding-top: 0 !important;
.m-article-card__info-link {
padding-top: 48px;
@include respond-to('medium') {
padding-top: 53px;
}
}
}
}
.m-article-card__tag {
position: absolute;
top: $mobile-space;
left: $mobile-space;
right: $mobile-space;
color: var(--link-color);
letter-spacing: 0.2px;
line-height: 1.3;
font-size: 0.875rem;
font-weight: 600;
@include respond-to('medium') {
top: 25px;
left: 25px;
}
}
.m-article-card__info-link {
display: flex;
flex-direction: column;
justify-content: space-between;
width: 100%;
height: 100%;
padding: 0 $mobile-space $mobile-space $mobile-space;
@include respond-to('medium') {
padding: 0 25px 25px 25px;
}
}
.m-article-card__title {
color: var(--titles-color);
letter-spacing: 0.4px;
line-height: 1.3;
font-size: 1.250rem;
font-weight: 400;
margin: 0;
@include respond-to('medium') {
font-weight: 600;
}
}
.m-article-card__excerpt {
display: block;
position: relative;
overflow: hidden;
height: 100%;
color: var(--titles-color);
letter-spacing: 0.3px;
line-height: 1.5;
font-size: 1rem;
}
.m-article-card__timestamp,
.m-article-card__author-stats {
display: flex;
align-items: center;
color: var(--titles-color);
letter-spacing: 0.2px;
font-size: 0.875rem;
span:nth-child(2) {
padding: 0 10px;
}
}
.m-article-card__author-stats {
position: absolute;
left: $mobile-space;
right: $mobile-space;
bottom: $mobile-space;
justify-content: space-between;
span {
padding: 0 !important;
}
}
.m-article-card__social {
display: flex;
align-items: center;
justify-content: flex-end;
padding: 0;
margin: 0;
li {
display: inline-block;
margin-left: 22px;
a {
color: var(--primary-foreground-color);
font-size: 0.938rem;
span {
color: inherit;
}
}
}
}
.rtl {
.m-article-card__social {
direction: ltr;
}
}