forked from hlxsites/danaher-ls-aem
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hlxsites:main' into main
- Loading branch information
Showing
78 changed files
with
6,055 additions
and
2,597 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ logs/* | |
helix-importer-ui | ||
.DS_Store | ||
*.bak | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export default function decorate(block) { | ||
const main = document.querySelector('main'); | ||
main.prepend(block); | ||
main.parentNode.insertBefore(block, main); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
export default function decorate(block) { | ||
const clonedBlock = block.cloneNode(true); | ||
const listsClone = clonedBlock.querySelector('div > ul').cloneNode(true); | ||
listsClone.className = 'max-w-screen-xl w-full mx-auto px-4 flex gap-4 sm:px-6 lg:px-7 overflow-x-auto'; | ||
listsClone.setAttribute('role', 'list'); | ||
const entries = block.querySelector('div > ul'); | ||
entries.className = 'max-w-screen-xl w-full mx-auto px-4 flex gap-4 sm:px-6 lg:px-7 overflow-x-auto'; | ||
entries.setAttribute('role', 'list'); | ||
const homeIconLi = document.createElement('li'); | ||
homeIconLi.className = 'flex items-center gap-x-3 text-sm font-medium text-gray-500 whitespace-nowrap hover:text-gray-700'; | ||
homeIconLi.innerHTML = '<a href="/" title="Home"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" class="flex-shrink-0 h-5 w-5" data-di-rand="1697430026535"><path d="M11.47 3.84a.75.75 0 011.06 0l8.69 8.69a.75.75 0 101.06-1.06l-8.689-8.69a2.25 2.25 0 00-3.182 0l-8.69 8.69a.75.75 0 001.061 1.06l8.69-8.69z"></path><path d="M12 5.432l8.159 8.159c.03.03.06.058.091.086v6.198c0 1.035-.84 1.875-1.875 1.875H15a.75.75 0 01-.75-.75v-4.5a.75.75 0 00-.75-.75h-3a.75.75 0 00-.75.75V21a.75.75 0 01-.75.75H5.625a1.875 1.875 0 01-1.875-1.875v-6.198a2.29 2.29 0 00.091-.086L12 5.43z"></path></svg></a>'; | ||
listsClone.prepend(homeIconLi); | ||
Array.from(listsClone.children).forEach((element, index) => { | ||
entries.prepend(homeIconLi); | ||
Array.from(entries.children).forEach((element, index) => { | ||
element.classList.add(...'flex items-center gap-x-3 text-sm font-medium text-gray-500 whitespace-nowrap hover:text-gray-700'.split(' ')); | ||
element.setAttribute('aria-hidden', 'true'); | ||
element.setAttribute('data-acsb-hidden', 'true'); | ||
element.setAttribute('data-acsb-force-hidden', 'true'); | ||
const anchor = element.children[0]; | ||
anchor.setAttribute('tabindex', '-1'); | ||
if ((listsClone.children.length - 1) !== index) element.innerHTML = "<svg class='w-6 h-5/6 flex-shrink-0 text-gray-300' viewBox='0 0 24 44' preserveAspectRatio='none' fill='currentColor' xmlns='http://www.w3.org/2000/svg' aria-hidden='true' data-acsb-hidden='true' data-acsb-force-hidden='true' data-di-rand='1697196048881'><path d='M.293 0l22 22-22 22h1.414l22-22-22-22H.293z'></path></svg>"; | ||
if ((entries.children.length - 1) !== index) element.innerHTML = "<svg class='w-6 h-5/6 flex-shrink-0 text-gray-300' viewBox='0 0 24 44' preserveAspectRatio='none' fill='currentColor' xmlns='http://www.w3.org/2000/svg' aria-hidden='true' data-acsb-hidden='true' data-acsb-force-hidden='true' data-di-rand='1697196048881'><path d='M.293 0l22 22-22 22h1.414l22-22-22-22H.293z'></path></svg>"; | ||
element.prepend(anchor); | ||
}); | ||
const breadcrumbWrapper = document.getElementsByClassName('breadcrumb-wrapper')[0]; | ||
const breadcrumbWrapper = block.parentElement; | ||
breadcrumbWrapper.classList.add(...'flex bg-white border-b border-gray-200'.split(' ')); | ||
breadcrumbWrapper.innerHTML = ''; | ||
breadcrumbWrapper.append(listsClone); | ||
breadcrumbWrapper.append(entries); | ||
const breadcrumbSection = breadcrumbWrapper.parentElement; | ||
const mainElement = document.querySelector('main'); | ||
mainElement.parentNode.insertBefore(breadcrumbWrapper, mainElement); | ||
breadcrumbSection.remove(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import { decorateModals } from '../../scripts/scripts.js'; | ||
|
||
export default function decorate(block) { | ||
block.classList.add(...'ctasection mx-auto max-w-7xl lg:py-8'.split(' ')); | ||
block.classList.add(...'ctasection mx-auto max-w-7xl pt-6 lg:py-8'.split(' ')); | ||
block.querySelector(':scope div > div').classList.add(...'md:flex space-y-8 md:space-y-0 md:flex-row w-full py-8 md:py-16 md:px-12 px-6 items-center md:justify-between bg-danaherpurple-800'.split(' ')); | ||
block.querySelector('h2').classList.add(...'text-2xl p-0 m-0 tracking-tight sm:text-3xl text-white font-normal tracking-wide'.split(' ')); | ||
block.querySelector('p').classList.add(...'show-modal-btn btn btn-outline-trending-brand text-lg rounded-full px-6 py-3'.split(' ')); | ||
block.querySelector('h2')?.classList.add(...'text-2xl p-0 m-0 tracking-tight sm:text-3xl text-white font-normal tracking-wide'.split(' ')); | ||
block.querySelectorAll('p > a').forEach((a) => { | ||
a.classList.add(...'btn-outline-trending-brand text-lg rounded-full px-6 py-3 !no-underline'.split(' ')); | ||
if (a.href.includes('#request-quote')) { | ||
block.querySelector('p')?.classList.add(...'show-modal-btn'.split(' ')); | ||
a.classList.remove(...'btn btn-outline-primary'.split(' ')); | ||
} | ||
}); | ||
decorateModals(block); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { makePublicUrl } from '../../scripts/scripts.js'; | ||
import { | ||
li, a, p, div, h2, | ||
} from '../../scripts/dom-builder.js'; | ||
|
||
export default function createCard(article) { | ||
const cardTitle = article.title.indexOf('| Danaher Life Sciences') > -1 | ||
? article.title.split('| Danaher Life Sciences')[0] | ||
: article.title; | ||
|
||
const cardWrapper = a( | ||
{ href: makePublicUrl(article.path), title: article.title }, | ||
h2( | ||
{ | ||
class: | ||
'!px-6 !text-lg !font-semibold !text-danahergray-900 !mb-4 !line-clamp-3 !h-20 !break-words', | ||
}, | ||
cardTitle, | ||
), | ||
p( | ||
{ class: 'px-6 text-sm text-gray-500 pb-0 pt-0 pb-4 line-clamp-4 h-20 break-words' }, | ||
article.description, | ||
), | ||
div( | ||
{ | ||
class: | ||
'inline-flex w-full px-6 py-5 text-base text-danaherblue-600 font-semibold', | ||
}, | ||
'View Application →', | ||
), | ||
); | ||
|
||
return li( | ||
{ | ||
class: | ||
'w-full flex flex-col col-span-1 relative mx-auto justify-center transform transition duration-500 border hover:scale-105 shadow-lg rounded-lg overflow-hidden bg-white max-w-xl', | ||
}, | ||
cardWrapper, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { formatDateUTCSeconds, imageHelper, makePublicUrl } from '../../scripts/scripts.js'; | ||
import { | ||
li, a, p, div, time, span, h2, | ||
} from '../../scripts/dom-builder.js'; | ||
|
||
export default function createCard(article, firstCard = false) { | ||
const cardTitle = article.title.indexOf('| Danaher Life Sciences') > -1 | ||
? article.title.split('| Danaher Life Sciences')[0] | ||
: article.title; | ||
|
||
const cardWrapper = a( | ||
{ href: makePublicUrl(article.path), title: article.title }, | ||
imageHelper(article.image, article.title, firstCard), | ||
p( | ||
{ class: 'cards !px-6 !py-1 !pt-4 !text-sm !text-danaherpurple-500' }, | ||
article.brand || 'Danaher Corporation', | ||
), | ||
p( | ||
{ class: '!px-6 !pb-3 !text-gray-500 !text-sm' }, | ||
time( | ||
{ datetime: formatDateUTCSeconds(article.publishDate) }, | ||
formatDateUTCSeconds(article.publishDate, { month: 'long' }), | ||
), | ||
span({ class: 'pl-2' }, `${article.readingTime} min read`), | ||
), | ||
h2( | ||
{ | ||
class: | ||
'!px-6 !text-lg !font-semibold !text-danahergray-900 !mb-4 !line-clamp-3 !h-20 !break-words', | ||
}, | ||
cardTitle, | ||
), | ||
div( | ||
{ | ||
class: | ||
'mt-auto inline-flex w-full px-6 py-5 text-base text-danaherpurple-500 font-semibold', | ||
}, | ||
'Read Article →', | ||
), | ||
); | ||
|
||
return li( | ||
{ | ||
class: | ||
'w-full flex flex-col col-span-1 relative mx-auto justify-center transform transition duration-500 border hover:scale-105 shadow-lg rounded-lg overflow-hidden bg-white max-w-xl', | ||
}, | ||
cardWrapper, | ||
); | ||
} |
Oops, something went wrong.