🔥 Make Homepage collage responsive and fix desktop placement
This commit is contained in:
@@ -27,7 +27,11 @@
|
|||||||
color: $color-text;
|
color: $color-text;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding-bottom: clamp(250px, 27vw, 600px);
|
padding-bottom: calc(96px + 5vw);
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
|
padding-bottom: calc(280px + 10vw);
|
||||||
|
}
|
||||||
|
|
||||||
// Button
|
// Button
|
||||||
.button {
|
.button {
|
||||||
@@ -73,45 +77,48 @@
|
|||||||
&__photos {
|
&__photos {
|
||||||
position: relative;
|
position: relative;
|
||||||
max-width: 2000px;
|
max-width: 2000px;
|
||||||
height: clamp(400px, 45vw, 900px);
|
margin: calc(-1 * 96px + 5vw) 0 80px;
|
||||||
margin: calc(-1 * clamp(200px, 20vw, 500px)) auto 0;
|
|
||||||
|
|
||||||
@include bp (sm) {
|
@include bp (sm) {
|
||||||
margin: calc(-1 * clamp(300px, 20vw, 500px)) auto 0;
|
margin: calc(-1 * clamp(300px, 20vw, 500px)) auto clamp(64px, 6.5vw, 128px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&__collage {
|
&__collage {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(16, 1fr);
|
grid-template-columns: repeat(16, 1fr);
|
||||||
grid-template-rows: repeat(2, 1fr);
|
grid-template-rows: repeat(3, 1fr);
|
||||||
margin: 0 -140px;
|
margin: 0 -14vw;
|
||||||
|
height: 110vw;
|
||||||
|
|
||||||
@include bp (sm) {
|
@include bp (sm) {
|
||||||
grid-template-columns: repeat(32, 1fr);
|
grid-template-columns: repeat(32, 1fr);
|
||||||
|
grid-template-rows: repeat(2, 1fr);
|
||||||
|
margin: 0 -140px;
|
||||||
|
height: clamp(400px, 40vw, 800px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.photo-card {
|
.photo-card {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: block;
|
display: block;
|
||||||
grid-column-end: span 4;
|
grid-column-end: span 8;
|
||||||
|
height: 100%;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
transform: rotate(var(--rotation)) translateZ(0);
|
transform: rotate(var(--rotation)) translateZ(0);
|
||||||
|
|
||||||
@include bp (sm) {
|
@include bp (sm) {
|
||||||
height: clamp(156px, 18vw, 400px);
|
height: clamp(156px, 18vw, 400px);
|
||||||
grid-column-end: span 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
picture {
|
picture {
|
||||||
background: $color-primary-tertiary20;
|
background: $color-primary-tertiary20;
|
||||||
}
|
}
|
||||||
|
img {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
a {
|
a {
|
||||||
display: block;
|
display: block;
|
||||||
cursor: zoom-in;
|
cursor: zoom-in;
|
||||||
@@ -120,53 +127,74 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// First row
|
// First row
|
||||||
|
// Mobile: Top left
|
||||||
&:nth-child(1) {
|
&:nth-child(1) {
|
||||||
--rotation: -10.5deg;
|
--rotation: -10.5deg;
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
grid-column-start: 9;
|
grid-column-start: 2;
|
||||||
grid-row: 1;
|
grid-row: 1;
|
||||||
top: -100px;
|
|
||||||
|
|
||||||
@include bp (sm) {
|
@include bp (sm) {
|
||||||
z-index: 11;
|
z-index: 10;
|
||||||
top: clamp(16px, 3vw, 48px);
|
top: clamp(24px, 8vw, 128px);
|
||||||
grid-column-start: 2;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Mobile: Middle left
|
||||||
&:nth-child(2) {
|
&:nth-child(2) {
|
||||||
--rotation: 3deg;
|
--rotation: 3deg;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
grid-column-start: 7;
|
grid-column-start: 1;
|
||||||
grid-row: 1;
|
grid-row: 2;
|
||||||
margin-left: 0;
|
margin-top: -10vw;
|
||||||
top: clamp(16px, 3vw, 48px);
|
left: -20vw;
|
||||||
|
|
||||||
@include bp (sm) {
|
@include bp (sm) {
|
||||||
z-index: 7;
|
z-index: 7;
|
||||||
|
grid-column-start: 7;
|
||||||
|
grid-row: 1;
|
||||||
|
top: clamp(16px, 3vw, 48px);
|
||||||
|
margin-top: 0;
|
||||||
|
left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Mobile: Middle center
|
||||||
&:nth-child(3) {
|
&:nth-child(3) {
|
||||||
z-index: 4;
|
z-index: 4;
|
||||||
grid-column-start: 13;
|
grid-column-start: 5;
|
||||||
grid-row: 1;
|
grid-row: 2;
|
||||||
|
margin-top: -12vw;
|
||||||
|
|
||||||
@include bp (sm) {
|
@include bp (sm) {
|
||||||
z-index: 6;
|
z-index: 6;
|
||||||
|
grid-column-start: 13;
|
||||||
|
grid-row: 1;
|
||||||
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Mobile: Middle right
|
||||||
&:nth-child(4) {
|
&:nth-child(4) {
|
||||||
--rotation: -3deg;
|
--rotation: -3deg;
|
||||||
|
z-index: 3;
|
||||||
|
grid-column-start: 8;
|
||||||
|
grid-row: 2;
|
||||||
|
margin-top: -7vw;
|
||||||
|
left: 20vw;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
grid-column-start: 19;
|
grid-column-start: 19;
|
||||||
grid-row: 1;
|
grid-row: 1;
|
||||||
top: clamp(16px, 3vw, 48px);
|
top: clamp(16px, 3vw, 48px);
|
||||||
|
margin-top: 0;
|
||||||
|
left: 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// Mobile: Top right
|
||||||
&:nth-child(5) {
|
&:nth-child(5) {
|
||||||
--rotation: 10.5deg;
|
--rotation: 10.5deg;
|
||||||
z-index: 6;
|
z-index: 6;
|
||||||
grid-column-start: 16;
|
grid-column-start: 8;
|
||||||
grid-row: 1;
|
grid-row: 1;
|
||||||
top: -80px;
|
|
||||||
|
|
||||||
@include bp (sm) {
|
@include bp (sm) {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
@@ -177,74 +205,82 @@
|
|||||||
|
|
||||||
// Second row
|
// Second row
|
||||||
&:nth-child(6) {
|
&:nth-child(6) {
|
||||||
--rotation: -5.5deg;
|
|
||||||
display: none;
|
display: none;
|
||||||
z-index: 10;
|
--rotation: -5.5deg;
|
||||||
grid-column-start: 1;
|
|
||||||
grid-row: 2;
|
|
||||||
top: clamp(24px, 5.5vw, 132px);
|
|
||||||
|
|
||||||
@include bp (sm) {
|
@include bp (sm) {
|
||||||
display: block;
|
display: block;
|
||||||
|
z-index: 9;
|
||||||
|
grid-column-start: 1;
|
||||||
|
grid-row: 2;
|
||||||
|
top: clamp(24px, 5.5vw, 88px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&:nth-child(7) {
|
&:nth-child(7) {
|
||||||
display: none;
|
display: none;
|
||||||
--rotation: -8deg;
|
--rotation: -8deg;
|
||||||
grid-column-start: 5;
|
|
||||||
z-index: 9;
|
|
||||||
grid-row: 1;
|
|
||||||
|
|
||||||
@include bp (sm) {
|
@include bp (sm) {
|
||||||
display: block;
|
display: block;
|
||||||
|
z-index: 8;
|
||||||
|
grid-column-start: 5;
|
||||||
grid-row: 2;
|
grid-row: 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Mobile: Bottom left
|
||||||
&:nth-child(8) {
|
&:nth-child(8) {
|
||||||
--rotation: 8deg;
|
--rotation: 8deg;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
grid-column-start: 10;
|
grid-column-start: 2;
|
||||||
grid-row: 2;
|
grid-row: 3;
|
||||||
top: calc(-1 * clamp(20px, 3vw, 48px));
|
margin-top: -16vw;
|
||||||
|
|
||||||
@include bp (sm) {
|
@include bp (sm) {
|
||||||
|
z-index: 5;
|
||||||
grid-column-start: 11;
|
grid-column-start: 11;
|
||||||
|
grid-row: 2;
|
||||||
|
top: calc(-1 * clamp(20px, 3vw, 48px));
|
||||||
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Mobile: Bottom right
|
||||||
&:nth-child(9) {
|
&:nth-child(9) {
|
||||||
--rotation: -2deg;
|
--rotation: -2deg;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
grid-column-start: 16;
|
grid-column-start: 8;
|
||||||
grid-row: 2;
|
grid-row: 3;
|
||||||
top: calc(-1 * clamp(20px, 3vw, 48px));
|
margin-top: -16vw;
|
||||||
|
|
||||||
@include bp (sm) {
|
@include bp (sm) {
|
||||||
--rotation: 2deg;
|
--rotation: 2deg;
|
||||||
z-index: 4;
|
z-index: 4;
|
||||||
grid-column-start: 15;
|
grid-column-start: 15;
|
||||||
|
grid-row: 2;
|
||||||
|
top: calc(-1 * clamp(20px, 3vw, 48px));
|
||||||
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&:nth-child(10) {
|
&:nth-child(10) {
|
||||||
--rotation: 8deg;
|
--rotation: 8deg;
|
||||||
display: none;
|
display: none;
|
||||||
z-index: 3;
|
|
||||||
grid-column-start: 21;
|
|
||||||
grid-row: 2;
|
|
||||||
|
|
||||||
@include bp (sm) {
|
@include bp (sm) {
|
||||||
display: block;
|
display: block;
|
||||||
|
z-index: 3;
|
||||||
|
grid-column-start: 21;
|
||||||
|
grid-row: 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&:nth-child(11) {
|
&:nth-child(11) {
|
||||||
--rotation: 5.5deg;
|
--rotation: 5.5deg;
|
||||||
display: none;
|
display: none;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
grid-column-start: 25;
|
grid-column-start: 25;
|
||||||
grid-row: 2;
|
grid-row: 2;
|
||||||
top: clamp(24px, 5.5vw, 132px);
|
top: clamp(24px, 5.5vw, 88px);
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
|
|
||||||
@include bp (sm) {
|
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user