feat: add dynamic header hiding on scroll and back-to-top button
- Hide header when scrolling down, show when scrolling up - Smooth transition animations for header hide/show - Floating back-to-top button in bottom right corner - Button appears after 300px scroll - Circular button with arrow icon and smooth animations - Mobile-responsive sizing for back-to-top button - Both features excluded from print view
This commit is contained in:
@@ -1660,3 +1660,68 @@ html {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Scroll Direction - Hide/Show Header
|
||||
======================================== */
|
||||
|
||||
/* Add smooth transition to header elements */
|
||||
.action-bar,
|
||||
.navigation-menu {
|
||||
transition: transform 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
/* Hide header when scrolling down */
|
||||
.action-bar.header-hidden {
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
|
||||
.navigation-menu.header-hidden {
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Back to Top Button
|
||||
======================================== */
|
||||
|
||||
.back-to-top {
|
||||
position: fixed;
|
||||
bottom: 2rem;
|
||||
right: 2rem;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background: var(--black-bar);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
||||
z-index: 99;
|
||||
transition: all 0.3s ease;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.back-to-top:hover {
|
||||
opacity: 1;
|
||||
transform: translateY(-3px);
|
||||
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
|
||||
background: #3a3a3a;
|
||||
}
|
||||
|
||||
.back-to-top:active {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
/* Mobile adjustments */
|
||||
@media (max-width: 768px) {
|
||||
.back-to-top {
|
||||
bottom: 1.5rem;
|
||||
right: 1.5rem;
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user