redo layout to move bottom aside to left
This commit is contained in:
parent
36dafc7204
commit
c17c7415c9
13
index.html
13
index.html
|
|
@ -27,6 +27,7 @@
|
||||||
<button data-alt="i" data-button="planner:zoom:+">Zoom in</button>
|
<button data-alt="i" data-button="planner:zoom:+">Zoom in</button>
|
||||||
<button data-alt="o" data-button="planner:zoom:-">Zoom out</button>
|
<button data-alt="o" data-button="planner:zoom:-">Zoom out</button>
|
||||||
<button data-alt="c" data-toggle="planner:toggle-casing" data-toggled="false">Show casing</button>
|
<button data-alt="c" data-toggle="planner:toggle-casing" data-toggled="false">Show casing</button>
|
||||||
|
<button data-alt="c" data-button="dialogs:welcome">Show welcome</button>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<aside id="left-menu" data-state="planning">
|
<aside id="left-menu" data-state="planning">
|
||||||
|
|
@ -43,6 +44,9 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</aside>
|
</aside>
|
||||||
|
<aside id="bottom-menu" data-resize-max="0.8">
|
||||||
|
<span data-resize="bottom-menu"></span>
|
||||||
|
</aside>
|
||||||
<main>
|
<main>
|
||||||
<div data-state="initialization">
|
<div data-state="initialization">
|
||||||
Select configuration file:
|
Select configuration file:
|
||||||
|
|
@ -79,11 +83,8 @@
|
||||||
<aside id="right-menu">
|
<aside id="right-menu">
|
||||||
<span data-resize="right-menu"></span>
|
<span data-resize="right-menu"></span>
|
||||||
</aside>
|
</aside>
|
||||||
<aside id="bottom-menu">
|
|
||||||
<span data-resize="bottom-menu"></span>
|
|
||||||
</aside>
|
|
||||||
<footer>
|
<footer>
|
||||||
<div>pre-alpha 1.0</div>
|
<div>pre-alpha 1.1</div>
|
||||||
<div>
|
<div>
|
||||||
<a href="https://discord.gg/Eq72HwPqfg">Discord server</a>
|
<a href="https://discord.gg/Eq72HwPqfg">Discord server</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -103,8 +104,10 @@
|
||||||
Roadmap:
|
Roadmap:
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Block and reactor recipe selection</li>
|
<li>Block and reactor recipe selection - WIP</li>
|
||||||
|
<li>Reactor tooltips</li>
|
||||||
<li>Reactor verification and stats</li>
|
<li>Reactor verification and stats</li>
|
||||||
|
<li>Casing improvements</li>
|
||||||
<li>Keyboard shortcuts</li>
|
<li>Keyboard shortcuts</li>
|
||||||
<li>MSR support</li>
|
<li>MSR support</li>
|
||||||
<li>Turbine support</li>
|
<li>Turbine support</li>
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { recall, save } from "./storage.js";
|
||||||
|
|
||||||
registerLoadCallback(() => {
|
registerLoadCallback(() => {
|
||||||
welcomeDialog();
|
welcomeDialog();
|
||||||
|
listenTo("dialogs:welcome", () => welcomeDialog(true));
|
||||||
listenTo("fileLoad:chooseDesign", designChoiceDialog);
|
listenTo("fileLoad:chooseDesign", designChoiceDialog);
|
||||||
listenTo("fileSave:nameDesign", designNameDialog);
|
listenTo("fileSave:nameDesign", designNameDialog);
|
||||||
});
|
});
|
||||||
|
|
@ -42,8 +43,11 @@ function initializeDialog(dialogName, endEvent, { emptyValue, onDismiss } = {})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function welcomeDialog() {
|
function welcomeDialog(force = false) {
|
||||||
if (recall("hasSeenWelcome", false)) return;
|
if (recall("hasSeenWelcome", false) && !force) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initializeDialog("welcome", "welcome:close", {
|
initializeDialog("welcome", "welcome:close", {
|
||||||
onDismiss: () => {
|
onDismiss: () => {
|
||||||
save("hasSeenWelcome", true);
|
save("hasSeenWelcome", true);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import { registerLoadCallback } from "./main.js";
|
||||||
let activeMenuBar = null;
|
let activeMenuBar = null;
|
||||||
|
|
||||||
registerLoadCallback(() => {
|
registerLoadCallback(() => {
|
||||||
console.log("menubar-load");
|
|
||||||
document.querySelectorAll(".menu-bar").forEach(menuBar => {
|
document.querySelectorAll(".menu-bar").forEach(menuBar => {
|
||||||
menuBar.querySelectorAll("button").forEach(button => {
|
menuBar.querySelectorAll("button").forEach(button => {
|
||||||
button.setAttribute("tabindex", "-1");
|
button.setAttribute("tabindex", "-1");
|
||||||
|
|
@ -72,7 +71,6 @@ registerLoadCallback(() => {
|
||||||
|
|
||||||
|
|
||||||
function handleGlobalClick() {
|
function handleGlobalClick() {
|
||||||
console.log("Global clicked");
|
|
||||||
if (!activeMenuBar) return;
|
if (!activeMenuBar) return;
|
||||||
activeMenuBar.classList.remove("active");
|
activeMenuBar.classList.remove("active");
|
||||||
activeMenuBar.querySelectorAll(".active")
|
activeMenuBar.querySelectorAll(".active")
|
||||||
|
|
|
||||||
|
|
@ -104,12 +104,12 @@ function buildBlockPicker() {
|
||||||
item.classList.add("hidden");
|
item.classList.add("hidden");
|
||||||
}
|
}
|
||||||
item.appendChild(makeAtlasImage(m.index));
|
item.appendChild(makeAtlasImage(m.index));
|
||||||
item.addEventListener("click", listClickEvent);
|
item.addEventListener("click", blockPickerClickEvent);
|
||||||
grid.addItem(item);
|
grid.addItem(item);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function listClickEvent(e) {
|
function blockPickerClickEvent(e) {
|
||||||
const items = document.querySelectorAll("#block-picker-list [data-index]");
|
const items = document.querySelectorAll("#block-picker-list [data-index]");
|
||||||
if (e.currentTarget.dataset.active !== undefined) {
|
if (e.currentTarget.dataset.active !== undefined) {
|
||||||
items.forEach(i => delete i.dataset.active);
|
items.forEach(i => delete i.dataset.active);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,10 @@ function startResize(e) {
|
||||||
|
|
||||||
function resize(e) {
|
function resize(e) {
|
||||||
const resizing = document.body.dataset.resizing;
|
const resizing = document.body.dataset.resizing;
|
||||||
const elementBoundingBox = document.getElementById(resizing).getBoundingClientRect();
|
const element = document.getElementById(resizing);
|
||||||
|
const sizeMin = Number(element.dataset.resizeMin ?? 0.05);
|
||||||
|
const sizeMax = Number(element.dataset.resizeMax ?? 0.5);
|
||||||
|
const elementBoundingBox = element.getBoundingClientRect();
|
||||||
let size = 0.25;
|
let size = 0.25;
|
||||||
switch (resizing) {
|
switch (resizing) {
|
||||||
case "left-menu":
|
case "left-menu":
|
||||||
|
|
@ -33,7 +36,7 @@ function resize(e) {
|
||||||
size = 1 - (e.pageY + window.innerHeight - elementBoundingBox.bottom) / window.innerHeight;
|
size = 1 - (e.pageY + window.innerHeight - elementBoundingBox.bottom) / window.innerHeight;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
size = Math.max(0.05, Math.min(size, 0.5));
|
size = Math.max(sizeMin, Math.min(size, sizeMax));
|
||||||
document.body.style.setProperty(`--${resizing}-size`, `${size*100}%`);
|
document.body.style.setProperty(`--${resizing}-size`, `${size*100}%`);
|
||||||
save(`${resizing}-size`, `${size*100}%`);
|
save(`${resizing}-size`, `${size*100}%`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
26
style.css
26
style.css
|
|
@ -67,22 +67,28 @@ body {
|
||||||
#left-menu {
|
#left-menu {
|
||||||
grid-column: 1;
|
grid-column: 1;
|
||||||
grid-row: 2;
|
grid-row: 2;
|
||||||
border-right: 1px solid var(--menu-border-color)
|
border-right: 1px solid var(--menu-border-color);
|
||||||
|
}
|
||||||
|
#bottom-menu {
|
||||||
|
grid-column: 1;
|
||||||
|
grid-row: 3;
|
||||||
|
border-top: 1px solid var(--menu-border-color);
|
||||||
|
border-right: 1px solid var(--menu-border-color);
|
||||||
}
|
}
|
||||||
main {
|
main {
|
||||||
grid-column: 2;
|
grid-column: 2;
|
||||||
grid-row: 2;
|
grid-row: 2 / 4;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
#right-menu {
|
#right-menu {
|
||||||
grid-column: 3;
|
grid-column: 3;
|
||||||
grid-row: 2;
|
grid-row: 2 / 4;
|
||||||
border-left: 1px solid var(--menu-border-color)
|
border-left: 1px solid var(--menu-border-color);
|
||||||
}
|
}
|
||||||
#bottom-menu {
|
#bottom-menu {
|
||||||
grid-column: 1 / -1;
|
grid-column: 1;
|
||||||
grid-row: 3;
|
grid-row: 3;
|
||||||
border-top: 1px solid var(--menu-border-color)
|
border-top: 1px solid var(--menu-border-color);
|
||||||
}
|
}
|
||||||
body > footer {
|
body > footer {
|
||||||
grid-column: 1 / -1;
|
grid-column: 1 / -1;
|
||||||
|
|
@ -113,7 +119,7 @@ body > footer {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
content: "";
|
content: "";
|
||||||
}
|
}
|
||||||
#left-menu [data-resize], #right-menu [data-resize] {
|
#left-menu > [data-resize], #right-menu > [data-resize] {
|
||||||
border-left: 1px solid var(--resize-handle-color);
|
border-left: 1px solid var(--resize-handle-color);
|
||||||
border-right: 1px solid var(--resize-handle-color);
|
border-right: 1px solid var(--resize-handle-color);
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
|
@ -122,15 +128,15 @@ body > footer {
|
||||||
width: calc(var(--resize-handle-width) * 2 - 1px);
|
width: calc(var(--resize-handle-width) * 2 - 1px);
|
||||||
height: 1em;
|
height: 1em;
|
||||||
}
|
}
|
||||||
#left-menu [data-resize] {
|
#left-menu > [data-resize] {
|
||||||
cursor: w-resize;
|
cursor: w-resize;
|
||||||
right: calc(var(--resize-handle-width) * -1);
|
right: calc(var(--resize-handle-width) * -1);
|
||||||
}
|
}
|
||||||
#right-menu [data-resize] {
|
#right-menu > [data-resize] {
|
||||||
cursor: e-resize;
|
cursor: e-resize;
|
||||||
left: calc(var(--resize-handle-width) * -1);
|
left: calc(var(--resize-handle-width) * -1);
|
||||||
}
|
}
|
||||||
#bottom-menu [data-resize] {
|
#bottom-menu > [data-resize] {
|
||||||
border-top: 1px solid var(--resize-handle-color);
|
border-top: 1px solid var(--resize-handle-color);
|
||||||
border-bottom: 1px solid var(--resize-handle-color);
|
border-bottom: 1px solid var(--resize-handle-color);
|
||||||
cursor: s-resize;
|
cursor: s-resize;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue