new nav buttons
This commit is contained in:
parent
7e21e1ffb7
commit
92625d2fb9
11 changed files with 552 additions and 39 deletions
|
|
@ -47,7 +47,7 @@
|
|||
margin-top: calc(var(--unit--vertical-relative) * 19);
|
||||
}
|
||||
|
||||
#home .page-cover {
|
||||
[data-template="home"] .page-cover {
|
||||
padding-top: calc(var(--unit--vertical-relative) * 6);
|
||||
}
|
||||
|
||||
|
|
|
|||
41
assets/css/src/nav.css
Normal file
41
assets/css/src/nav.css
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#entries {
|
||||
position: sticky;
|
||||
top: calc(var(--unit--vertical) * 8);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.entry-btn {
|
||||
transition: all 0.5s var(--curve-sine);
|
||||
}
|
||||
|
||||
[data-template="linear"] #entries {
|
||||
transform: translateY(calc(0rem - var(--unit--vertical-relative) * 4));
|
||||
}
|
||||
|
||||
.entry-btn--left::after,
|
||||
.entry-btn--right::before {
|
||||
transition: all 0.5s var(--curve-sine);
|
||||
content: "+";
|
||||
}
|
||||
.entry-btn--left::after {
|
||||
margin-left: var(--unit--horizontal);
|
||||
}
|
||||
.entry-btn--right::before {
|
||||
margin-right: var(--unit--horizontal);
|
||||
}
|
||||
|
||||
#entries.minimized {
|
||||
color: var(--color-secondary);
|
||||
}
|
||||
#entries.minimized .entry-btn::before,
|
||||
#entries.minimized .entry-btn::after {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#entries.minimized .entry-btn--left {
|
||||
margin-left: calc(-4px - var(--width));
|
||||
}
|
||||
#entries.minimized .entry-btn--right {
|
||||
margin-right: calc(-4px - var(--width));
|
||||
}
|
||||
|
|
@ -89,7 +89,7 @@ button.toggle.right.open::before {
|
|||
}
|
||||
|
||||
@media screen and (min-width: 640px) {
|
||||
#home #tabs {
|
||||
[data-template="home"] #tabs {
|
||||
margin-top: calc(0px - (10 * var(--unit--vertical)));
|
||||
}
|
||||
button.toggle.left::after {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
@import url("src/texts.css");
|
||||
@import url("src/header.css");
|
||||
@import url("src/tabs.css");
|
||||
@import url("src/nav.css");
|
||||
@import url("src/home.css");
|
||||
@import url("src/linear.css");
|
||||
@import url("src/footer.css");
|
||||
|
|
|
|||
475
assets/dist/style.css
vendored
475
assets/dist/style.css
vendored
File diff suppressed because one or more lines are too long
|
|
@ -73,25 +73,24 @@ function roundToNearestHalf(num) {
|
|||
return Math.max(round, 0);
|
||||
}
|
||||
|
||||
function enableToggleTabsVisibility() {
|
||||
const tabs = document.querySelector("#tabs");
|
||||
const toggleLeftBtn = tabs.querySelector("button.toggle.left");
|
||||
const toggleRightBtn = tabs.querySelector("button.toggle.right");
|
||||
const toggleLeftBtnWidth = toggleLeftBtn.offsetWidth;
|
||||
const toggleRightBtnWidth = toggleRightBtn.offsetWidth;
|
||||
function enableToggleEntriesVisibility() {
|
||||
const entries = document.querySelector("#entries");
|
||||
|
||||
toggleLeftBtn.style = `--width: ${toggleLeftBtnWidth}px`;
|
||||
toggleRightBtn.style = `--width: ${toggleRightBtnWidth}px`;
|
||||
const leftBtn = entries.querySelector(".entry-btn--left");
|
||||
const rightBtn = entries.querySelector(".entry-btn--right");
|
||||
const leftBtnWidth = leftBtn.offsetWidth;
|
||||
const rightBtnWidth = rightBtn.offsetWidth;
|
||||
|
||||
const toggleVisibility = (entries) => {
|
||||
entries.forEach((entry) => {
|
||||
const isIntersecting = entry.isIntersecting;
|
||||
leftBtn.style = `--width: ${leftBtnWidth}px`;
|
||||
rightBtn.style = `--width: ${rightBtnWidth}px`;
|
||||
|
||||
const toggleVisibility = (items) => {
|
||||
items.forEach((item) => {
|
||||
const isIntersecting = item.isIntersecting;
|
||||
if (isIntersecting) {
|
||||
console.log("is intersecting");
|
||||
tabs.classList.remove("minimized");
|
||||
entries.classList.remove("minimized");
|
||||
} else {
|
||||
console.log("is not intersecting");
|
||||
tabs.classList.add("minimized");
|
||||
entries.classList.add("minimized");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -104,7 +103,7 @@ function enableToggleTabsVisibility() {
|
|||
threshold: 0,
|
||||
});
|
||||
|
||||
observer.observe(tabs);
|
||||
observer.observe(entries);
|
||||
}
|
||||
|
||||
function toggleLogoState() {
|
||||
|
|
@ -132,6 +131,6 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
|
||||
// Wait for fonts applied
|
||||
setTimeout(() => {
|
||||
enableToggleTabsVisibility();
|
||||
enableToggleEntriesVisibility();
|
||||
}, 100);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue