From 8c559be5b7b792b24aa7e75af3fe64ac43b6e7a2 Mon Sep 17 00:00:00 2001 From: Amogh Date: Mon, 28 Oct 2024 15:31:30 -0400 Subject: [PATCH 1/9] feat: Update cards.css --- blocks/cards/cards.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blocks/cards/cards.css b/blocks/cards/cards.css index 7d88439..0620d92 100644 --- a/blocks/cards/cards.css +++ b/blocks/cards/cards.css @@ -8,12 +8,12 @@ } .cards > ul > li { - border: 1px solid #dadada; + border: 1px solid red; background-color: var(--background-color); } .cards .cards-card-body { - margin: 16px; + margin: 19px; } .cards .cards-card-image { From d16a3fc56942c2f06bded32f6111a317a6600503 Mon Sep 17 00:00:00 2001 From: Amogh Date: Mon, 28 Oct 2024 15:42:53 -0400 Subject: [PATCH 2/9] Create quote.js --- blocks/quote/quote.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 blocks/quote/quote.js diff --git a/blocks/quote/quote.js b/blocks/quote/quote.js new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/blocks/quote/quote.js @@ -0,0 +1 @@ + From bbbf24525c3fb7e63e5aa9299ce21c6f1ccc402b Mon Sep 17 00:00:00 2001 From: Amogh Date: Mon, 28 Oct 2024 15:43:05 -0400 Subject: [PATCH 3/9] Create quote.css --- blocks/quote/quote.css | 1 + 1 file changed, 1 insertion(+) create mode 100644 blocks/quote/quote.css diff --git a/blocks/quote/quote.css b/blocks/quote/quote.css new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/blocks/quote/quote.css @@ -0,0 +1 @@ + From a4fa9dbd31aae9bff8e1ba1490b7277e042bdedc Mon Sep 17 00:00:00 2001 From: Amogh Date: Mon, 28 Oct 2024 15:45:00 -0400 Subject: [PATCH 4/9] Update quote.js --- blocks/quote/quote.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/blocks/quote/quote.js b/blocks/quote/quote.js index 8b13789..99629fc 100644 --- a/blocks/quote/quote.js +++ b/blocks/quote/quote.js @@ -1 +1,24 @@ +import { createOptimizedPicture } from '../../scripts/aem.js'; +import { moveInstrumentation } from '../../scripts/scripts.js'; +export default function decorate(block) { + /* change to ul, li */ + const ul = document.createElement('ul'); + [...block.children].forEach((row) => { + const li = document.createElement('li'); + moveInstrumentation(row, li); + while (row.firstElementChild) li.append(row.firstElementChild); + [...li.children].forEach((div) => { + if (div.children.length === 1 && div.querySelector('picture')) div.className = 'cards-card-image'; + else div.className = 'cards-card-body'; + }); + ul.append(li); + }); + ul.querySelectorAll('picture > img').forEach((img) => { + const optimizedPic = createOptimizedPicture(img.src, img.alt, false, [{ width: '750' }]); + moveInstrumentation(img, optimizedPic.querySelector('img')); + img.closest('picture').replaceWith(optimizedPic); + }); + block.textContent = ''; + block.append(ul); +} From cab44bc99de941801c5592510318f87c82860d2e Mon Sep 17 00:00:00 2001 From: Amogh Date: Mon, 28 Oct 2024 15:46:25 -0400 Subject: [PATCH 5/9] Create _quote.json --- blocks/quote/_quote.json | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 blocks/quote/_quote.json diff --git a/blocks/quote/_quote.json b/blocks/quote/_quote.json new file mode 100644 index 0000000..0064743 --- /dev/null +++ b/blocks/quote/_quote.json @@ -0,0 +1,48 @@ +{ + "definitions": [ + { + "title": "Quote", + "id": "quote", + "plugins": { + "xwalk": { + "page": { + "resourceType": "core/franklin/components/block/v1/block", + "template": { + "name": "Quote", + "model": "quote" + } + } + } + } + } + ], + "models": [ + { + "id": "quote", + "fields": [ + { + "component": "reference", + "valueType": "string", + "name": "image", + "label": "Image", + "multi": false + }, + { + "component": "text", + "valueType": "string", + "name": "imageAlt", + "label": "Alt", + "value": "" + }, + { + "component": "richtext", + "name": "text", + "value": "", + "label": "Text", + "valueType": "string" + } + ] + } + ], + "filters": [] +} From 9ad4e59d6f40b94d04a918e7560e7f5c33903655 Mon Sep 17 00:00:00 2001 From: Amogh Date: Mon, 28 Oct 2024 15:48:15 -0400 Subject: [PATCH 6/9] Update quote.js --- blocks/quote/quote.js | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/blocks/quote/quote.js b/blocks/quote/quote.js index 99629fc..8b13789 100644 --- a/blocks/quote/quote.js +++ b/blocks/quote/quote.js @@ -1,24 +1 @@ -import { createOptimizedPicture } from '../../scripts/aem.js'; -import { moveInstrumentation } from '../../scripts/scripts.js'; -export default function decorate(block) { - /* change to ul, li */ - const ul = document.createElement('ul'); - [...block.children].forEach((row) => { - const li = document.createElement('li'); - moveInstrumentation(row, li); - while (row.firstElementChild) li.append(row.firstElementChild); - [...li.children].forEach((div) => { - if (div.children.length === 1 && div.querySelector('picture')) div.className = 'cards-card-image'; - else div.className = 'cards-card-body'; - }); - ul.append(li); - }); - ul.querySelectorAll('picture > img').forEach((img) => { - const optimizedPic = createOptimizedPicture(img.src, img.alt, false, [{ width: '750' }]); - moveInstrumentation(img, optimizedPic.querySelector('img')); - img.closest('picture').replaceWith(optimizedPic); - }); - block.textContent = ''; - block.append(ul); -} From 7b91acfde34244f5a97a598c907777e8352dde13 Mon Sep 17 00:00:00 2001 From: Amogh Date: Mon, 28 Oct 2024 15:53:30 -0400 Subject: [PATCH 7/9] Update quote.css --- blocks/quote/quote.css | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/blocks/quote/quote.css b/blocks/quote/quote.css index 8b13789..e8d1e0b 100644 --- a/blocks/quote/quote.css +++ b/blocks/quote/quote.css @@ -1 +1,37 @@ +.quote-container .quote-wrapper { + max-width: unset; + padding: 0; +} +.quote { + position: relative; + padding: 20px 20px; + min-height: 400px; +} + +.quote h1 { + max-width: 1200px; + margin-left: auto; + margin-right: auto; + color: var(--background-color); +} + +.quote picture { + position: absolute; + z-index: -1; + inset: 0; + object-fit: cover; + box-sizing: border-box; +} + +.quote img { + object-fit: cover; + width: 100%; + height: 100%; +} + +@media (width >= 900px) { + .quote { + padding: 40px 32px; + } +} From 9b6f6d1179fc4bd0aa66a0a1bf6a646ab72832dd Mon Sep 17 00:00:00 2001 From: Amogh Date: Mon, 28 Oct 2024 15:54:51 -0400 Subject: [PATCH 8/9] Update .eslintignore --- .eslintignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintignore b/.eslintignore index 644bc2e..31fc978 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ -helix-importer-ui \ No newline at end of file +helix-importer-ui +blocks/quote/quote.js From 0ecc9c25d27e81c1ce6b225b018e7235f8097d8b Mon Sep 17 00:00:00 2001 From: Amogh Date: Mon, 28 Oct 2024 15:57:06 -0400 Subject: [PATCH 9/9] Update quote.css --- blocks/quote/quote.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/quote/quote.css b/blocks/quote/quote.css index e8d1e0b..8c79543 100644 --- a/blocks/quote/quote.css +++ b/blocks/quote/quote.css @@ -5,7 +5,7 @@ .quote { position: relative; - padding: 20px 20px; + padding: 20px 24px; min-height: 400px; }