generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #277 from hlxsites/feat-275-convert
Implement converter part for testimonials
- Loading branch information
Showing
13 changed files
with
1,159 additions
and
358 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.testimonial .testimonial>div { | ||
@apply flex items-center gap-8 justify-center; | ||
} | ||
|
||
.testimonial .testimonial>div>div{ | ||
@apply text-2xl leading-9 font-medium text-danahergreyblue-500 relative; | ||
} | ||
|
||
.testimonial.has-image .testimonial>div>div:nth-child(1){ | ||
@apply hidden lg:block lg:flex-shrink-0; | ||
} | ||
|
||
.testimonial .testimonial>div>div img.main-image { | ||
@apply h-64 w-64 rounded-full; | ||
} | ||
|
||
.testimonial .testimonial .testimonial-footer{ | ||
@apply text-base leading-6 font-medium text-danahergray-900 mt-4 items-center gap-4; | ||
} | ||
|
||
.testimonial .testimonial .testimonial-footer img{ | ||
@apply h-16 w-16 rounded-full block lg:hidden; | ||
} | ||
|
||
.testimonial .testimonial .testimonial-footer .flex-col>div:nth-child(2){ | ||
@apply text-base leading-6 font-medium text-danaherblack-600 mt-0; | ||
} |
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,25 @@ | ||
import { | ||
div, img, span, | ||
} from '../../scripts/dom-builder.js'; | ||
import { decorateIcons } from '../../scripts/lib-franklin.js'; | ||
|
||
export default async function decorate(block) { | ||
const buildQuote = div(span({ class: 'icon icon-quote' })); | ||
block.querySelector('.testimonial').classList.add('py-6'); | ||
decorateIcons(buildQuote); | ||
buildQuote.firstChild.classList.add('absolute', 'top-16', 'left-28', 'text-indigo-200', 'w-36', 'h-36', '-translate-x-8', '-translate-y-24', 'transform', 'opacity-50'); | ||
const image = block.querySelector('img'); | ||
const imagecopy = image ? img({ src: image?.src, class: 'rounded-full h-16 w-16' }) : null; | ||
if (image) { | ||
block.classList.add('has-image'); | ||
image.classList.add('main-image'); | ||
} | ||
const divElem = block.querySelector('.testimonial .testimonial > div'); | ||
const footerElem = div( | ||
{ class: 'flex testimonial-footer' }, | ||
imagecopy || '', | ||
div({ class: 'flex flex-col' }, divElem?.querySelectorAll('div')[image ? 2 : 1] ? divElem?.querySelectorAll('div')[image ? 2 : 1] : '', divElem?.querySelectorAll('div')[image ? 3 : 2] ? divElem?.querySelectorAll('div')[image ? 3 : 2] : ''), | ||
); | ||
divElem?.querySelectorAll('div')[image ? 1 : 0]?.append(footerElem); | ||
divElem?.querySelectorAll('div')[image ? 1 : 0]?.append(buildQuote); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Oops, something went wrong.