mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-19 18:42:34 +00:00
Fix .footer-fixed toggle and position
* See: https://github.com/next-theme/hexo-theme-next/pull/31
This commit is contained in:
parent
81b4d077ea
commit
1501440d8d
@ -4,6 +4,8 @@
|
|||||||
color: $grey-dark;
|
color: $grey-dark;
|
||||||
font-size: $font-size-small;
|
font-size: $font-size-small;
|
||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
|
transition: $transition-ease;
|
||||||
|
transition-property: left, right;
|
||||||
|
|
||||||
&.footer-fixed {
|
&.footer-fixed {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|||||||
@ -4,6 +4,10 @@ if (hexo-config('sidebar.position') == 'right') {
|
|||||||
// Otherwise a horizontal scrollbar will appear
|
// Otherwise a horizontal scrollbar will appear
|
||||||
+desktop-large() {
|
+desktop-large() {
|
||||||
padding-right: $sidebar-desktop;
|
padding-right: $sidebar-desktop;
|
||||||
|
|
||||||
|
.footer-fixed {
|
||||||
|
right: $sidebar-desktop;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18,6 +22,10 @@ if (hexo-config('sidebar.position') == 'right') {
|
|||||||
.sidebar-active {
|
.sidebar-active {
|
||||||
+desktop-large() {
|
+desktop-large() {
|
||||||
padding-left: $sidebar-desktop;
|
padding-left: $sidebar-desktop;
|
||||||
|
|
||||||
|
.footer-fixed {
|
||||||
|
left: $sidebar-desktop;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
|
|
||||||
function updateFooterPosition() {
|
function updateFooterPosition() {
|
||||||
const footer = document.querySelector('.footer');
|
const footer = document.querySelector('.footer');
|
||||||
const containerHeight = document.querySelector('.column').offsetHeight + document.querySelector('.main').offsetHeight + footer.offsetHeight;
|
const containerHeight = document.querySelector('.main').offsetHeight + footer.offsetHeight;
|
||||||
footer.classList.toggle('footer-fixed', containerHeight <= window.innerHeight);
|
footer.classList.toggle('footer-fixed', containerHeight <= window.innerHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user