Compare commits

...

2 Commits

Author SHA1 Message Date
4382b57e9e new attempt to create focus algorithm 2023-05-04 13:46:48 +03:00
2f3cb85d22 Fix focus logic in css 2023-05-04 13:46:28 +03:00
3 changed files with 11 additions and 9 deletions

View File

@ -4,8 +4,8 @@ document.addEventListener('DOMContentLoaded', function() {
// console.log(window.screen.width)
wde = new WebDesktopEnvironment
if (!WebDesktopEnvironment.isMobile){
WebDesktopEnvironment.Open("finder", ["/home/user"])
// WebDesktopEnvironment.Open("blog-viewer", ["/home/user/blog/test-1.blog"])
// WebDesktopEnvironment.Open("finder", ["/home/user"])
WebDesktopEnvironment.Open("blog-viewer", ["/home/user/blog/test-1.blog"])
// WebDesktopEnvironment.Open("personal-properties", ["kek"])
} else {
WebDesktopEnvironment.Open("blog-viewer", ["/home/user/blog/test-1.blog"])
@ -150,7 +150,7 @@ class WebDesktopEnvironment{
newWindow.style.height = height.toString() + "px"
document.body.querySelector('#windows-layer').appendChild(newWindow)
WindowsCompositor.bringWindowToFront(newWindow)
// WindowsCompositor.bringWindowToFront(newWindow)
return newWindow
}
}
@ -274,11 +274,13 @@ class WindowsCompositor{
* @param {HTMLElement} window
*/
static bringWindowToFront(window){ //FIXME
let previousWindow = WindowsCompositor.windowsLayer.lastChild
if (window != previousWindow){
WindowsCompositor.windowsLayer.insertBefore(previousWindow, window)
}
if (!window.classList.contains("Focused")){
let previousWindow = WindowsCompositor.windowsLayer.lastChild
previousWindow.classList.remove("Focused")
window.classList.add("Focused")
WindowsCompositor.windowsLayer.insertBefore(WindowsCompositor.windowsLayer.lastChild, window)
}
}

View File

@ -31,11 +31,11 @@
box-shadow: 2px 2px 0px #555555;
}
.Focused .WindowFrameShadow {
.WindowFrameShadow.Focused {
box-shadow: 2px 2px 0px #000000;
}
.Focused .ConvexElement {
.ConvexElement.Focused {
box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.25),
inset -1px -1px 0px rgba(0, 0, 0, 0.27),
inset 1px 1px 0px #FFFFFF;
@ -45,7 +45,7 @@
border: 1px solid #555555;
}
.Focused .AdjectiveElement {
.Focused .AdjectiveElement {
border: 1px solid #000000;
box-shadow: -1px -1px 0px rgba(0, 0, 0, 0.25),
1px 1px 0px #FFFFFF;

View File

@ -7,7 +7,7 @@
</div>
<div id="Drag" class="VisualDragArea"></div>
</div>
<div class="ContentBorder">
<div class="ContentBorder AdjectiveElement">
<div class="blog-viewer ScrollContent">
{{ range $block := .blocks }}
<div class="{{$block.Type}}" >