aboutsummaryrefslogtreecommitdiff
path: root/html/display.html
diff options
context:
space:
mode:
authoramy <[email protected]>2023-02-06 18:50:01 -0600
committeramy <[email protected]>2023-02-06 18:50:01 -0600
commitddd58e6a3b456a88132a2c135c804986156ab395 (patch)
tree2a22789bb4b4fc49cc4bccd8ee96dd02f690a65c /html/display.html
parentea5178ca1a4d2aaf2f8b8bc5b70a167f4819d590 (diff)
some fixs and additions idk lol
Diffstat (limited to 'html/display.html')
-rw-r--r--html/display.html38
1 files changed, 31 insertions, 7 deletions
diff --git a/html/display.html b/html/display.html
index 09ea35a..718a018 100644
--- a/html/display.html
+++ b/html/display.html
@@ -158,6 +158,7 @@
.scrollbar-point {
width: 100%;
+ max-height: 100%;
background-color: #999999;
position: absolute;
top: 0;
@@ -290,6 +291,16 @@
background-color: #c7c7c7;
}
+ textarea{
+ resize:none;
+ background-color: rgba(0,0,0,0);
+ border:none;
+ outline: none;
+ overflow:scroll;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+ }
</style>
<script>
function compare(a, b) {
@@ -373,11 +384,12 @@
}
}
}
+ let minx = 150;
+ let miny = 150;
function window_create(uid, name, content, options = {}) {
let lines = content.split("</br>").length
let a = ''
- let minx = 150;
- let miny = 150;
+
let size = (options.size != undefined) ? ("width:" + options.size.width + "px;height:" + options.size.height + "px;") : ("width:" + Math.max(document.body.clientWidth * .56, minx) + "px;height:" + Math.max(miny, document.body.clientHeight * .30) + "px;");
a += "<div id='" + uid + "-root' class='window' style=\"" + size + "top:0px;left:0px;position:absolute;\" window-name='" + name + "'>"
@@ -405,12 +417,19 @@
a += "<div id='" + uid + "-resize-es' class='resize-es'></div>"
document.getElementById("root").innerHTML += a
//console.log(document.getElementById(uid + "-content-root").clientHeight / (document.getElementById(uid + "-content-content").clientHeight / document.getElementById(uid + "-content-root").clientHeight))
- document.getElementById(uid + "-content-scrollbar-point").style.height = (document.getElementById(uid + "-content-root").clientHeight / (document.getElementById(uid + "-content-content").clientHeight / document.getElementById(uid + "-content-root").clientHeight)) + "px"
- if (document.getElementById(uid + "-content-scrollbar-point").clientHeight > document.getElementById(uid + "-content-root").clientHeight)
- document.getElementById(uid + "-content-scrollbar").style.display = 'none'
+
//console.log(document.getElementById(uid + "-content-scrollbar-point"))
+ refresh_windows()
+ }
+ function refresh_windows(){
let elems = document.getElementsByClassName("window")
for (let i = 0; i != elems.length; i++) {
+ let uid = elems.item(i).id.split("-")[0]
+ document.getElementById(uid + "-content-scrollbar-point").style.height = (document.getElementById(uid + "-content-root").clientHeight / (document.getElementById(uid + "-content-content").clientHeight / document.getElementById(uid + "-content-root").clientHeight)) + "px"
+ if (document.getElementById(uid + "-content-scrollbar-point").clientHeight > document.getElementById(uid + "-content-root").clientHeight)
+ document.getElementById(uid + "-content-scrollbar").style.display = 'none'
+ else
+ document.getElementById(uid + "-content-scrollbar").style.display = 'block'
//let elem = elems.item(i).children[0]
let elec = elems.item(i).children
let elem
@@ -653,10 +672,15 @@
}
+
-
}
- let fs = [{ name: "apps", perms: { r: true }, dir: true, content: [{ name: "notepad", icon: "./src/img/notepad.png", perms: { r: true }, dir: false, content: "window Notepad <input>uwu" }, { name: "cmd", icon: "./src/img/cmd.png", perms: { r: true }, dir: false, content: "window" }] }]
+ function auto_resize(i){
+
+ i.style.height = i.value.split("\n").length * 30
+ refresh_windows()
+ }
+ let fs = [{ name: "apps", perms: { r: true }, dir: true, content: [{ name: "notepad", icon: "./src/img/notepad.png", perms: { r: true }, dir: false, content: "window Notepad <textarea onkeypress=\\'auto_resize(this)\\' style=\\'width:100%;overflow:visible;display:block;\\'>uwu</textarea>" }, { name: "cmd", icon: "./src/img/cmd.png", perms: { r: true }, dir: false, content: "window" }] }]
function shortcut(i) {
let parsed = i.split("\n")
for (let line of parsed) {