532 lines
12 KiB
SCSS
532 lines
12 KiB
SCSS
// Photos Page
|
|
.photos-page {
|
|
// Intro Section
|
|
&__intro {
|
|
margin-bottom: clamp(32px, 7.5vw, 96px);
|
|
color: $color-text;
|
|
text-align: center;
|
|
|
|
// Title
|
|
:global(h1) {
|
|
margin: -20px 0 48px;
|
|
color: $color-secondary;
|
|
line-height: 1;
|
|
|
|
@include bp (sm) {
|
|
margin: -100px 0 0 calc(-1 * clamp(24px, 6vw, 64px));
|
|
}
|
|
}
|
|
// Text
|
|
& > :global(p) {
|
|
max-width: 456px;
|
|
margin: 20px auto 56px;
|
|
|
|
@include bp (sm) {
|
|
margin: 50px auto 72px;
|
|
max-width: 524px;
|
|
}
|
|
}
|
|
|
|
// Passed scroll
|
|
&.is-passed {
|
|
@include bp (sm) {
|
|
padding-bottom: 72px;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Content Block
|
|
&__content {
|
|
--corners: 8px;
|
|
position: relative;
|
|
padding: 20px;
|
|
background-color: $color-tertiary;
|
|
|
|
@include bp (sm) {
|
|
padding: clamp(40px, 5vw, 64px) 24px;
|
|
}
|
|
@include bp (md) {
|
|
margin: 0 30px;
|
|
padding-left: 0;
|
|
padding-right: 0;
|
|
}
|
|
|
|
&:before, &:after {
|
|
@include bp (md) {
|
|
content: "";
|
|
display: block;
|
|
position: absolute;
|
|
z-index: -1;
|
|
top: 0;
|
|
width: 25%;
|
|
height: 100%;
|
|
background: $color-tertiary;
|
|
transition: transform 0.8s var(--ease-quart);
|
|
}
|
|
}
|
|
&:before {
|
|
@include bp (md) {
|
|
border-radius: var(--corners) 0 0 var(--corners);
|
|
left: 0;
|
|
transform: translate3d(calc(-1 * var(--margin-sides)), 0, 0);
|
|
}
|
|
}
|
|
&:after {
|
|
@include bp (md) {
|
|
border-radius: 0 var(--corners) var(--corners) 0;
|
|
right: 0;
|
|
transform: translate3d(var(--margin-sides), 0, 0);
|
|
}
|
|
}
|
|
|
|
// Container
|
|
.container {
|
|
@include bp (sm, max) {
|
|
padding-left: 0;
|
|
padding-right: 0;
|
|
}
|
|
}
|
|
|
|
// Modules
|
|
:global(.grid-modules) {
|
|
grid-column: 1 / -1;
|
|
margin-bottom: 0;
|
|
|
|
@include bp (sd) {
|
|
grid-column: 2 / span 22;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Photo Grid
|
|
&__grid {
|
|
display: grid;
|
|
grid-column: 1 / -1;
|
|
// Template: 2 / 1-1
|
|
grid-template-columns: repeat(2, 1fr);
|
|
grid-gap: 16px;
|
|
|
|
@include bp (mob-lg) {
|
|
grid-gap: 20px;
|
|
}
|
|
@include bp (sm) {
|
|
// Swich to template: 2-1-1 / 1-1-2
|
|
grid-template-columns: repeat(4, 1fr);
|
|
grid-gap: 24px;
|
|
}
|
|
@include bp (sd) {
|
|
grid-column: 2 / span 22;
|
|
grid-gap: clamp(24px, 2vw, 40px);
|
|
}
|
|
|
|
// Photo
|
|
:global(.photo) {
|
|
position: relative;
|
|
opacity: 0;
|
|
transform: translate3d(0, 96px, 0);
|
|
transition: opacity 1.2s var(--ease-quart), transform 1.2s var(--ease-quart);
|
|
|
|
:global(a) {
|
|
display: block;
|
|
}
|
|
:global(figcaption) {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
pointer-events: none;
|
|
}
|
|
|
|
/**
|
|
* Photo sizes
|
|
*/
|
|
// MOBILE
|
|
// 1st photo = 2 columns
|
|
&:nth-child(5n + 1) {
|
|
@include bp (sm, max) {
|
|
grid-column: span 2;
|
|
grid-row: span 2;
|
|
margin-bottom: 8px;
|
|
}
|
|
}
|
|
// 4 next photos = 1 column each
|
|
&:nth-child(5n + 4),
|
|
&:nth-child(5n + 5) {
|
|
@include bp (sm, max) {
|
|
margin-bottom: 8px;
|
|
}
|
|
}
|
|
|
|
|
|
// DESKTOP
|
|
// 1st photo = left 2 columns, 2 rows
|
|
&:nth-child(10n + 1){
|
|
@include bp (sm) {
|
|
grid-column: span 2;
|
|
grid-row: span 2;
|
|
}
|
|
}
|
|
// 8th photo = right 2 columns, 2 rows
|
|
&:nth-child(10n + 8){
|
|
@include bp (sm) {
|
|
grid-column: 3 / span 2;
|
|
grid-row: span 2;
|
|
}
|
|
}
|
|
// Additional spacing between grid patterns
|
|
&:nth-child(10n + 10){
|
|
@include bp (sm) {
|
|
margin-top: 12px;
|
|
}
|
|
@include bp (sd) {
|
|
margin-top: clamp(8px, 1vw, 16px);
|
|
}
|
|
}
|
|
&:nth-child(10n + 1),
|
|
&:nth-child(10n + 4),
|
|
&:nth-child(10n + 5){
|
|
@include bp (sm) {
|
|
margin-bottom: 12px;
|
|
}
|
|
@include bp (sd) {
|
|
margin-bottom: clamp(8px, 1vw, 16px);
|
|
}
|
|
}
|
|
|
|
// Show postcard on hover
|
|
&:hover {
|
|
:global(.postcard) {
|
|
opacity: 1;
|
|
transform: translate3d(3%, 3%, 0) rotate(2deg);
|
|
}
|
|
:global(.postcard--small) {
|
|
transform: translate3d(0,0,0);
|
|
}
|
|
}
|
|
|
|
// Postcard
|
|
:global(.postcard) {
|
|
position: absolute;
|
|
bottom: 0;
|
|
right: 0;
|
|
border-top-left-radius: 8px;
|
|
pointer-events: none;
|
|
opacity: 0;
|
|
transform: translate3d(6%, 12%, 0) rotate(-1deg);
|
|
transition: opacity 0.5s var(--ease-quart), transform 0.9s var(--ease-quart);
|
|
}
|
|
:global(.postcard--small) {
|
|
border-radius: 6px 6px 0 0;
|
|
transform: translate3d(6%, 12%, 0) rotate(-3deg);
|
|
}
|
|
}
|
|
|
|
// Visible photo state
|
|
:global(.is-visible) {
|
|
opacity: 1;
|
|
transform: translate3d(0,0,0);
|
|
}
|
|
}
|
|
|
|
// Message
|
|
&__message {
|
|
// grid-column: ;
|
|
text-align: center;
|
|
padding: clamp(48px, 10vw, 160px) 0;
|
|
color: $color-text;
|
|
|
|
@include bp (sm) {
|
|
grid-column: 3 / span 20;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
** Filters
|
|
*/
|
|
.filters {
|
|
max-width: 982px;
|
|
margin: 0 auto;
|
|
padding: 0 16px;
|
|
|
|
@include bp (sm) {
|
|
padding: 0 32px;
|
|
}
|
|
|
|
// Bar
|
|
&__bar {
|
|
position: relative;
|
|
display: inline-flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
min-height: 64px;
|
|
margin-top: 20px;
|
|
padding: 0 12px;
|
|
background: $color-primary-darker;
|
|
border-radius: 100vh;
|
|
|
|
@include bp (mob-lg) {
|
|
padding: 0 16px;
|
|
}
|
|
@include bp (sm) {
|
|
display: flex;
|
|
height: 72px;
|
|
margin-top: 0;
|
|
padding: 28px 32px;
|
|
}
|
|
|
|
ul {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
li {
|
|
display: block;
|
|
margin: 8px 2px;
|
|
font-size: rem(14px);
|
|
color: #fff;
|
|
|
|
@include bp (sm) {
|
|
margin: 0 2px;
|
|
font-size: rem(16px);
|
|
}
|
|
}
|
|
:global(.icon) {
|
|
display: block;
|
|
width: 20px;
|
|
height: 20px;
|
|
overflow: hidden;
|
|
margin-right: 12px;
|
|
color: #fff;
|
|
border-radius: 100%;
|
|
transition: color 0.3s;
|
|
|
|
@include bp (sm) {
|
|
width: 26px;
|
|
height: 26px;
|
|
}
|
|
|
|
:global(img) {
|
|
display: block;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
|
|
:global(.select) {
|
|
position: relative;
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 8px 12px 8px 8px;
|
|
font-weight: 900;
|
|
border-radius: 100vh;
|
|
transition: background-color 0.2s;
|
|
|
|
@include bp (sm) {
|
|
padding: 8px 16px;
|
|
}
|
|
|
|
:global(select) {
|
|
opacity: 0;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 8px;
|
|
width: 100%;
|
|
height: 100%;
|
|
cursor: pointer;
|
|
}
|
|
}
|
|
|
|
// Hover
|
|
li:hover {
|
|
:global(.icon) {
|
|
color: $color-secondary-light;
|
|
}
|
|
:global(.select) {
|
|
background-color: $color-primary-tertiary20;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Span
|
|
&__label {
|
|
display: block;
|
|
color: rgba($color-tertiary, 0.7);
|
|
position: absolute;
|
|
top: -32px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
|
|
@include bp (sm) {
|
|
left: 32px;
|
|
top: 52%;
|
|
transform: translateY(-50%);
|
|
margin-bottom: 0;
|
|
}
|
|
}
|
|
|
|
// Actions
|
|
&__actions {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
margin-top: 20px;
|
|
|
|
@include bp (sm) {
|
|
position: absolute;
|
|
top: 50%;
|
|
right: 20px;
|
|
transform: translateY(-50%);
|
|
margin-top: 0;
|
|
}
|
|
|
|
// Reset link
|
|
.reset {
|
|
padding: 0 12px;
|
|
color: rgba($color-tertiary, 0.6);
|
|
font-weight: 900;
|
|
font-size: rem(14px);
|
|
transition: color 0.3s;
|
|
transform: translateZ(0);
|
|
|
|
&:hover {
|
|
color: $color-tertiary;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
** States
|
|
*/
|
|
// Fixed when scrolled pass intro
|
|
&.is-over {
|
|
--top: 24px;
|
|
transform: translate3d(0, calc(-100% - var(--top)), 0);
|
|
pointer-events: none;
|
|
|
|
.filters__bar {
|
|
pointer-events: auto;
|
|
box-shadow: 0 10px 20px rgba(#000, 0.1);
|
|
}
|
|
|
|
@include bp (sm) {
|
|
position: fixed;
|
|
z-index: 10;
|
|
top: var(--top);
|
|
left: 0;
|
|
right: 0;
|
|
}
|
|
}
|
|
|
|
// Visible when scrolling back up
|
|
&.is-visible {
|
|
transform: translate3d(0,0,0);
|
|
pointer-events: auto;
|
|
}
|
|
|
|
// Apply transition
|
|
&.is-transitioning {
|
|
transition: transform 1.0s var(--ease-quart);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* Controls
|
|
*/
|
|
.controls {
|
|
grid-column: 1 / -1;
|
|
display: grid;
|
|
margin: 48px auto;
|
|
align-items: center;
|
|
justify-content: center;
|
|
|
|
@include bp (sm) {
|
|
justify-content: space-between;
|
|
margin: clamp(56px, 4.5vw, 80px) 0;
|
|
}
|
|
@include bp (sd) {
|
|
--columns: 22;
|
|
grid-column: 2 / span var(--columns);
|
|
}
|
|
|
|
// Updated Date
|
|
&__date {
|
|
grid-column: 1 / -1;
|
|
grid-row: 2;
|
|
font-size: rem(18px);
|
|
color: rgba($color-gray, 0.6);
|
|
font-weight: 300;
|
|
text-align: center;
|
|
margin: 24px 0 48px;
|
|
line-height: 1.35;
|
|
|
|
@include bp (sm) {
|
|
grid-column: span 5;
|
|
grid-row: 1;
|
|
text-align: left;
|
|
margin: 0;
|
|
}
|
|
|
|
time {
|
|
display: block;
|
|
|
|
@include bp (sd) {
|
|
display: inline;
|
|
}
|
|
}
|
|
}
|
|
|
|
// See More Photos
|
|
:global(.button) {
|
|
grid-column: 1 / -1;
|
|
padding-left: 24px;
|
|
padding-right: 24px;
|
|
grid-row: 1;
|
|
margin: 0 auto;
|
|
|
|
@include bp (sm) {
|
|
grid-column: 7 / span 12;
|
|
}
|
|
@include bp (sd) {
|
|
grid-column-start: 6;
|
|
}
|
|
}
|
|
|
|
// Photo Count
|
|
&__count {
|
|
grid-column: 1 / -1;
|
|
grid-row: 3;
|
|
text-align: center;
|
|
display: flex;
|
|
align-items: baseline;
|
|
color: rgba($color-text, 0.3);
|
|
font-family: $font-serif;
|
|
font-size: rem(64px);
|
|
font-weight: 200;
|
|
line-height: 1;
|
|
letter-spacing: -0.05em;
|
|
|
|
@include bp (sm) {
|
|
grid-column: 18 / span 7;
|
|
grid-row: 1;
|
|
margin-left: auto;
|
|
text-align: right;
|
|
}
|
|
@include bp (sd) {
|
|
grid-column-start: 16;
|
|
}
|
|
|
|
span {
|
|
display: inline-block;
|
|
|
|
&:last-child {
|
|
margin-right: 0;
|
|
}
|
|
}
|
|
}
|
|
} |