forked from extern/the-glorious-startpage
right dashboard overlay hider
This commit is contained in:
parent
fa91a3a568
commit
94a422d852
@ -40,3 +40,27 @@
|
||||
z-index: 7 !important;
|
||||
scrollbar-width: none !important;
|
||||
}
|
||||
|
||||
/*Overlay*/
|
||||
.dashboardOverlay {
|
||||
position: absolute;
|
||||
visibility: none;
|
||||
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
z-index: -2;
|
||||
filter: blur(var(--blur-strength)) brightness(70%);
|
||||
transition: visibility var(--transition-speed),
|
||||
z-index var(--transition-speed);
|
||||
}
|
||||
|
||||
.showDashboardOverlay {
|
||||
visibility: visible !important;
|
||||
z-index: 6 !important;
|
||||
}
|
@ -60,6 +60,7 @@
|
||||
<h2>gagoka</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dashboardOverlay" id="dashboardOverlay"></div>
|
||||
|
||||
|
||||
<script src="js/body-background-set.js"></script>
|
||||
|
@ -1,11 +1,14 @@
|
||||
var dashboard = document.getElementById("rightDashboard");
|
||||
var dashboardOverlay = document.getElementById("dashboardOverlay");
|
||||
|
||||
let rightDashboardVisibility = false;
|
||||
|
||||
|
||||
const showDashboard = () => {
|
||||
dashboard.classList.add('showRightDashboard');
|
||||
|
||||
// Show overlay
|
||||
dashboardOverlay.classList.add('showDashboardOverlay');
|
||||
|
||||
rightDashboardVisibility = !rightDashboardVisibility;
|
||||
}
|
||||
|
||||
@ -13,6 +16,9 @@ const hideDashboard = () => {
|
||||
dashboard.classList.remove('showRightDashboard');
|
||||
dashboard.scrollTop = 0;
|
||||
|
||||
// Hide overlay
|
||||
dashboardOverlay.classList.remove('showDashboardOverlay');
|
||||
|
||||
rightDashboardVisibility = !rightDashboardVisibility;
|
||||
}
|
||||
|
||||
@ -34,8 +40,14 @@ const toggleDashboard = () => {
|
||||
showDashboard();
|
||||
}
|
||||
|
||||
// Show overlay
|
||||
// centeredBoxOverlay.classList.toggle('showOverlay');
|
||||
|
||||
console.log('toggle dashboard');
|
||||
console.log('toggle dashboard');
|
||||
}
|
||||
|
||||
dashboardOverlay.addEventListener(
|
||||
"mouseup",
|
||||
() => {
|
||||
if (rightDashboardVisibility) {
|
||||
toggleDashboard();
|
||||
}
|
||||
}
|
||||
);
|
Loading…
Reference in New Issue
Block a user