diff --git a/MMM-NextcloudCookbook.css b/MMM-NextcloudCookbook.css index 91256fa..1e4a362 100644 --- a/MMM-NextcloudCookbook.css +++ b/MMM-NextcloudCookbook.css @@ -4,7 +4,7 @@ } .MMM-NextcloudCookbook .ncc-active { - --ncc-type-scale: 1; + --ncc-content-scale: 1; position: fixed; inset: 0; @@ -54,9 +54,9 @@ } .MMM-NextcloudCookbook .ncc-recipe h1 { - margin: 0 0 calc(26px * var(--ncc-type-scale)); + margin: 0 0 26px; color: #fff6d8; - font-size: calc(82px * var(--ncc-type-scale)); + font-size: 82px; line-height: 1.08; } @@ -65,8 +65,8 @@ flex-wrap: wrap; gap: 10px 22px; align-items: baseline; - margin: 0 0 calc(36px * var(--ncc-type-scale)); - font-size: calc(36px * var(--ncc-type-scale)); + margin: 0 0 36px; + font-size: 36px; } .MMM-NextcloudCookbook .ncc-meta dt { @@ -83,7 +83,7 @@ } .MMM-NextcloudCookbook .ncc-layout-stacked section:first-child { - margin-bottom: calc(42px * var(--ncc-type-scale)); + margin-bottom: calc(42px * var(--ncc-content-scale)); } .MMM-NextcloudCookbook .ncc-layout-side-by-side { @@ -93,21 +93,21 @@ } .MMM-NextcloudCookbook .ncc-columns h2 { - margin: 0 0 calc(18px * var(--ncc-type-scale)); + margin: 0 0 calc(18px * var(--ncc-content-scale)); color: #d6b96b; - font-size: calc(56px * var(--ncc-type-scale)); + font-size: calc(56px * var(--ncc-content-scale)); } .MMM-NextcloudCookbook .ncc-columns ul, .MMM-NextcloudCookbook .ncc-columns ol { margin: 0; padding-left: 1.25em; - font-size: calc(50px * var(--ncc-type-scale)); + font-size: calc(50px * var(--ncc-content-scale)); line-height: 1.36; } .MMM-NextcloudCookbook .ncc-columns li { - margin-bottom: calc(18px * var(--ncc-type-scale)); + margin-bottom: calc(18px * var(--ncc-content-scale)); } .MMM-NextcloudCookbook .ncc-error { diff --git a/MMM-NextcloudCookbook.js b/MMM-NextcloudCookbook.js index 6b78200..02be2d1 100644 --- a/MMM-NextcloudCookbook.js +++ b/MMM-NextcloudCookbook.js @@ -58,7 +58,7 @@ Module.register("MMM-NextcloudCookbook", { for (let attempt = 0; attempt < 12; attempt++) { const scale = (minimum + maximum) / 2; - root.style.setProperty("--ncc-type-scale", scale); + root.style.setProperty("--ncc-content-scale", scale); const fits = recipe.scrollHeight <= availableHeight && recipe.scrollWidth <= availableWidth; if (fits) { @@ -68,7 +68,7 @@ Module.register("MMM-NextcloudCookbook", { maximum = scale; } } - root.style.setProperty("--ncc-type-scale", best.toFixed(3)); + root.style.setProperty("--ncc-content-scale", best.toFixed(3)); }, setRecipeMode(active) { diff --git a/README.md b/README.md index d016a5d..668f89d 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,10 @@ link; it should look like `https://cloud.example.test/s/SHARE_TOKEN`. `layout` controls the full-screen recipe arrangement. Its default value, `"stacked"`, displays the ingredients above the instructions. Set it to `"side-by-side"` to display ingredients and instructions in two columns. Both -layouts automatically enlarge the recipe to make the best use of the available -screen while keeping all of its content visible. +layouts automatically scale the ingredient and instruction sections to make +the best use of the available screen while keeping all recipe content visible. +The recipe title, timing metadata, yield, and QR controller remain at fixed +sizes. The configured `position` controls where the QR controller appears during the normal MagicMirror layout. When a recipe is activated, the module displays a diff --git a/package-lock.json b/package-lock.json index 1409d91..be01ec1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mmm-nextcloud-cookbook", - "version": "0.2.0", + "version": "0.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mmm-nextcloud-cookbook", - "version": "0.2.0", + "version": "0.2.1", "dependencies": { "fast-xml-parser": "5.10.1", "qrcode": "1.5.4" diff --git a/package.json b/package.json index af29649..c3c7d71 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mmm-nextcloud-cookbook", - "version": "0.2.0", + "version": "0.2.1", "private": true, "description": "Display recipes from a Nextcloud Cookbook share on MagicMirror", "main": "node_helper.js",