From 76c8c31c89ef60d3e3ac08fc3343c15d92852a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Sat, 29 Feb 2020 18:32:32 +0100 Subject: [PATCH] Readapt the misuse of BEM, Code organization - -- is only for a modifier, not a child "child". Use master__child without the parent__ in it to make it more readable. https://www.smashingmagazine.com/2016/06/battling-bem-extended-edition-common-problems-and-how-to-avoid-them/ - Redefine atom design components --- src/molecules/Photo.svelte | 8 +- src/molecules/Switcher.svelte | 11 - src/organisms/Carousel.svelte | 26 +-- src/routes/credits.svelte | 2 +- .../location/[country]/[location].svelte | 9 +- src/style/atoms/_link.scss | 2 + src/style/molecules/_location.scss | 85 ++++++++ src/style/molecules/_photo.scss | 148 ++++++------- src/style/organisms/_carousel.scss | 197 +++++++++--------- .../{molecules => organisms}/_footer.scss | 13 +- src/style/organisms/_locations.scss | 86 +------- .../{molecules => organisms}/_pagination.scss | 72 +++---- src/style/organisms/_photos.scss | 65 +++--- src/style/pages/_homepage.scss | 2 +- src/style/pages/_page.scss | 33 ++- src/style/pages/_place.scss | 12 +- src/style/style.scss | 7 +- 17 files changed, 387 insertions(+), 391 deletions(-) create mode 100644 src/style/molecules/_location.scss rename src/style/{molecules => organisms}/_footer.scss (91%) rename src/style/{molecules => organisms}/_pagination.scss (62%) diff --git a/src/molecules/Photo.svelte b/src/molecules/Photo.svelte index 473a6c1..e1af0d4 100644 --- a/src/molecules/Photo.svelte +++ b/src/molecules/Photo.svelte @@ -33,7 +33,7 @@ onMount(() => { // Parallax on photo when the image has been loaded const parallaxNumber = basicScroll.default.create({ - elem: photoElement.querySelector('.photo__image--number'), + elem: photoElement.querySelector('.photo__number'), direct: photoElement, from: 'top-bottom', to: 'bottom-top', @@ -64,7 +64,7 @@
- + {#if layout === 'list'} @@ -86,10 +86,10 @@ {/if} -
diff --git a/src/molecules/Switcher.svelte b/src/molecules/Switcher.svelte index d3fa0bc..00b92e4 100644 --- a/src/molecules/Switcher.svelte +++ b/src/molecules/Switcher.svelte @@ -49,14 +49,3 @@ - - \ No newline at end of file diff --git a/src/organisms/Carousel.svelte b/src/organisms/Carousel.svelte index 428e708..b44ead4 100644 --- a/src/organisms/Carousel.svelte +++ b/src/organisms/Carousel.svelte @@ -81,7 +81,7 @@ // Hover function hover = event => { const button = event.currentTarget.querySelector('button') - const photoActive = document.querySelector('.gallery__images .active') + const photoActive = document.querySelector('.gallery__photo--active') let photoToHover if (event.currentTarget.dataset.to === 'prev') { @@ -122,10 +122,10 @@