mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-blog.git
synced 2026-07-03 15:41:26 +00:00
update pc menu behavior
This commit is contained in:
parent
0541250822
commit
18ddbb82f1
1 changed files with 10 additions and 6 deletions
|
|
@ -148,11 +148,15 @@ const tocHeadings = headings.filter((h) => h.depth === 2 || h.depth === 3);
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 1300px) {
|
@media (min-width: 1200px) {
|
||||||
.post-menu {
|
.post-menu {
|
||||||
--content-width: 90ch;
|
--content-width: 90ch;
|
||||||
--menu-width: 180px;
|
--menu-width: clamp(
|
||||||
--menu-gap: 2.2rem;
|
140px,
|
||||||
|
calc((100vw - 1200px) * 0.42 + 140px),
|
||||||
|
260px
|
||||||
|
);
|
||||||
|
--menu-gap: 0rem;
|
||||||
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 8.5rem;
|
top: 8.5rem;
|
||||||
|
|
@ -170,7 +174,7 @@ const tocHeadings = headings.filter((h) => h.depth === 2 || h.depth === 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 1299px) {
|
@media (max-width: 1200px) {
|
||||||
.post-menu-mobile-toggle {
|
.post-menu-mobile-toggle {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -304,7 +308,7 @@ const tocHeadings = headings.filter((h) => h.depth === 2 || h.depth === 3);
|
||||||
});
|
});
|
||||||
|
|
||||||
const updateVisibility = () => {
|
const updateVisibility = () => {
|
||||||
if (window.innerWidth >= 1300) {
|
if (window.innerWidth >= 1200) {
|
||||||
btn.classList.remove("is-visible");
|
btn.classList.remove("is-visible");
|
||||||
closeMenu();
|
closeMenu();
|
||||||
return;
|
return;
|
||||||
|
|
@ -319,7 +323,7 @@ const tocHeadings = headings.filter((h) => h.depth === 2 || h.depth === 3);
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateCurrentHeading = () => {
|
const updateCurrentHeading = () => {
|
||||||
if (window.innerWidth >= 1300) return;
|
if (window.innerWidth >= 1200) return;
|
||||||
|
|
||||||
headingItems = getHeadingElements();
|
headingItems = getHeadingElements();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue