diff --git a/README.md b/README.md index 9958e67..36fcd48 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ # altboxels A sandbox game inspired by https://sandboxels.r74n.com/, with a cleaner codebase and secure/simple modding support in mind. -Some of the elements are derived from other games in the falling sand genre, especially Sandboxels. However, the physics engine and other backend code are custom and independently developed. - -Recreated to remove private information from commit logs. \ No newline at end of file +Some of the elements are derived from other games in the falling sand genre, especially Sandboxels. However, the physics engine and other backend code are custom and independently developed. \ No newline at end of file diff --git a/css/core.css b/css/core.css index 6f0967f..0075d73 100644 --- a/css/core.css +++ b/css/core.css @@ -1,10 +1,13 @@ +@import url("./fonts.css"); + body { - font-family: monospace; + font-family: "Ubuntu Mono"; padding: 10px; margin: 0; background: rgb(21, 21, 22); color: white; text-align: center; + user-select: none; } #no-overflow { @@ -16,6 +19,7 @@ canvas { display: block; background: rgb(181, 204, 253); image-rendering: pixelated; + border-radius: 10px; } #main2 { @@ -27,7 +31,7 @@ canvas { } button, a, textarea { - padding: 5px; + padding: 5px 10px; border: none; margin: 6px 3px 0px 3px; @@ -36,9 +40,254 @@ button, a, textarea { background: rgb(44, 142, 255); color: white; - font-family: monospace; + font-family: inherit; + border-radius: 6px; + font-size: 17px; + cursor: pointer; } -section:target button, .menu2 button, a, textarea { +section.selected-group button, .menu2 button, a, textarea { display: inline-block; -} \ No newline at end of file +} +div#header-title { + font-size: 23px; +} + +#header-links a { + margin-top: 0; + background: none; +} + +#header { + padding: 0 8px; + margin-bottom: 32px; +} +#header { + display: flex; + justify-content: space-between; + align-content: center; + align-items: center; + font-size: 16px; +} + +.menu, .menu2, .buttons > .selected-group { + position: relative; + left: 50%; + transform: translateX(-50%); + width: var(--canvasWidth); + display: flex; + justify-content: space-evenly; +} + +.buttons { + background: #7b7b7b; + border-radius: 0 0 5px 5px; + overflow-y: auto; +} +.buttons > .selected-group { + display: flex; + flex-wrap: wrap; + justify-content: flex-start; + height: 100px; + padding: 10px; + overflow-y: auto; +} + +.menu a, +.menu2 a { + width: 100%; + text-decoration: none; +} +.buttons button { + width: calc(25% - 6px); +} + +.tab-bar > * { + background: #616161; + margin: 0; + margin-top: 8px; + border-radius: 10px 10px 0 0; + padding: 8px 10px; + width: 100%; + cursor: pointer; +} +.tab-bar > .selected-group { + background: #7b7b7b; +} + +#game { + position: relative; + left: 50vw; + transform: translateX(-50%); +} +.info { + height: 20px; + display: block; +} + + +/* Mod Loader */ + +#mod-loader-modal { + position: fixed; + left: 0; + top: 0; + background: #000a; + width: 100vw; + height: 100vh; + z-index: 100; + opacity: 1; + transition: opacity 0.25s ease-in-out; +} + +#mod-loader-modal-box { + position: fixed; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + width: min(800px, 75vw); + background: #7b7b7b; + border-radius: 10px; + font-size: 0; + transition: transform 0.25s ease-in-out; + overflow: hidden; +} +#mod-loader-modal:not(.opened) { + opacity: 0; + pointer-events: none; +} +#mod-loader-modal:not(.opened) #mod-loader-modal-box { + transform: translate(-50%, -50%) scaleY(0); +} + +#mod-loader-modal-header { + display: flex; + justify-content: space-between; + padding: 10px; + height: 28px; + align-items: center; + position: relative; + background: #3b3b3b; +} + +.tab-bar { + display: flex; + flex-direction: row; + justify-content: space-evenly; + width: 100%; +} + +#mod-loader-modal-title { + flex: none; +} +#mod-loader-modal-close-button { + background: gray; + padding: 6px; + border-radius: 7px; + cursor: pointer; +} + +.mod-loader-tab-content:not(.selected-group) { + display: none; +} + +#mod-form { + + position: absolute; + left: 50%; + top: 50%; + width: 100%; + transform: translate(-50%, -50%); + +} + +#mod-loader-modal-content { + height: min(500px, 75vh); + overflow-y: auto; +} + +#mod-loader-modal-box > * > * { + font-size: 16px; +} + +#mod-loader-modal-tabs { + /* margin: 0 29px; */ + position: absolute; + bottom: 0; + left: 50%; + transform: translateX(-50%); + width: 60%; +} + + +/* Mods */ + +.mods-list { + display: flex; + flex-wrap: wrap; + align-items: flex-start; + justify-content: flex-start; + align-content: flex-start; + flex-direction: row; +} + +.mod { + display: inline-flex; + --margin: 10px; + width: calc(50% - (var(--margin) * 2)); + height: 96px; + box-sizing: border-box; + border: 5px solid darkgray; + background: lightgray; + color: #555; + padding: 8px; + margin: 10px; + justify-content: space-between; +} + +.mod-icon { + aspect-ratio: 1 / 1; + flex: none; + height: 100%; + image-rendering: pixelated; +} + +.mod-details > * { + text-align: left; + margin: 0 5px; + overflow: hidden; + text-overflow: ellipsis; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + display: -webkit-box; +} + +.mod-loader-tab-content { + /* padding: 10px; */ + box-sizing: border-box; +} + +.mod-details { + display: flex; + flex-direction: column; + justify-content: space-between; + width: 68%; + overflow: hidden; +} + +.mod-name { + color: #111; + font-size: 20px; + /* white-space: nowrap; */ + max-width: 100%; + text-overflow: ellipsis; + overflow: hidden; + -webkit-line-clamp: 1; +} + +.mod-options { + flex: none; + display: flex; + flex-direction: column; +} + diff --git a/css/fonts.css b/css/fonts.css new file mode 100644 index 0000000..b3f884d --- /dev/null +++ b/css/fonts.css @@ -0,0 +1,40 @@ +@font-face { + font-family: 'Ubuntu Mono'; + src: local('Ubuntu Mono'), local('UbuntuMono-Regular'), + url('fonts/UbuntuMono-Regular.woff2') format('woff2'), + url('fonts/UbuntuMono-Regular.woff') format('woff'); + font-weight: normal; + font-style: normal; + font-display: swap; +} + +@font-face { + font-family: 'Ubuntu Mono'; + src: local('Ubuntu Mono Italic'), local('UbuntuMono-Italic'), + url('fonts/UbuntuMono-Italic.woff2') format('woff2'), + url('fonts/UbuntuMono-Italic.woff') format('woff'); + font-weight: normal; + font-style: italic; + font-display: swap; +} + +@font-face { + font-family: 'Ubuntu Mono'; + src: local('Ubuntu Mono Bold Italic'), local('UbuntuMono-BoldItalic'), + url('fonts/UbuntuMono-BoldItalic.woff2') format('woff2'), + url('fonts/UbuntuMono-BoldItalic.woff') format('woff'); + font-weight: bold; + font-style: italic; + font-display: swap; +} + +@font-face { + font-family: 'Ubuntu Mono'; + src: local('Ubuntu Mono Bold'), local('UbuntuMono-Bold'), + url('fonts/UbuntuMono-Bold.woff2') format('woff2'), + url('fonts/UbuntuMono-Bold.woff') format('woff'); + font-weight: bold; + font-style: normal; + font-display: swap; +} + diff --git a/css/fonts/UFL.txt b/css/fonts/UFL.txt new file mode 100644 index 0000000..6e722c8 --- /dev/null +++ b/css/fonts/UFL.txt @@ -0,0 +1,96 @@ +------------------------------- +UBUNTU FONT LICENCE Version 1.0 +------------------------------- + +PREAMBLE +This licence allows the licensed fonts to be used, studied, modified and +redistributed freely. The fonts, including any derivative works, can be +bundled, embedded, and redistributed provided the terms of this licence +are met. The fonts and derivatives, however, cannot be released under +any other licence. The requirement for fonts to remain under this +licence does not require any document created using the fonts or their +derivatives to be published under this licence, as long as the primary +purpose of the document is not to be a vehicle for the distribution of +the fonts. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this licence and clearly marked as such. This may +include source files, build scripts and documentation. + +"Original Version" refers to the collection of Font Software components +as received under this licence. + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to +a new environment. + +"Copyright Holder(s)" refers to all individuals and companies who have a +copyright ownership of the Font Software. + +"Substantially Changed" refers to Modified Versions which can be easily +identified as dissimilar to the Font Software by users of the Font +Software comparing the Original Version with the Modified Version. + +To "Propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification and with or without charging +a redistribution fee), making available to the public, and in some +countries other activities as well. + +PERMISSION & CONDITIONS +This licence does not grant any rights under trademark law and all such +rights are reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of the Font Software, to propagate the Font Software, subject to +the below conditions: + +1) Each copy of the Font Software must contain the above copyright +notice and this licence. These can be included either as stand-alone +text files, human-readable headers or in the appropriate machine- +readable metadata fields within text or binary files as long as those +fields can be easily viewed by the user. + +2) The font name complies with the following: +(a) The Original Version must retain its name, unmodified. +(b) Modified Versions which are Substantially Changed must be renamed to +avoid use of the name of the Original Version or similar names entirely. +(c) Modified Versions which are not Substantially Changed must be +renamed to both (i) retain the name of the Original Version and (ii) add +additional naming elements to distinguish the Modified Version from the +Original Version. The name of such Modified Versions must be the name of +the Original Version, with "derivative X" where X represents the name of +the new work, appended to that name. + +3) The name(s) of the Copyright Holder(s) and any contributor to the +Font Software shall not be used to promote, endorse or advertise any +Modified Version, except (i) as required by this licence, (ii) to +acknowledge the contribution(s) of the Copyright Holder(s) or (iii) with +their explicit written permission. + +4) The Font Software, modified or unmodified, in part or in whole, must +be distributed entirely under this licence, and must not be distributed +under any other licence. The requirement for fonts to remain under this +licence does not affect any document created using the Font Software, +except any version of the Font Software extracted from a document +created using the Font Software may only be distributed under this +licence. + +TERMINATION +This licence becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF +COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER +DEALINGS IN THE FONT SOFTWARE. diff --git a/css/fonts/UbuntuMono-Bold.woff b/css/fonts/UbuntuMono-Bold.woff new file mode 100644 index 0000000..f0c0bd2 Binary files /dev/null and b/css/fonts/UbuntuMono-Bold.woff differ diff --git a/css/fonts/UbuntuMono-Bold.woff2 b/css/fonts/UbuntuMono-Bold.woff2 new file mode 100644 index 0000000..e12b502 Binary files /dev/null and b/css/fonts/UbuntuMono-Bold.woff2 differ diff --git a/css/fonts/UbuntuMono-BoldItalic.woff b/css/fonts/UbuntuMono-BoldItalic.woff new file mode 100644 index 0000000..d717ad3 Binary files /dev/null and b/css/fonts/UbuntuMono-BoldItalic.woff differ diff --git a/css/fonts/UbuntuMono-BoldItalic.woff2 b/css/fonts/UbuntuMono-BoldItalic.woff2 new file mode 100644 index 0000000..8500880 Binary files /dev/null and b/css/fonts/UbuntuMono-BoldItalic.woff2 differ diff --git a/css/fonts/UbuntuMono-Italic.woff b/css/fonts/UbuntuMono-Italic.woff new file mode 100644 index 0000000..95ed8d7 Binary files /dev/null and b/css/fonts/UbuntuMono-Italic.woff differ diff --git a/css/fonts/UbuntuMono-Italic.woff2 b/css/fonts/UbuntuMono-Italic.woff2 new file mode 100644 index 0000000..e82cf92 Binary files /dev/null and b/css/fonts/UbuntuMono-Italic.woff2 differ diff --git a/css/fonts/UbuntuMono-Regular.woff b/css/fonts/UbuntuMono-Regular.woff new file mode 100644 index 0000000..2355677 Binary files /dev/null and b/css/fonts/UbuntuMono-Regular.woff differ diff --git a/css/fonts/UbuntuMono-Regular.woff2 b/css/fonts/UbuntuMono-Regular.woff2 new file mode 100644 index 0000000..6064b6e Binary files /dev/null and b/css/fonts/UbuntuMono-Regular.woff2 differ diff --git a/css/icons/open-link.svg b/css/icons/open-link.svg new file mode 100644 index 0000000..8d7c1c5 --- /dev/null +++ b/css/icons/open-link.svg @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/index.html b/index.html index 3d327c5..7824937 100644 --- a/index.html +++ b/index.html @@ -15,41 +15,85 @@
-