diff --git a/html/app.js b/html/app.js index e17a42ac8..f2dc13905 100644 --- a/html/app.js +++ b/html/app.js @@ -210,7 +210,13 @@ const InventoryContainer = Vue.createApp({ getHotbarItemInSlot(slot) { return this.hotbarItems[slot - 1] || null; }, + containerMouseDownAction(event){ + if (event.button === 0 && this.showContextMenu) { + this.showContextMenu = false + } + }, handleMouseDown(event, slot, inventory) { + if (event.button === 1) return; // skip middle mouse event.preventDefault(); const itemInSlot = this.getItemInSlot(slot, inventory); if (event.button === 0) { @@ -298,6 +304,7 @@ const InventoryContainer = Vue.createApp({ this.dragStartX = event.clientX; this.dragStartY = event.clientY; this.dragStartInventoryType = inventoryType; + this.showContextMenu = false }, createGhostElement(slotElement) { const ghostElement = slotElement.cloneNode(true); diff --git a/html/index.html b/html/index.html index 8c4d1c190..7fa01abb1 100644 --- a/html/index.html +++ b/html/index.html @@ -16,7 +16,7 @@
-
+
diff --git a/html/main.css b/html/main.css index 6c10a79ac..a3ccc2c75 100644 --- a/html/main.css +++ b/html/main.css @@ -1,5 +1,9 @@ @import url("https://fonts.googleapis.com/css2?family=Open+Sans&display=swap"); +body { + margin: 0; +} + div { font-family: "Open Sans", sans-serif; } @@ -9,8 +13,8 @@ div { } #app { - height: 99vh; - width: 99vw; + height: 100vh; + width: 100vw; background: transparent; } @@ -195,7 +199,7 @@ div { white-space: nowrap; bottom: 0; height: 1vh; - width: 99%; + width: 100%; background-color: #cccccc; display: flex; justify-content: center;