[wip] Rework Shop

- Change strategy for content fetching
- Add a route per page instead of using __layout for all
- Change the behaviors of the posters section (add a carousel on small screens)
- Change Poster buttons styling and make interactions only for desktop
This commit is contained in:
2021-12-14 23:23:12 +01:00
parent 140e8f1fa2
commit 82f5dd4727
17 changed files with 808 additions and 364 deletions

View File

@@ -142,7 +142,7 @@
width: 100%;
.container {
padding: 0 16px 24px;
padding: 0 0 24px;
@include bp (md) {
display: grid;
@@ -166,10 +166,18 @@
// Navigation
nav {
display: flex;
justify-content: center;
ul {
display: flex;
align-items: center;
justify-content: center;
overflow: auto;
@include bp (sm) {
justify-content: center;
overflow: hidden;
}
}
li {
display: block;
@@ -199,4 +207,11 @@
}
}
}
// Cart button
.button-cart {
@include bp (sm, max) {
display: none;
}
}
}

View File

@@ -3,28 +3,31 @@
*/
&__posters {
background-color: $color-primary-darker;
padding: 0 20px 72px;
padding: clamp(56px, 10vw, 120px) 20px 72px;
border-bottom: solid 1px $color-primary-tertiary20 ;
@include bp (sm) {
@include bp (sd) {
padding: 120px 0;
}
// Title
h3 {
grid-column: 2 / span 6;
margin-bottom: 48px;
font-family: $font-serif;
color: $color-cream;
font-size: rem(32px);
line-height: 1.1;
text-align: center;
margin-bottom: 24px;
@include bp (sm) {
grid-column: 3 / span 14;
max-width: 360px;
margin-bottom: 48px;
font-size: rem(48px);
text-align: left;
max-width: 360px;
}
@include bp (sd) {
margin-bottom: 0;
}
}
@@ -32,64 +35,135 @@
// Posters Set
.set {
--gap: 24px;
grid-column: 1 / span 8;
grid-column: span calc(var(--columns));
display: block;
@include bp (sm) {
grid-column: 2 / span 22;
}
cursor: grab;
@include bp (mob-lg) {
--gap: 32px;
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: var(--gap);
grid-column: 2 / span calc(var(--columns) - 2);
}
@include bp (sm) {
grid-column: 3 / span calc(var(--columns) - 4);
}
@include bp (md) {
grid-template-columns: repeat(3, 1fr);
cursor: default;
}
@include bp (sd) {
--gap: 48px;
grid-template-columns: repeat(4, 1fr);
&.is-dragging {
cursor: grabbing;
}
&__content {
display: flex;
margin: 0 -8px;
@include bp (mob-lg) {
margin: 0 -12px;
}
// @include bp (sm) {
// grid-column: 2 / span 22;
// }
// @include bp (mob-lg) {
// --gap: 32px;
// display: grid;
// grid-template-columns: repeat(2, 1fr);
// gap: var(--gap);
// }
@include bp (md) {
--gap: 32px;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--gap);
margin: 0;
}
@include bp (sd) {
--gap: 48px;
grid-template-columns: repeat(4, 1fr);
}
}
// Poster
.poster {
margin: 0 auto auto;
position: relative;
flex: 0 0 100%;
margin: 0 12px;
@include bp (mob-lg) {
flex: 0 0 calc(50% - 24px);
}
@include bp (sm) {
flex: 0 0 calc(50% - 24px);
}
// margin: 0 auto auto;
// 2 columns
&:nth-child(2n + 1) {
@include bp (sm, max) {
margin-top: calc(var(--gap) * 2);
}
}
// &:nth-child(2n + 1) {
// @include bp (sm, max) {
// margin-top: calc(var(--gap) * 2);
// }
// }
// 3 columns
&:nth-child(3n + 1) {
@include bp (sd, max) {
margin-top: calc(var(--gap) * 2);
}
}
&:nth-child(3n + 2) {
@include bp (sd, max) {
margin-top: var(--gap);
}
}
// &:nth-child(3n + 1) {
// @include bp (sd, max) {
// margin-top: calc(var(--gap) * 2);
// }
// }
// &:nth-child(3n + 2) {
// @include bp (sd, max) {
// margin-top: var(--gap);
// }
// }
// 4 columns
&:nth-child(4n + 1) {
@include bp (sd) {
margin-top: 64px * 3;
// &:nth-child(4n + 1) {
// @include bp (sd) {
// margin-top: 64px * 3;
// }
// }
// &:nth-child(4n + 2) {
// @include bp (sd) {
// margin-top: 64px * 2;
// }
// }
// &:nth-child(4n + 3) {
// @include bp (sd) {
// margin-top: 64px;
// }
// }
}
// Pagination
&__dots {
display: flex;
justify-content: center;
margin: 32px 0 48px;
li {
display: block;
padding: 4px;
cursor: pointer;
// Hover
&:hover {
button {
box-shadow: inset 0 0 0 8px $color-tertiary;
}
}
}
&:nth-child(4n + 2) {
@include bp (sd) {
margin-top: 64px * 2;
}
button {
display: block;
width: 8px;
height: 8px;
border-radius: 100%;
background: $color-primary-tertiary20;
padding: 0;
transition: box-shadow 1.0s var(--ease-quart);
}
&:nth-child(4n + 3) {
@include bp (sd) {
margin-top: 64px;
.is-active {
button {
box-shadow: inset 0 0 0 8px $color-tertiary;
}
}
}
@@ -99,10 +173,10 @@
.subscribe {
grid-column: 1 / span var(--columns);
max-width: 380px;
margin: 72px auto 0;
margin: 56px auto 0;
text-align: center;
@include bp (sm) {
@include bp (md) {
grid-column: 14 / span 8;
margin-top: 0;
text-align: left;
@@ -129,10 +203,14 @@
@include bp (sm) {
margin: 0;
}
&__email {
margin-bottom: 0;
}
&__bottom {
display: none;
}
}
.newsletter-form__bottom {
display: none;
}
}
}