From 66234cdeaee58a9c3e825d975e006aa34a4d4455 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 6 Jun 2021 23:39:00 +0100 Subject: [PATCH 01/27] Minor styling to footer; change heart to emoji --- .docs/_includes/theme.njk | 2 +- .docs/css/theme.css | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.docs/_includes/theme.njk b/.docs/_includes/theme.njk index 4faa0ba..e01e0e6 100644 --- a/.docs/_includes/theme.njk +++ b/.docs/_includes/theme.njk @@ -27,7 +27,7 @@ {{ content | safe }} diff --git a/.docs/css/theme.css b/.docs/css/theme.css index 9dd65f3..b967802 100644 --- a/.docs/css/theme.css +++ b/.docs/css/theme.css @@ -142,6 +142,14 @@ input[type=text], input[type=number], textarea border-radius: 5px; } +footer { + margin: 3em 0 0 0; + padding: 1em; + text-align: center; + background: var(--bg-bright); + color: var(--text-bright); +} + /* Utility / layout aids */ .float.left { float: left; } From 85e5eb3971c965786ccf85c22bd5533321ce351c Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 7 Jun 2021 01:28:11 +0100 Subject: [PATCH 02/27] docs website: Add bigbutton --- .docs/css/theme.css | 39 +++++++++++++++++++++++++++++++++++++-- .docs/index.html | 3 ++- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/.docs/css/theme.css b/.docs/css/theme.css index b967802..b1d9a27 100644 --- a/.docs/css/theme.css +++ b/.docs/css/theme.css @@ -23,6 +23,8 @@ --text-bright: #efefef; --text-alt: #38871e; + --shadow: hsla(0, 0%, 25%, 0.25); + --highlight: hsl(353, 100%, 36%); } @@ -121,7 +123,7 @@ a { font-weight: bold; } /* a:not(.nav) { color: hsl(208, 67%, 40%); } a:not(.nav):hover { color: hsl(214, 67%, 50%); } a:not(.nav):active, a:focus { color: hsl(214, 87%, 60%); } */ -a:not(.nav):visited { color: hsl(240, 77%, 60%); } +a:not(.nav):not(.bigbutton):visited { color: hsl(240, 77%, 60%); } pre { page-break-inside: avoid; break-inside: avoid; } pre, code { @@ -208,7 +210,6 @@ footer { font-size: 3em; color: var(--text-alt); } -.bigbox :last-child { margin-bottom: 7em; } .features-large { margin: 3em 0; @@ -230,3 +231,37 @@ footer { .cssbox-gallery { display: flex; } + +.bigbutton { + display: inline-block; + + margin: 0; + padding: 0.35em 0.45em; + border: 0; + border-radius: 0.25em; + + background: var(--bg-alt); + + color: var(--text-bright); + font-size: 1.25em; + text-decoration: none; + text-align: center; + + box-shadow: 0 0 0.5em var(--shadow); + + cursor: pointer; + transition: box-shadow 0.25s, transform 0.25s; +} +.bigbutton:hover { + box-shadow: 0 0.25em 0.65em var(--shadow); + transform: translateY(-0.25em); +} +.bigbutton:active { + box-shadow: 0 0 0.25em var(--shadow); + transform: translateY(0.1em); +} +.bigbutton.disabled { + filter: saturate(25%); + opacity: 0.75; + cursor: default; +} diff --git a/.docs/index.html b/.docs/index.html index 139a817..c25daa3 100644 --- a/.docs/index.html +++ b/.docs/index.html @@ -9,6 +9,7 @@ date: 2000-01-01

WorldEditAdditions

Extra tools and commands to extend WorldEdit for Minetest

If you can dream of it, it probably belongs here!

+

Get Started

