From f25979eff133f0e1275db9ddf5512751c4547e73 Mon Sep 17 00:00:00 2001 From: bluesaxman Date: Thu, 7 Apr 2022 19:51:27 -0600 Subject: [PATCH] Some more minor tweeks to blueui window class, and more tweeks to index and css --- css/css.css | 27 +++++++++++++++++++++++---- index.html | 5 +++++ libs/blueui.js | 8 +++++--- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/css/css.css b/css/css.css index e61e0ad..3e092bb 100644 --- a/css/css.css +++ b/css/css.css @@ -4,10 +4,17 @@ } body { + width: 100%; + height: 100%; display: flex; justify-content:center; align-items:center; - flex-direction: column; +} + +body > .bui_window_root { + flex:1; + width: 99%; + height: 99%; } .bui_window_content { @@ -36,9 +43,10 @@ body { } .bui_window_root { - display: inline-block; - position: relative; - background: rgba(200,200,200,1); + display: block; + position: absolute; + background: rgba(200,200,200,0.7); + backdrop-filter: blur(5px); color: black; border: solid 1px rgba(140,140,140,1); border-radius: 5px; @@ -60,3 +68,14 @@ body { right: 0; top: 0; } + +.bui_window_resize_handle { + position: absolute; + display: block; + bottom: 0; + right: 0; + height: 5px; + width: 5px; + background: rgba(0,0,0,0.01); + cursor: pointer; +} diff --git a/index.html b/index.html index 6b98a5a..20159f6 100644 --- a/index.html +++ b/index.html @@ -63,8 +63,13 @@ blueui.js - Adds classes for several highly reusable ui objects such as buttons document.body.appendChild(window.bdescription.root); window.bdescription.content.appendChild(window.bcore.root); + window.bcore.root.style.top = "40px"; window.bdescription.content.appendChild(window.baudio.root); + window.baudio.root.style.top = "80px"; window.bdescription.content.appendChild(window.bmath.root); + window.bmath.root.style.top = "120px"; window.bdescription.content.appendChild(window.bpixle.root); + window.bpixle.root.style.top = "160px"; window.bdescription.content.appendChild(window.bui.root); + window.bui.root.style.top = "200px"; diff --git a/libs/blueui.js b/libs/blueui.js index 3f909e3..0427217 100644 --- a/libs/blueui.js +++ b/libs/blueui.js @@ -82,8 +82,8 @@ function makeResizeable (targetNode, handleNode) { function initResize(e) { startX = e.clientX; startY = e.clientY; - startWidth = parseInt(document.defaultView.getComputedStyle(target).width, 10); - startHeight = parseInt(document.defaultView.getComputedStyle(target).height, 10); + startWidth = parseInt(document.defaultView.getComputedStyle(targetNode).width, 10); + startHeight = parseInt(document.defaultView.getComputedStyle(targetNode).height, 10); document.documentElement.addEventListener('mousemove', doResize, false); document.documentElement.addEventListener('mouseup', stopResize, false); } @@ -133,6 +133,8 @@ class buiWindow { this.main.setAttribute("class","bui_window_main"); this.content = document.createElement("div"); this.content.setAttribute("class","bui_window_content"); + this.content.style.height = height+"px"; + this.content.style.width = width+"px"; this.main.appendChild(this.content); sizeable = "boolean" == typeof sizeable ? sizeable : true; if (sizeable) { @@ -142,7 +144,7 @@ class buiWindow { this.main.appendChild(this.resizeHandle); } this.root.appendChild(this.titlebar); - this.root.appendChild(this.content); + this.root.appendChild(this.main); } minimize () {