redesign nav panel years
This commit is contained in:
parent
85a6807984
commit
a2722a0264
10 changed files with 112 additions and 68 deletions
|
|
@ -2,12 +2,8 @@ const verticalUnit = getUnit("--unit--vertical");
|
|||
|
||||
function getUnit(id) {
|
||||
const remFactor = 16;
|
||||
const rawUnit = getComputedStyle(document.documentElement).getPropertyValue(
|
||||
id
|
||||
);
|
||||
if (rawUnit.length === 0) {
|
||||
throw new Error(`getUnit() error : css variable ${id} doesn't exists.`);
|
||||
}
|
||||
const rawUnit =
|
||||
getComputedStyle(document.documentElement).getPropertyValue(id) || "1.7rem";
|
||||
const remUnit = parseFloat(rawUnit);
|
||||
const pxUnit = remUnit * remFactor;
|
||||
return pxUnit;
|
||||
|
|
@ -126,12 +122,9 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
top: 0,
|
||||
});
|
||||
|
||||
window.addEventListener(
|
||||
"scroll",
|
||||
throttle(() => {
|
||||
toggleLogoState();
|
||||
}, 10)
|
||||
);
|
||||
window.addEventListener("scroll", () => {
|
||||
toggleLogoState();
|
||||
});
|
||||
|
||||
setWindowHeightFactor();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue