center box overlay added

This commit is contained in:
Gerome Matilla 2020-06-04 10:06:27 +08:00
parent bcbaabbe6c
commit c4b4ac482d
4 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#centeredBoxOverlay {
background: transparent;
opacity: 0;
backdrop-filter: blur(var(--blur-strength));
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
margin: 0;
padding: 0;
z-index: -1;
filter: brightness(70%);
transition: opacity var(--transition-speed), z-index var(--transition-speed);
}
#centeredBoxOverlay.showOverlay {
transition: opacity var(--transition-speed);
opacity: 1;
z-index: 0;
}

View File

@ -6,6 +6,7 @@
@import url('dock.css'); @import url('dock.css');
@import url('dock-buttons.css'); @import url('dock-buttons.css');
@import url('centered-box.css'); @import url('centered-box.css');
@import url('centered-box-overlay.css');
@import url('profile-image.css'); @import url('profile-image.css');
@import url('search-box.css'); @import url('search-box.css');

View File

@ -46,6 +46,7 @@
</div> </div>
</div> </div>
<div id="centeredBoxOverlay"></div>
<div class='centeredBar' id='centeredBox'> <div class='centeredBar' id='centeredBox'>
<div id='profileImageContainer'> <div id='profileImageContainer'>
<div id='profileImage'></div> <div id='profileImage'></div>

View File

@ -1,4 +1,5 @@
var searchBox = document.getElementById('searchBox'); var searchBox = document.getElementById('searchBox');
var centeredBoxOverlay = document.getElementById('centeredBoxOverlay');
let searchBoxVisility = false; let searchBoxVisility = false;
@ -35,5 +36,8 @@ const toggleSearchBox = () => {
showSearchBox(); showSearchBox();
} }
// Show overlay
centeredBoxOverlay.classList.toggle('showOverlay');
console.log('toggle searchbox'); console.log('toggle searchbox');
} }