diff --git a/assets/css/src/nav.css b/assets/css/src/nav.css index 04c6b8a..f625489 100644 --- a/assets/css/src/nav.css +++ b/assets/css/src/nav.css @@ -1,7 +1,7 @@ /* ================= ENTRIES BTNS ================= */ #entry-btns { position: sticky; - top: calc(var(--unit--vertical) * 8); + top: calc(var(--unit--vertical) * 10); display: flex; justify-content: space-between; z-index: 2; @@ -11,6 +11,9 @@ transition: all 0.5s var(--curve-sine); } +[data-template="home"] #entry-btns { + transform: translateY(calc(0rem - var(--unit--vertical-relative) * 8)); +} [data-template="linear"] #entry-btns { transform: translateY(calc(0rem - var(--unit--vertical-relative) * 4)); } @@ -74,49 +77,44 @@ .panel-close { position: fixed; - top: 0; - border: none; + justify-content: center; + width: calc(100% - 2 * var(--unit--horizontal)); + bottom: 0; outline: none; - height: 100svh; - width: calc(var(--unit--horizontal) * 2); - font-size: 0.8rem; - display: flex; + border-top: 1px solid #fff; + font-size: var(--font-size-m); + background-color: #000; + padding: calc(var(--unit--vertical) / 2) 0; + margin-bottom: env(safe-area-inset-bottom); } -.panel--left .panel-close { - right: 0; - justify-content: flex-end; -} +/* ================= LISTS ================= */ -.panel-close::after { - content: "◀"; -} - -/* ================= YEARS ================= */ -.year__toggle { +.panel__toggle-btn { width: 100%; display: flex; justify-content: space-between; margin-bottom: var(--unit--vertical); } -.year__toggle-icon { +.panel__toggle-icon { color: var(--color-secondary); font-size: var(--font-size-xl); } -.year__edito { +/* ================= YEARS ================= */ +.panel-item-content__edito { margin-bottom: calc(var(--unit--vertical) / 2); } -.year__edito.short { +.panel-item-content__edito.short { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; } -.year__texts { +.panel-item-content__texts { margin-top: var(--unit--vertical); } diff --git a/assets/js/script.js b/assets/js/script.js index e41fdbc..8e468c8 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -91,7 +91,7 @@ function enableToggleEntriesVisibility() { }); }; - const top = verticalUnit * 6; + const top = verticalUnit * 8; const observer = new IntersectionObserver(toggleVisibility, { root: null, @@ -114,7 +114,17 @@ function toggleLogoState() { function togglePanel(side) { document.querySelector(`.panel--${side}`).classList.toggle("open"); - document.querySelector("#main-header").classList.remove("minimized"); + const isOpen = document + .querySelector(`.panel--${side}`) + .classList.contains("open"); + + const scrollY = window.scrollY || window.pageYOffset; + + if (isOpen) { + document.querySelector("#main-header").classList.remove("minimized"); + } else if (scrollY > 10) { + document.querySelector("#main-header").classList.add("minimized"); + } } document.addEventListener("DOMContentLoaded", () => { diff --git a/site/collections/categories.php b/site/collections/categories.php new file mode 100644 index 0000000..ad4645a --- /dev/null +++ b/site/collections/categories.php @@ -0,0 +1,27 @@ +find('texts'); + $years = $textsPage->children(); + $texts = $years->children()->index(); + + $categories = array(); + + foreach ($textsPage->categories()->split() as $category) { + $categories[$category] = array( + 'title' => $category, + 'texts' => array() + ); + } + + foreach ($texts as $text) { + try { + $categories[$text->category()->value()]['texts'][] = $text; + } catch (\Throwable $th) { + throw new Exception(json_encode($th->getFile() . ' : ' . $th->getMessage())); + } + } + + return $categories; + +}; diff --git a/site/snippets/nav.php b/site/snippets/nav.php index 5af04a8..6cf9690 100644 --- a/site/snippets/nav.php +++ b/site/snippets/nav.php @@ -11,32 +11,30 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/site/templates/home.php b/site/templates/home.php index 2110172..188318b 100644 --- a/site/templates/home.php +++ b/site/templates/home.php @@ -8,15 +8,7 @@ et des techniques
- - - [ - 'label' => 'édito', - 'content' => $site->edito() - ] - ]) ?> - + \ No newline at end of file