-
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.
Merge pull request #38 from thelia/reworks/design-system
Reworks/design system
- Loading branch information
Showing
27 changed files
with
446 additions
and
201 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
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,82 @@ | ||
:root { | ||
--padding-button-sub: 22px; | ||
--padding-top-menu: 82px; | ||
--padding-x-menu: 55px; | ||
--padding-button-close: 24px; | ||
} | ||
|
||
@media screen and (min-width: theme('screens.lg')) { | ||
#Menu { | ||
ul { | ||
button, | ||
ul { | ||
@apply hidden; | ||
} | ||
} | ||
} | ||
} | ||
@media screen and (max-width: theme('screens.lg')) { | ||
#Menu { | ||
@apply hidden fixed inset-0 bg-white text-black; | ||
|
||
> ul { | ||
@apply h-full relative; | ||
} | ||
ul { | ||
@apply flex flex-col items-stretch gap-0 pb-[var(--header-nav-height)] pt-[var(--padding-top-menu)] justify-start; | ||
|
||
padding-right: calc(var(--padding-x-menu) - var(--padding-button-sub)); | ||
padding-left: var(--padding-x-menu); | ||
|
||
li { | ||
@apply flex items-center justify-between text-lg font-semibold; | ||
|
||
line-height: var(--line-height-paragraph-1); | ||
gap: calc(30px - var(--padding-button-sub)); | ||
} | ||
a { | ||
@apply py-[var(--padding-button-sub)]; | ||
} | ||
button { | ||
@apply p-[var(--padding-button-sub)]; | ||
} | ||
svg { | ||
@apply w-[28px]; | ||
} | ||
ul { | ||
@apply hidden fixed bg-white left-0 right-0 top-[var(--padding-top-menu)] bottom-[var(--header-nav-height)] pt-0; | ||
|
||
&.is-active { | ||
@apply block; | ||
} | ||
} | ||
} | ||
|
||
&.is-open { | ||
@apply block h-full; | ||
} | ||
} | ||
} | ||
|
||
[data-menu-close] { | ||
@apply block lg:hidden p-[var(--padding-button-close)] absolute right-0 top-0 z-10; | ||
|
||
svg { | ||
@apply w-[32px] text-grey-dark; | ||
} | ||
} | ||
|
||
[data-menu-back] { | ||
@apply lg:hidden p-[var(--padding-button-close)] absolute top-0 z-10 -translate-y-1/2; | ||
|
||
left: calc(var(--padding-x-menu) - var(--padding-button-close)); | ||
top: calc(var(--padding-top-menu) / 2); | ||
|
||
svg { | ||
@apply w-[28px]; | ||
} | ||
} | ||
|
||
[data-menu-back='-1'] { | ||
@apply hidden; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<div class='xl:container xl:mx-auto'> | ||
<div class='h2 text-black pb-6'>{{ title }}</div> | ||
<div class='pb-6 text-black h2'>{{ title }}</div> | ||
</div> | ||
|
||
<div class='CrossSelling slider'> | ||
{% for product in products %} | ||
{% include '../../Organisms/ProductCard/ProductCard.twig' with product %} | ||
{% endfor %} | ||
{% 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 class='mt-5 xl:container xl:mx-auto'> | ||
{% 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
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 |
---|---|---|
@@ -1,12 +1,21 @@ | ||
<footer class='flex flex-col px-6 xl:px-[120px] py-6 xl:flex-row xl:justify-between FooterCheckout bg-theme-lightest gap-9 sm:gap-3'> | ||
<div class='flex flex-col gap-2 sm:gap-6 sm:flex-row'> | ||
<div class='paragraph-5'><a href='#'>Plan du site</a></div> | ||
<div class='paragraph-5'><a href='#'>Mentions légales</a></div> | ||
<div class='paragraph-5'><a href='#'>Données personnelles</a></div> | ||
<div class='paragraph-5'><a href='#'>Cookies</a></div> | ||
<div class='paragraph-5'><a href='#'>Conditions générales de vente</a></div> | ||
</div> | ||
|
||
<div class='paragraph-5'>© OpenStudio - 2024</div> | ||
</div | ||
</footer> | ||
<footer class='flex flex-col px-6 xl:px-[120px] py-6 xl:flex-row xl:justify-between FooterCheckout bg-theme-lightest gap-9 md:gap-3 text-black'> | ||
<ul class='flex flex-col gap-2 md:gap-6 md:flex-row'> | ||
{% set footerLinkClass = 'underline hover:no-underline focus:no-underline hover:opacity-75 focus:opacity-75' %} | ||
<li class='paragraph-5'> | ||
<a href='#' class="{{footerLinkClass}}">Plan du site</a> | ||
</li> | ||
<li class='paragraph-5'> | ||
<a href='#' class="{{footerLinkClass}}">Mentions légales</a> | ||
</li> | ||
<li class='paragraph-5'> | ||
<a href='#' class="{{footerLinkClass}}">Données personnelles</a> | ||
</li> | ||
<li class='paragraph-5'> | ||
<a href='#' class="{{footerLinkClass}}">Cookies</a> | ||
</li> | ||
<li class='paragraph-5'> | ||
<a href='#' class="{{footerLinkClass}}">Conditions générales de vente</a> | ||
</li> | ||
</ul> | ||
<span class='text-grey indication indication-small'>© OpenStudio - 2024</span> | ||
</div</footer> |
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,58 @@ | ||
export default () => { | ||
Menu(); | ||
|
||
const btn = document.getElementById('toggleMenu'); | ||
|
||
btn.addEventListener('click', () => | ||
document.getElementById('Menu').classList.toggle('is-open') | ||
); | ||
}; | ||
|
||
export function Menu() { | ||
const menu = document.getElementById('Menu'); | ||
if (!menu) return null; | ||
|
||
let previous = 0; | ||
|
||
const closeBtn = menu.querySelector('[data-menu-close]'); | ||
const backBtn = menu.querySelector('[data-menu-back]'); | ||
const subBtns = menu.querySelectorAll('[data-menu-item]'); | ||
const subs = menu.querySelectorAll('[data-menu-sub]'); | ||
|
||
closeBtn?.addEventListener('click', () => { | ||
menu.classList.remove('is-open'); | ||
backBtn.dataset.menuBack = -1; | ||
subs.forEach((sub) => { | ||
sub.classList.remove('is-active'); | ||
}); | ||
}); | ||
|
||
backBtn?.addEventListener('click', () => { | ||
displaySubMenu(previous); | ||
}); | ||
|
||
subBtns?.forEach((btn) => { | ||
btn.addEventListener('click', () => { | ||
displaySubMenu(btn.dataset.menuItem); | ||
}); | ||
}); | ||
|
||
function displaySubMenu(current) { | ||
subs.forEach((sub) => { | ||
sub.classList.remove('is-active'); | ||
|
||
if (sub.dataset.menuSub === current) { | ||
previous = sub.dataset.menuPrevious; | ||
sub.classList.add('is-active'); | ||
[...subs] | ||
.find((s) => s.dataset.menuSub === previous) | ||
?.classList.add('is-active'); | ||
displayBackBtn(previous ?? -1); | ||
} | ||
}); | ||
} | ||
|
||
function displayBackBtn(previous) { | ||
backBtn.dataset.menuBack = previous; | ||
} | ||
} |
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
Oops, something went wrong.