Files
housesof/src/style/molecules/_photo.scss
Félix Péault 60fdf02112 Photo: Tweak reveal animations and fix horizontal scroll
- Photo number doesn't jumps anymore (now reveals based on photo not the number)
- Properly reveal title locations lines
- Optimize code
2020-04-06 12:14:48 +02:00

181 lines
3.9 KiB
SCSS

.photo {
/*
** Location
*/
&__location {
margin-bottom: 32px;
@media (max-width: $screen-md) {
padding: 0;
}
@include breakpoint (sm) {
margin-bottom: 56px;
}
h2 {
text-align: left;
@include breakpoint (xs) {
font-size: rem(40px);
}
}
.line {
overflow: hidden;
padding-bottom: 3px;
display: block;
span {
position: relative;
display: block;
will-change: transform;
}
}
p {
color: $color-lightgray;
margin-top: 16px;
will-change: opacity;
}
}
/*
** Image
*/
&__image {
position: relative;
display: flex;
justify-content: flex-start;
@include breakpoint (xs) {
padding: 0;
}
// Alignment (left or right for list view)
.align {
position: relative;
width: 100%;
max-width: 1180px;
margin: 0;
padding: 0;
}
}
// Image itself
&__picture {
overflow: hidden;
position: relative;
z-index: 2;
display: block;
width: 100%;
border-radius: 0;
background-color: #fff;
box-shadow: 0 8px 18px rgba(#715E4E, 0.2);
user-select: none;
@include breakpoint (sm) {
border-radius: 8px;
}
a {
display: block;
width: 100%;
text-decoration: none;
}
img {
display: block;
width: 100%;
height: auto;
will-change: transform, opacity;
}
// Overlay
&:after {
opacity: 0;
content: "";
position: absolute;
z-index: 3;
display: block;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: $color-primary;
pointer-events: none;
transition: opacity 150ms $ease-inout;
}
// Hover
&:hover {
cursor: url(#{$dir-img}/icons/zoom.svg) 6 8, pointer;
&:after {
opacity: 0.6;
}
}
}
// Date (on the side)
&__date {
display: block;
margin-top: 16px;
padding: 0 pxVW(128);
font-size: rem(14px);
color: $color-lightgray;
@include breakpoint (sm) {
position: absolute;
z-index: 3;
left: calc(100% + 30px);
bottom: 0;
transform: rotate(270deg);
transform-origin: 0 0;
white-space: nowrap;
line-height: 0;
padding: 0;
}
}
// Photo number
&__number {
position: absolute;
bottom: -80px;
right: 24px;
font-family: $font-serif-extra;
color: rgba($color-tertiary, 0.5);
font-size: rem(124px);
pointer-events: none;
user-select: none;
span {
position: relative;
display: block;
will-change: transform;
}
@include breakpoint (sm) {
z-index: 1;
top: 0;
right: 8%;
transform: translate(0, -25%);
font-size: pxVW(300);
}
@include breakpoint (md) {
top: 50%;
right: 0;
bottom: auto;
transform: translate(26.5vw, -50%);
width: 50%;
text-align: center;
}
@include breakpoint (lg) {
transform: translate(28vw, -50%);
}
@include breakpoint (xxl) {
font-size: rem(300px);
transform: translate(70%, -50%);
}
}
}