Fixed a lot of responsive problems.
- Fixed auth problem - Fixed BBCode and Markdown apparition in some unnecessary parts
This commit is contained in:
18
resources/js/mobile-back-to-top.js
Normal file
18
resources/js/mobile-back-to-top.js
Normal file
@@ -0,0 +1,18 @@
|
||||
export function initMobileBackToTop(){
|
||||
const backToTopButton = document.querySelector('.back-to-top');
|
||||
const content = document.getElementById('content');
|
||||
|
||||
if (!backToTopButton || !content) {
|
||||
return;
|
||||
}
|
||||
|
||||
const toggleBackToTop = () => {
|
||||
const shouldShow = window.innerWidth <= 768 && content.scrollTop > 320;
|
||||
|
||||
backToTopButton.classList.toggle('visible', shouldShow);
|
||||
};
|
||||
|
||||
toggleBackToTop();
|
||||
content.addEventListener('scroll', toggleBackToTop, { passive: true });
|
||||
window.addEventListener('resize', toggleBackToTop, { passive: true });
|
||||
}
|
||||
Reference in New Issue
Block a user