-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/ava #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/ava #80
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,10 +46,35 @@ | |
| window.addEventListener("hashchange", scrollToTarget); | ||
|
|
||
| // change header to sticky if scrolled past 0.25 of the page and not data-big-header | ||
| let dataBigTimeout; | ||
| window.addEventListener("scroll", () => { | ||
| const header = document.querySelector("header"); | ||
| if (!header) return; | ||
| if (header.hasAttribute("data-big")) return; | ||
| header.classList.toggle("sticky", window.scrollY > 100); | ||
|
|
||
| const scrollY = window.scrollY; | ||
| // if at root | ||
| clearTimeout(dataBigTimeout); | ||
| dataBigTimeout = setTimeout(() => { | ||
|
Comment on lines
+49
to
+57
|
||
| if (window.location.pathname.replaceAll(/\/(en|jp)/g, "") === "/") { | ||
| const is_big = header.hasAttribute("data-big"); | ||
|
|
||
| if (scrollY > 200 && !is_big) { | ||
| header.classList.add("sticky"); | ||
| } else { | ||
| header.classList.remove("sticky"); | ||
| } | ||
|
|
||
| if (scrollY > 240) { | ||
| header.removeAttribute("data-big"); | ||
| return; | ||
| } | ||
| if (!is_big && (scrollY < 100)) { | ||
| header.setAttribute("data-big", ""); | ||
| return; | ||
| } | ||
| } | ||
| }, 100); | ||
|
|
||
| // header.classList.toggle("sticky", window.scrollY > 100); | ||
| }); | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -13,7 +13,7 @@ | |||||
| align-items: center; | ||||||
| flex-direction: column; | ||||||
| margin: 20px; | ||||||
| width: 175px; | ||||||
| width: 100px; | ||||||
|
||||||
| width: 100px; | |
| width: var(--portrait-width, 100%); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Review the removal of the wrapping anchor around the portrait image to ensure that the intended interactive area for users is preserved.