mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-23 01:57:29 +00:00
Fade in overlay
This commit is contained in:
parent
b2a38f22e5
commit
23e6cd75e3
2 changed files with 12 additions and 2 deletions
|
|
@ -25,7 +25,12 @@ body.overlay-open {
|
|||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.9);
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
transition: background-color 400ms ease-out;
|
||||
}
|
||||
|
||||
body.overlay-open .overlay {
|
||||
background: rgba(0, 0, 0, 0.9);
|
||||
}
|
||||
|
||||
#close-modal {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,12 @@ class Overlay extends React.Component {
|
|||
|
||||
componentDidMount() {
|
||||
window.document.addEventListener("keydown", this._handleKeyDown);
|
||||
document.body.classList.add("overlay-open");
|
||||
// TODO: This is technically a race condition, since we could unmount before this fires.
|
||||
requestAnimationFrame(() => {
|
||||
// This does not seem to work the first time.
|
||||
// This should _not_ work on page load
|
||||
document.body.classList.add("overlay-open");
|
||||
});
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue