diff options
author | 0neGal <mail@0negal.com> | 2022-01-23 21:58:56 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-01-23 21:58:56 +0100 |
commit | f474005ea330198caa066a50c5f71ff087d4158f (patch) | |
tree | 8064fc7d8d206bc4106766c47025600c769bd245 /src/app/browser.js | |
parent | 8747588222f1bd434af802262b1479ef5b606097 (diff) | |
download | Viper-f474005ea330198caa066a50c5f71ff087d4158f.tar.gz Viper-f474005ea330198caa066a50c5f71ff087d4158f.zip |
added loading, close button, element fadein etc
To show the loading simply do Browser.loading(), when a BrowserEl() is
made it auto removes it. The loading and BrowserEl's will fade into
view instead of popping in instantly.
And then now there's a tiny close button, as it may not be obvious you
can click the dark overlay or click Escape.
Diffstat (limited to 'src/app/browser.js')
-rw-r--r-- | src/app/browser.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/app/browser.js b/src/app/browser.js index 50cabfe..8af6afe 100644 --- a/src/app/browser.js +++ b/src/app/browser.js @@ -28,6 +28,11 @@ var Browser = { description: pkg.description }) } + }, + loading: () => { + if (! browserEntries.querySelector(".loading")) { + browserEntries.innerHTML = `<div class="loading">${lang("gui.browser.loading")}</div>`; + } } }; Browser.toggle() Browser.loadfront() @@ -45,7 +50,11 @@ function BrowserEl(properties) { ...properties } - browser.innerHTML += ` + if (browserEntries.querySelector(".loading")) { + browserEntries.innerHTML = ""; + } + + browserEntries.innerHTML += ` <div class="el"> <div class="image"> <img src="${properties.image}"> @@ -59,7 +68,3 @@ function BrowserEl(properties) { </div> ` } - -new BrowserEl() -new BrowserEl() -new BrowserEl() |