@@ -49,7 +50,7 @@ date: 2000-01-01
- From 79d7712740eccd95821856f7c4faa151f8bacd37 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 12 Jun 2021 14:39:06 +0100 Subject: [PATCH 06/27] Add comment to top of gallerybox --- .docs/css/gallerybox.css | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.docs/css/gallerybox.css b/.docs/css/gallerybox.css index 0ab7094..b89bab5 100644 --- a/.docs/css/gallerybox.css +++ b/.docs/css/gallerybox.css @@ -1,3 +1,20 @@ +/* + ██████ █████ ██ ██ ███████ ██████ ██ ██ ██████ ██████ ██ ██ +██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ +██ ███ ███████ ██ ██ █████ ██████ ████ ██████ ██ ██ ███ +██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ + ██████ ██ ██ ███████ ███████ ███████ ██ ██ ██ ██████ ██████ ██ ██ + +A pure css gallery, made with a bunch of wonderful hacks! Will be upgraded to +be (slightly) less hacky once :target-within lands in browsers. + +Exported to codepen: https://codepen.io/sbrl/details/YzZJYxg + + + + */ + + .gallerybox { display: flex; justify-content: center; From dcc66f2bd01dfb53b4e5112e15d45962413b2662 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 13 Jun 2021 22:37:07 +0100 Subject: [PATCH 07/27] docs: Add badges to top of page --- .docs/css/gallerybox.css | 3 --- .docs/css/theme.css | 2 +- .docs/index.html | 20 ++++++++++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.docs/css/gallerybox.css b/.docs/css/gallerybox.css index b89bab5..f0a2f8a 100644 --- a/.docs/css/gallerybox.css +++ b/.docs/css/gallerybox.css @@ -9,9 +9,6 @@ A pure css gallery, made with a bunch of wonderful hacks! Will be upgraded to be (slightly) less hacky once :target-within lands in browsers. Exported to codepen: https://codepen.io/sbrl/details/YzZJYxg - - - */ diff --git a/.docs/css/theme.css b/.docs/css/theme.css index 5fa672c..72df67d 100644 --- a/.docs/css/theme.css +++ b/.docs/css/theme.css @@ -206,7 +206,7 @@ footer { box-sizing: border-box; } .bigbox h1 { - margin-top: 0; + margin: 0; font-size: 3em; color: var(--text-alt); } diff --git a/.docs/index.html b/.docs/index.html index 0cecb5e..1acf5fa 100644 --- a/.docs/index.html +++ b/.docs/index.html @@ -7,6 +7,11 @@ date: 2000-01-01

WorldEditAdditions

+

+ WorldEditAdditions on ContentDB + Latest release on GitHub + View the changelog +

Extra tools and commands to extend WorldEdit for Minetest

If you can dream of it, it probably belongs here!

Get Started

@@ -63,3 +68,18 @@ date: 2000-01-01 {% endgallerybox %}
+ +
+

Download

+
+
+

ContentDB

+
+
+

Git

+
+
+ +
+
+
From 4fff388656b4e7e6f646471d9a196e3b95c92b63 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 13 Jun 2021 23:34:38 +0100 Subject: [PATCH 08/27] docs: Add next (final?) section of website Next up: fine tuning --- .docs/css/theme.css | 50 ++++++++++++++++++++++++++++++++++++--------- .docs/index.html | 20 ++++++++++++------ 2 files changed, 54 insertions(+), 16 deletions(-) diff --git a/.docs/css/theme.css b/.docs/css/theme.css index 72df67d..7c4ac2f 100644 --- a/.docs/css/theme.css +++ b/.docs/css/theme.css @@ -14,16 +14,20 @@ :root { --bg-main: #8ABEF6; - --bg-bright: #38871e; + /* --bg-bright: #57b43f; */ + --bg-bright: #7ac767; --bg-alt: #3F57B4; --bg-transcluscent-slight: rgba(255, 255, 255, 0.1); - --bg-transcluscent: rgba(255, 255, 255, 0.8); + --bg-transcluscent: rgba(255, 255, 255, 0.85); + --bg-transcluscent-alt: hsla(226, 59%, 38%, 0.8); - --text-main: #3F57B4; + /* --text-main: #3F57B4; */ + --text-main: hsl(227, 70%, 35%); --text-bright: #efefef; --text-alt: #38871e; --shadow: hsla(0, 0%, 25%, 0.25); + --shadow-dark: hsla(0, 0%, 25%, 0.5); --highlight: hsl(353, 100%, 36%); } @@ -66,6 +70,9 @@ title { string-set: page-title content(text); } opacity: 0.6; } } +h1, h2, h3, h4, h5, h6 { + text-align: center; +} nav { background: var(--bg-bright); @@ -96,7 +103,7 @@ nav a { padding: 1.2em 3em; text-decoration: none; font-weight: bold; - color: var(--text-bright); + color: var(--text-main); } @@ -125,8 +132,19 @@ a:not(.nav):hover { color: hsl(214, 67%, 50%); } a:not(.nav):active, a:focus { color: hsl(214, 87%, 60%); } */ a:not(.nav):not(.bigbutton):visited { color: hsl(240, 77%, 60%); } -pre { page-break-inside: avoid; break-inside: avoid; } +pre { + page-break-inside: avoid; + break-inside: avoid; + padding: 0.5em 0.6em; + border: 0.2em solid var(--bg-transcluscent-alt); + background: var(--bg-transcluscent-alt); + box-shadow: inset 0 0 0.5em 0.1em var(--shadow-dark); + line-height: 1.75em; + color: var(--text-bright); +} pre, code { + text-align: left; + font-size: 1rem; white-space: pre-wrap; -moz-tab-size: 4; tab-size: 4; @@ -149,7 +167,7 @@ footer { padding: 1em; text-align: center; background: var(--bg-bright); - color: var(--text-bright); + /* color: var(--text-bright); */ } @@ -218,15 +236,27 @@ footer { flex-wrap: wrap; justify-content: space-evenly; } -.features-large figure { +.features-large > :where(figure, .features-item) { background: var(--bg-transcluscent); margin: 0.1em; padding: 1em; max-width: 15em; } -/* .features-large figure img { - max-width: 12em; -} */ +.features-item.wide { + flex: 1; + max-width: initial; + margin: 0.1em 2em; + display: flex; + flex-direction: column; + justify-content: flex-start; +} +.features-item.wide > :last-child { + flex: 1; + display: flex; + justify-content: flex-end; + flex-direction: column; + align-items: center; +} .cssbox-gallery { display: flex; diff --git a/.docs/index.html b/.docs/index.html index 1acf5fa..1ef7133 100644 --- a/.docs/index.html +++ b/.docs/index.html @@ -72,14 +72,22 @@ date: 2000-01-01

Download

-
+

ContentDB

-
-
-

Git

-
-
+

Download from ContentDB, or from the Content tab in Minetest.

+ +

WorldEditAdditions on ContentDB

+
+
+

Git

+ +

Clone using Git:

+ +
cd path/to/worldmods;
+git clone https://github.com/sbrl/Minetest-WorldEditAdditions.git;
+ +

Source code on GitHub

From 70b6adaa0d004b528c51c2b666797b9e90680403 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 14 Jun 2021 01:36:13 +0100 Subject: [PATCH 09/27] Improve handling of PNGs, add background image --- .docs/.eleventy.js | 33 ++++++++++++++++++++++----------- .docs/_includes/theme.njk | 2 +- .docs/css/theme.css | 37 +++++++------------------------------ .docs/images/clouds.png | Bin 0 -> 25355 bytes .docs/index.html | 8 ++++---- 5 files changed, 34 insertions(+), 46 deletions(-) create mode 100644 .docs/images/clouds.png diff --git a/.docs/.eleventy.js b/.docs/.eleventy.js index 870513b..f15ce2c 100644 --- a/.docs/.eleventy.js +++ b/.docs/.eleventy.js @@ -1,3 +1,4 @@ +const fs = require("fs"); const path = require("path"); const htmlentities = require("html-entities"); @@ -5,16 +6,18 @@ const Image = require("@11ty/eleventy-img"); var nextid = 0; +const image_filename_format = (_id, src, width, format, _options) => { + const extension = path.extname(src); + const name = path.basename(src, extension); + return `${name}-${width}w.${format}`; +}; + async function shortcode_image(src, alt, classes = "") { let metadata = await Image(src, { widths: [300, null], formats: ["avif", "jpeg"], outputDir: `./_site/img/`, - filenameFormat: (_id, src, width, format, _options) => { - const extension = path.extname(src); - const name = path.basename(src, extension); - return `${name}-${width}w.${format}`; - } + filenameFormat: image_filename_format }); console.log(metadata); @@ -35,11 +38,7 @@ async function shortcode_image_url(src) { widths: [ null ], formats: [ "jpeg" ], outputDir: `./_site/img/`, - filenameFormat: (_id, src, width, format, _options) => { - const extension = path.extname(src); - const name = path.basename(src, extension); - return `${name}-${width}w.${format}`; - } + filenameFormat: image_filename_format }); console.log(metadata); @@ -47,6 +46,17 @@ async function shortcode_image_url(src) { return data.url; } +async function shortcode_image_urlpng(src) { + let target_dir = `./_site/img`; + if(!fs.existsSync(target_dir)) + await fs.promises.mkdir(target_dir, { recursive: true }); + let filename = path.basename(src); + // Generally speaking we optimise PNGs *very* well with oxipng/Zopfli, + // and the Image plugin doesn't respect this + await fs.promises.copyFile(src, path.join(target_dir, filename)); + return `/img/${filename}`; +} + async function shortcode_gallerybox(content, src, idthis, idprev, idnext) { return `
@@ -64,6 +74,7 @@ module.exports = function(eleventyConfig) { // eleventyConfig.addPassthroughCopy("css"); eleventyConfig.addShortcode("image", shortcode_image); eleventyConfig.addJavaScriptFunction("image", shortcode_image); - eleventyConfig.addShortcode("image-url", shortcode_image_url); + eleventyConfig.addShortcode("image_url", shortcode_image_url); + eleventyConfig.addNunjucksAsyncShortcode("image_urlpng", shortcode_image_urlpng); eleventyConfig.addPairedShortcode("gallerybox", shortcode_gallerybox); } diff --git a/.docs/_includes/theme.njk b/.docs/_includes/theme.njk index e01e0e6..2336b61 100644 --- a/.docs/_includes/theme.njk +++ b/.docs/_includes/theme.njk @@ -26,7 +26,7 @@ {{ content | safe }} -