mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-18 18:33:42 +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;
|
||||
font-size: $font-size-small;
|
||||
padding: 20px 0;
|
||||
transition: $transition-ease;
|
||||
transition-property: left, right;
|
||||
|
||||
&.footer-fixed {
|
||||
bottom: 0;
|
||||
|
||||
@ -4,6 +4,10 @@ if (hexo-config('sidebar.position') == 'right') {
|
||||
// Otherwise a horizontal scrollbar will appear
|
||||
+desktop-large() {
|
||||
padding-right: $sidebar-desktop;
|
||||
|
||||
.footer-fixed {
|
||||
right: $sidebar-desktop;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,6 +22,10 @@ if (hexo-config('sidebar.position') == 'right') {
|
||||
.sidebar-active {
|
||||
+desktop-large() {
|
||||
padding-left: $sidebar-desktop;
|
||||
|
||||
.footer-fixed {
|
||||
left: $sidebar-desktop;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
function updateFooterPosition() {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user