Created main js and css files. Added some of the iniitialization for the ui

This commit is contained in:
2025-07-07 16:09:29 -06:00
parent 0eb377dce5
commit 283b09123b
2 changed files with 63 additions and 0 deletions

39
main.css Normal file
View File

@@ -0,0 +1,39 @@
body {
margin:0;
}
#root {
height: 100vh;
width: 100vw;
margin: 0;
display: flex;
flex-direction: column;
justify-items: stretch;
align-items: stretch;
}
#navigation {
height: 50px;
box-shadow: inset 0 -2px 3px 0 #888;
}
#view {
flex: 1;
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr 1fr;
grid-gap: 5%;
padding: 5%;
}
.pecSlot {
border: solid 3px #666;
border-radius: 6px;
user-select: none;
}
.empty {
color: #666;
font-size: 300%;
text-align: center;
}

24
main.js Normal file
View File

@@ -0,0 +1,24 @@
// Initialize gui
window.app = {};
app.gui = {};
app.gui.main = document.createElement("div");
app.gui.main.id = "root";
document.body.appendChild(app.gui.main);
app.gui.menu = document.createElement("nav");
app.gui.menu.id = "navigation";
app.gui.main.appendChild(app.gui.menu);
app.gui.view = document.createElement("div");
app.gui.view.id = "view";
app.gui.main.appendChild(app.gui.view);
// Library popup
app.gui.library = document.createElement("dev");
// pre-populate grid with emptys
for (var x = 0; x < 16; x++) {
var name = "pec"+x;
var thisPec = app.gui[name] = document.createElement("span");
thisPec.classList.add("pecSlot","empty");
thisPec.innerHTML = "<p>+</p>";
app.gui.view.appendChild(thisPec);
}