2 Commits
Author SHA1 Message Date
aaron.axvig bc81e8403d Add configurable stacked recipe layout 2026-08-03 22:19:54 -05:00
aaron.axvig f4bb9323da Keep recipe content clear of QR control 2026-08-03 22:14:22 -05:00
5 changed files with 31 additions and 6 deletions
+17 -1
View File
@@ -12,6 +12,7 @@
overflow: hidden;
padding: 42px 48px;
background: #11110f;
text-align: left;
}
.MMM-NextcloudCookbook .ncc-qr {
@@ -46,8 +47,14 @@
height: 144px;
}
.MMM-NextcloudCookbook .ncc-recipe header {
box-sizing: border-box;
min-height: 175px;
padding-right: 220px;
}
.MMM-NextcloudCookbook .ncc-recipe h1 {
margin: 0 220px calc(26px * var(--ncc-type-scale)) 0;
margin: 0 0 calc(26px * var(--ncc-type-scale));
color: #fff6d8;
font-size: calc(82px * var(--ncc-type-scale));
line-height: 1.08;
@@ -55,6 +62,7 @@
.MMM-NextcloudCookbook .ncc-meta {
display: flex;
flex-wrap: wrap;
gap: 10px 22px;
align-items: baseline;
margin: 0 0 calc(36px * var(--ncc-type-scale));
@@ -71,6 +79,14 @@
}
.MMM-NextcloudCookbook .ncc-columns {
display: block;
}
.MMM-NextcloudCookbook .ncc-layout-stacked section:first-child {
margin-bottom: calc(42px * var(--ncc-type-scale));
}
.MMM-NextcloudCookbook .ncc-layout-side-by-side {
display: grid;
grid-template-columns: minmax(260px, 0.8fr) minmax(400px, 1.4fr);
gap: 42px;
+3 -1
View File
@@ -5,6 +5,7 @@ Module.register("MMM-NextcloudCookbook", {
controlPath: "/MMM-NextcloudCookbook/control",
controlUrl: "",
animationSpeed: 400,
layout: "stacked",
shareUrl: "",
sharePassword: ""
},
@@ -156,7 +157,8 @@ Module.register("MMM-NextcloudCookbook", {
article.appendChild(header);
const columns = document.createElement("div");
columns.className = "ncc-columns";
const layout = this.config.layout === "side-by-side" ? "side-by-side" : "stacked";
columns.className = `ncc-columns ncc-layout-${layout}`;
const ingredients = document.createElement("section");
const ingredientsTitle = document.createElement("h2");
+8 -1
View File
@@ -16,11 +16,18 @@ link; it should look like `https://cloud.example.test/s/SHARE_TOKEN`.
position: "bottom_right",
config: {
shareUrl: "https://cloud.example.test/s/SHARE_TOKEN",
controlUrl: "http://mirror.example.test:8080/MMM-NextcloudCookbook/control"
controlUrl: "http://mirror.example.test:8080/MMM-NextcloudCookbook/control",
layout: "stacked"
}
}
```
`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.
The configured `position` controls where the QR controller appears during the
normal MagicMirror layout. When a recipe is activated, the module displays a
fixed full-screen overlay regardless of that region. Exiting recipe mode
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "mmm-nextcloud-cookbook",
"version": "0.1.1",
"version": "0.2.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mmm-nextcloud-cookbook",
"version": "0.1.1",
"version": "0.2.0",
"dependencies": {
"fast-xml-parser": "5.10.1",
"qrcode": "1.5.4"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "mmm-nextcloud-cookbook",
"version": "0.1.1",
"version": "0.2.0",
"private": true,
"description": "Display recipes from a Nextcloud Cookbook share on MagicMirror",
"main": "node_helper.js",