generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into closed-transaction
- Loading branch information
Showing
17 changed files
with
436 additions
and
57 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
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,101 @@ | ||
.agent-about.block { | ||
display: flex; | ||
flex-direction: column; | ||
margin-top: 3rem; | ||
line-height: var(--line-height-m); | ||
font-size: var(--body-font-size-xs); | ||
letter-spacing: normal; | ||
} | ||
|
||
.agent-about.block a { | ||
cursor: pointer; | ||
} | ||
|
||
.agent-about.block .hide { | ||
display: none; | ||
} | ||
|
||
.agent-about.block a.view-more::after, | ||
.agent-about.block a.view-less::after { | ||
display: inline-block; | ||
margin-top: 1rem; | ||
text-decoration: underline; | ||
} | ||
|
||
.agent-about.block a.view-more::after { | ||
content: "View More"; | ||
} | ||
|
||
.agent-about.block a.view-less::after { | ||
content: "View Less"; | ||
} | ||
|
||
.agent-about.block>div.cols-1, | ||
.agent-about.block>div.cols-2, | ||
.agent-about.block>div.cols-3 { | ||
padding-bottom: 1rem; | ||
} | ||
|
||
.agent-about.block>div>div:first-of-type { | ||
font-size: var(--body-font-size-s); | ||
font-weight: var(--font-weight-bold); | ||
margin-bottom: 0.5rem; | ||
text-transform: capitalize; | ||
} | ||
|
||
.agent-about.block ul { | ||
list-style: unset; | ||
margin: 0 0 0 1.25rem; | ||
} | ||
|
||
@media (min-width: 600px) { | ||
.agent-about.block { | ||
flex-direction: row; | ||
} | ||
|
||
.agent-about.block>div.cols-1 { | ||
flex: 0 0 41.6667%; | ||
max-width: 41.6667%; | ||
padding-right: 1rem; | ||
} | ||
|
||
.agent-about.block>div.cols-2 { | ||
flex: 0 0 33.33%; | ||
max-width: 33.33%; | ||
padding-left: 1rem; | ||
padding-right: 1rem; | ||
} | ||
|
||
.agent-about.block>div.cols-3 { | ||
flex: 0 0 25%; | ||
max-width: 25%; | ||
padding-left: 1rem; | ||
padding-right: 1rem; | ||
} | ||
} | ||
|
||
@media (min-width: 900px) { | ||
.agent-about.block>div.cols-1 { | ||
flex: 0 0 50%; | ||
max-width: 50%; | ||
} | ||
|
||
.agent-about.block>div.cols-2, | ||
.agent-about.block>div.cols-3 { | ||
flex: 0 0 25%; | ||
max-width: 25%; | ||
} | ||
|
||
.agent-about.block { | ||
font-size: var(--body-font-size-s); | ||
} | ||
|
||
.agent-about.block>div>div:first-of-type { | ||
font-size: var(--body-font-size-m); | ||
} | ||
|
||
.agent-about.block a.view-more::after, | ||
.agent-about.block a.view-less::after { | ||
font-size: var(--body-font-size-s); | ||
} | ||
} |
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,34 @@ | ||
import { a, div } from '../../scripts/dom-helpers.js'; | ||
|
||
const viewMoreOnClick = (anchor, block) => { | ||
anchor.addEventListener('click', () => { | ||
if (anchor.classList.contains('view-more')) { | ||
anchor.classList.remove('view-more'); | ||
anchor.classList.add('view-less'); | ||
block.querySelector('.about-text').classList.remove('hide'); | ||
block.querySelector('.about-text-truncate').classList.add('hide'); | ||
} else { | ||
anchor.classList.remove('view-less'); | ||
anchor.classList.add('view-more'); | ||
block.querySelector('.about-text').classList.add('hide'); | ||
block.querySelector('.about-text-truncate').classList.remove('hide'); | ||
} | ||
}); | ||
}; | ||
|
||
export default function decorate(block) { | ||
const children = [...block.children]; | ||
if (children?.length) { | ||
children.forEach((child, index) => { | ||
child.classList.add(`cols-${index + 1}`); | ||
if (index === 0) { | ||
child.children[1].classList.add('about-text', 'hide'); | ||
child.append(div({ class: 'about-text-truncate' }, | ||
`${child.children[1].textContent.substring(0, 245)}...`)); | ||
const anchor = a({ class: 'view-more' }); | ||
child.append(anchor); | ||
viewMoreOnClick(anchor, 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,94 @@ | ||
.agent-testimonials.block { | ||
position: relative; | ||
width: 100%; | ||
overflow: hidden; | ||
border-radius: 10px; | ||
} | ||
|
||
.agent-testimonials.block .testimonials { | ||
display: flex; | ||
transition: transform 0.5s ease; | ||
width: 100%; | ||
} | ||
|
||
.agent-testimonials.block .testimonials-inner { | ||
display: flex; | ||
width: 100%; | ||
} | ||
|
||
.agent-testimonials.block .testimonials-item { | ||
min-width: 100%; | ||
box-sizing: border-box; | ||
padding: 20px; | ||
text-align: center; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
position: relative; | ||
} | ||
|
||
.agent-testimonials.block .rating-stars { | ||
color: var(--primary-color); | ||
margin-bottom: 10px; | ||
font-size: 25px; | ||
margin-left: 50px; | ||
} | ||
|
||
.agent-testimonials.block .review-text.full { | ||
max-height: none; | ||
font-size: 26px; | ||
} | ||
|
||
.agent-testimonials.block .review-text { | ||
font-size: 26px; | ||
margin-bottom: 20px; | ||
padding-left: 50px; | ||
padding-right: 50px; | ||
} | ||
|
||
.agent-testimonials.block .read-more { | ||
font-size: 14px; | ||
color: #607C8C; | ||
cursor: pointer; | ||
display: inline-block; | ||
|
||
} | ||
|
||
.agent-testimonials.block .reviewer-name { | ||
font-weight: bold; | ||
margin-bottom: 10px; | ||
align-self: center; | ||
} | ||
|
||
.agent-testimonials.block .testimonials-arrow { | ||
position: absolute; | ||
top: 50%; | ||
transform: translateY(-50%); | ||
background: none; | ||
border: none; | ||
color: var(--black); | ||
font-size: 90px; | ||
padding: 0; | ||
cursor: pointer; | ||
} | ||
|
||
.agent-testimonials.block .left-arrow { | ||
left: 10px; | ||
} | ||
|
||
.agent-testimonials.block .right-arrow { | ||
right: 10px; | ||
} | ||
|
||
.agent-testimonials.block .testimonials-counter { | ||
position: absolute; | ||
bottom: 10px; | ||
right: 10px; | ||
font-size: 16px; | ||
color: #333; | ||
} | ||
|
||
.agent-testimonials.block .remaining-text { | ||
font: inherit; | ||
font-size: 26px; | ||
} |
Oops, something went wrong.