Skip to content

Commit

Permalink
ADD: window size (playground)
Browse files Browse the repository at this point in the history
  • Loading branch information
du-cc committed Dec 4, 2024
1 parent 0470cdb commit 0870f61
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
37 changes: 20 additions & 17 deletions js/app/windowsPlayground.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,35 +158,36 @@ const xy_P = document.createElement("div");
xy_P.style.display = "flex";
xy_P.style.gap = "0.5em";
xy_P.style.marginBottom = "10px";
xy_P.style.width = "100%";

const xyL = document.createElement("label");
xyL.innerHTML = "Position";
xyL.style.marginBottom = "5px";

const xI = document.createElement("input");
xI.placeholder = "X pos";
xI.style.padding = "15px";
xI.style.border = "none";
xI.style.borderBottom = "1px solid #000";
xI.style.color = "#000";
xI.style.borderRadius = "10px";
xI.style.fontFamily = "inherit";
const xI = createInput("X pos");
xI.style.width = "75px";

const yI = document.createElement("input");
yI.placeholder = "Y pos";
yI.style.padding = "15px";
yI.style.border = "none";
yI.style.borderBottom = "1px solid #000";
yI.style.color = "#000";
yI.style.borderRadius = "10px";
yI.style.fontFamily = "inherit";
const yI = createInput("Y pos");
yI.style.width = "75px";

xy_P.appendChild(xI);
xy_P.appendChild(yI);

const sxy_P = document.createElement("div");
sxy_P.style.display = "flex";
sxy_P.style.gap = "0.5em";
sxy_P.style.marginBottom = "10px";

const sxI = createInput("Width");
sxI.style.width = "75px";
const syI = createInput("Height");
syI.style.width = "75px";

const sxyL = document.createElement("label");
sxyL.innerHTML = "Size";

sxy_P.appendChild(sxI);
sxy_P.appendChild(syI);

const dragC = createCheckbox("draggable", "Draggable", true);
const pinC = createCheckbox("pinToTop", "Pin to top", true);

Expand Down Expand Up @@ -216,6 +217,8 @@ div1.appendChild(contentTypeI_P);
div2.appendChild(miscL);
div2.appendChild(xyL);
div2.appendChild(xy_P);
div2.appendChild(sxyL);
div2.appendChild(sxy_P);
div2.appendChild(dragC[0]);
div2.appendChild(pinC[0]);
div2.appendChild(actionL);
Expand Down
11 changes: 10 additions & 1 deletion js/os/window/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,16 @@ export function createWindow(type, icon, title, content, args) {
// - Add animations

export function closeWindow(window) {
window.remove();
gsap.to(window, {
scale: 0.95,
opacity: 0,
y: "+=10",
duration: 0.1,
onComplete: () => {
window.remove();
},
});
// window.remove();
}

// TODO:
Expand Down

0 comments on commit 0870f61

Please sign in to comment.