-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0632e80
commit 2d7237f
Showing
7 changed files
with
101 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.slider { | ||
cursor: grab; | ||
user-select: none; | ||
&:active { | ||
cursor: grabbing; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...s/Layout/SimilarContent/similarContent.js → assets/js/slider.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import CrossSelling from './CrossSelling.twig'; | ||
import { slider } from '../../../assets/js/slider'; | ||
|
||
export default { | ||
title: 'Design System/Layout/CrossSelling' | ||
}; | ||
|
||
const standardProduct = { | ||
productTitle: 'Nom du produit', | ||
secondaryTitle: 'Titre secondaire', | ||
price: '1000,00€', | ||
promoPrice: '900,00€', | ||
rate: 4, | ||
isNew: true, | ||
displayWishButton: true, | ||
reviewCount: 12 | ||
}; | ||
|
||
const products = []; | ||
|
||
for (let i = 0; i < 5; i++) { | ||
products.push(standardProduct); | ||
} | ||
|
||
export const base = { | ||
render: (args) => CrossSelling(args), | ||
play: () => { | ||
slider(); | ||
}, | ||
args: { | ||
products, | ||
title: 'Derniers produits consultés', | ||
button: { href: '#', label: 'Tout voir' } | ||
}, | ||
parameters: { | ||
backgrounds: { default: 'grey' } | ||
}, | ||
argTypes: {} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div class='xl:container xl:mx-auto'> | ||
<div class='h2 text-black pb-6'>{{ title }}</div> | ||
</div> | ||
|
||
<div class='CrossSelling slider'> | ||
{% for product in products %} | ||
{% include '../../Organisms/ProductCard/ProductCard.twig' with product %} | ||
{% endfor %} | ||
</div> | ||
|
||
<div class='xl:container xl:mx-auto mt-5'> | ||
{% include '../../Molecules/Button/Button.twig' with {text: button.label, href: button.href,icon_right:'chevron-right', variant:'secondary'} %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
.CrossSelling { | ||
display: flex; | ||
gap: rem-convert(16px); | ||
overflow: hidden; | ||
|
||
.ProductCard { | ||
flex-shrink: 0; | ||
width: rem-convert(187px); | ||
@screen md { | ||
width: rem-convert(288px); | ||
} | ||
@screen lg { | ||
width: rem-convert(288px); | ||
} | ||
} | ||
|
||
|
||
@screen lg { | ||
display: grid; | ||
grid-template-columns: repeat(3, 1fr); | ||
gap: rem-convert(24px); | ||
cursor: initial; | ||
.ProductCard { | ||
width: initial; | ||
&:active { | ||
cursor: initial; | ||
} | ||
} | ||
} | ||
|
||
@screen xl { | ||
@apply container mx-auto; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters