From b045d3f01a9d49b5ad391bcf3f1404900882c141 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sun, 24 Apr 2022 20:59:40 +0200 Subject: more minor improvements to the UI sped up some animations, added a few more colors to different places, overall just a slight spice up to the UI --- src/app/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/app/index.html') diff --git a/src/app/index.html b/src/app/index.html index 4b3b79f..02a150f 100644 --- a/src/app/index.html +++ b/src/app/index.html @@ -200,7 +200,7 @@ - + -- cgit v1.2.3 From 31545f96ac56e0bbc7d0ed59f86015d693d464d9 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Mon, 16 May 2022 23:51:26 +0200 Subject: added mod preview browser Instead of opening your normal web browser you can now just open the page inside Viper, many changes aren't finished yet, notably the webview.css file. At some point I'll split the main.css into more files so the folder makes sense even though there's currently only one file in there. --- src/app/browser.js | 29 ++++++++++++++++++++++++++--- src/app/css/webview.css | 1 + src/app/index.html | 8 ++++++++ src/app/main.css | 21 +++++++++++++++++++++ src/index.js | 1 + 5 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 src/app/css/webview.css (limited to 'src/app/index.html') diff --git a/src/app/browser.js b/src/app/browser.js index 4d14885..b3b1b59 100644 --- a/src/app/browser.js +++ b/src/app/browser.js @@ -83,6 +83,7 @@ var Browser = { Browser.filters.toggle(false); overlay.classList.remove("shown") browser.classList.remove("shown") + preview.classList.remove("shown") return } } @@ -243,6 +244,20 @@ var Browser = { } } +var view = document.querySelector(".popup#preview webview"); +var Preview = { + show: () => { + preview.classList.add("shown") + }, + hide: () => { + preview.classList.remove("shown") + }, + set: (url, autoshow) => { + if (autoshow != false) {Preview.show()} + view.src = url; + } +} + function BrowserElFromObj(obj) { let pkg = {...obj, ...obj.versions[0]}; @@ -325,7 +340,7 @@ function BrowserEl(properties) {
${properties.title}
${properties.description}
- + @@ -413,8 +428,16 @@ search.addEventListener("keyup", () => { } }) -browser.addEventListener("scroll", () => { - Browser.filters.toggle(false); +let events = ["scroll", "mousedown", "touchdown"]; +events.forEach((event) => { + browser.addEventListener(event, () => { + Preview.hide(); + Browser.filters.toggle(false); + }) +}); + +view.addEventListener("dom-ready", () => { + view.insertCSS(fs.readFileSync(__dirname + "/css/webview.css", "utf8")); }) let checks = document.querySelectorAll(".check"); diff --git a/src/app/css/webview.css b/src/app/css/webview.css new file mode 100644 index 0000000..4a3fd85 --- /dev/null +++ b/src/app/css/webview.css @@ -0,0 +1 @@ +/* this gets imported into the preview */ diff --git a/src/app/index.html b/src/app/index.html index 02a150f..b146ba3 100644 --- a/src/app/index.html +++ b/src/app/index.html @@ -133,6 +133,14 @@
%%gui.browser.loading%%
+