diff options
| author | Eltrac <hi@guhub.cn> | 2025-09-18 18:54:52 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-18 18:54:52 +0800 |
| commit | 2afcb97eeab22b2ae7b3dc697e0cfab318aa0722 (patch) | |
| tree | 9a101095d390ea3a336427e295210d11eab824f3 /src/overlay.js | |
| parent | d26860e424227003122b077c8d2e76223d760e67 (diff) | |
| parent | 7113655e17a38d9d73cffe469c28b6ddf5b0636f (diff) | |
Merge pull request #2 from QuarkPixel/master
Fix Multiple UI/UX Issues and Improve Configuration Management
Diffstat (limited to 'src/overlay.js')
| -rw-r--r-- | src/overlay.js | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/overlay.js b/src/overlay.js index 613340c..78fb579 100644 --- a/src/overlay.js +++ b/src/overlay.js @@ -1,15 +1,13 @@ -export default class Overlay { - zIndex = 900; - zIndexHidden = -100; +import config from './config'; +export default class Overlay { constructor() { const overlay = document.createElement('div'); overlay.id = 'libra-overlay'; - overlay.classList.add('libra-overlay'); + overlay.classList.add('libra-overlay', 'libra-hidden'); - // initialized state - overlay.style.zIndex = this.zIndexHidden; - overlay.style.opacity = '0'; + // Set transition duration from config + overlay.style.transitionDuration = config.transitionDuration + 'ms'; this.element = overlay; document.body.appendChild(overlay); @@ -18,12 +16,12 @@ export default class Overlay { } show() { - this.element.style.opacity = '1'; - this.element.style.zIndex = this.zIndex; + this.element.classList.remove('libra-hidden'); + this.element.classList.add('libra-visible'); } hide() { - this.element.style.opacity = '0'; - this.element.style.zIndex = '-100'; + this.element.classList.remove('libra-visible'); + this.element.classList.add('libra-hidden'); } } |
