Skip to content

Commit

Permalink
Merge pull request #48 from Netcentric/23-card-block
Browse files Browse the repository at this point in the history
23 card block
  • Loading branch information
Lakshmishri authored Sep 6, 2023
2 parents 895686b + 154ec19 commit 206675f
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 23 deletions.
86 changes: 86 additions & 0 deletions blocks/v2-cards/v2-cards.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
main .section.v2-cards-container .v2-cards-wrapper {
padding: 0;
}

.v2-cards {
display: flex;
flex-direction: column;
gap: 24px;
padding: 16px;
justify-content: center;
max-width: var(--wrapper-width);
margin: auto;
}

.v2-cards__card-item {
background: var(--c-primary-white);
color: var(--c-primary-black);
}

.v2-cards__picture-wrapper {
padding: 0;
}

.v2-cards__text-wrapper {
padding: 24px;
}

.v2-cards__picture {
display: flex;
}

.v2-cards__image {
background: var(--c-tertiary-light-cool-gray);
aspect-ratio: 16/9;
width: 100%;
object-fit: cover;
}

.v2-cards__heading {
font-family: var(--ff-subheadings-medium);
font-size: var(--headline-5-font-size);
line-height: var(--headline-5-line-height);
margin: 0 0 7px;
}

.v2-cards__text-wrapper p {
margin: 0;
color: var(--c-primary-black);
font-family: var(--ff-body);
font-size: var(--body-1-font-size);
font-style: normal;
line-height: var(--body-1-line-height);
letter-spacing: 0.16px;
}

.v2-cards__text-wrapper .v2-cards__button-container {
margin-top: 16px;
}

.v2-cards__button-container .v2-cards__button:any-link {
align-items: flex-start;
}

.v2-cards__button-container .icon {
stroke: currentcolor;
width: 16px;
height: 16px;
}

.v2-cards__button-container .icon svg {
width: 16px;
height: 16px;
}

@media (min-width: 744px) {
.v2-cards {
flex-flow: row wrap;
gap: 16px;
padding: 0;
justify-content: center;
}

.v2-cards__card-item {
max-width: calc((100% - 32px) / 3);
}
}
33 changes: 33 additions & 0 deletions blocks/v2-cards/v2-cards.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const blockClass = 'v2-cards';

export default async function decorate(block) {
const cardsItems = [...block.querySelectorAll(':scope > div')];
cardsItems.forEach((el) => el.classList.add(`${blockClass}__card-item`));

const cardsSections = [...block.querySelectorAll(':scope > div > div')];
cardsSections.forEach((el) => {
el.classList.add(`${blockClass}__text-wrapper`);
});

const pictures = [...block.querySelectorAll('picture')];
pictures.forEach((el) => {
el.classList.add(`${blockClass}__picture`);
el.parentElement.classList.add(`${blockClass}__picture-wrapper`);
el.parentElement.classList.remove(`${blockClass}__text-wrapper`);
});

const images = [...block.querySelectorAll('img')];
images.forEach((el) => el.classList.add(`${blockClass}__image`));

const cardsHeadings = [...block.querySelectorAll('h1, h2, h3, h4, h5, h6')];
cardsHeadings.forEach((el) => el.classList.add(`${blockClass}__heading`));

const buttons = [...block.querySelectorAll('.button-container')];
buttons.forEach((el) => {
el.classList.add(`${blockClass}__button-container`);
[...el.querySelectorAll('a')].forEach((link) => {
link.classList.add('standalone-link', `${blockClass}__button`);
link.classList.remove('button', 'button--primary');
});
});
}
4 changes: 2 additions & 2 deletions blocks/v2-testimonial/v2-testimonial.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
}

.v2-testimonial__author svg {
width: 34px;
height: 27px;
width: 32px;
height: 32px;
}

.v2-testimonial__video-link-wrapper {
Expand Down
3 changes: 3 additions & 0 deletions icons/chevron-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 3 additions & 10 deletions icons/play.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 6 additions & 7 deletions icons/speach.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 31 additions & 4 deletions styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

/* Helvetica Neue LT Pro, 65 Medium, 18px, 140% */
--headline-5-font-size: 1.125rem; /* 18px */
--headline-5-line-height: 150%;
--headline-5-line-height: 140%;

/* Helvetica Neue LT Pro, 55 Roman / Helvetica Neue LT Pro, 75 Bold, 16px, 150% */
--body-1-font-size: 1rem; /* 16px */
Expand Down Expand Up @@ -245,6 +245,7 @@ h4, h5, h6 {
margin-top: 1em;
margin-bottom: 0.5em;
scroll-margin: calc(var(--nav-height-m) + 1em);
font-weight: normal;
}

h1, h2 {
Expand All @@ -254,13 +255,13 @@ h1, h2 {
h1 {
font-size: var(--headline-1-font-size);
line-height: var(--headline-1-line-height);
letter-spacing: var(--headline-1-line-letter-spacing);
letter-spacing: var(--headline-1-letter-spacing);
}

h2 {
font-size: var(--headline-2-font-size);
line-height: var(--headline-2-line-height);
letter-spacing: var(--headline-2-line-letter-spacing);
letter-spacing: var(--headline-2-letter-spacing);
}

h3 {
Expand Down Expand Up @@ -424,6 +425,7 @@ main .section.black-background {

main .section.dark-background {
background-color: var(--c-secondary-graphite);
color: var(--c-primary-white);
}

main .section.center {
Expand Down Expand Up @@ -944,6 +946,7 @@ main .section.responsive-title h1 {
padding: 0;
}

.section.header-with-mark > .default-content-wrapper:first-child > h1:first-child::before,
.redesign-v2 .with-marker::before {
content: '';
margin: 0;
Expand All @@ -955,14 +958,38 @@ main .section.responsive-title h1 {
top: -18px;
}

.redesign-v2 a.standalone-link {
align-items: center;
color: var(--c-primary-black);
display: inline-flex;
font-family: var(--ff-body-bold);
font-size: var(--button-font-size);
gap: 4px;
letter-spacing: 1.12px;
line-height: var(--button-line-height);
background: transparent;
}

.redesign-v2 a.standalone-link:active,
.redesign-v2 a.standalone-link:visited {
color: var(--c-tertiary-cool-gray);
}

.redesign-v2 a.standalone-link:hover,
.redesign-v2 a.standalone-link:focus {
color: var(--c-tertiary-cool-gray);
text-decoration: underline;
}

@media (min-width: 1040px) {
.redesign-v2 .section {
padding: 80px 0;
}

.redesign-v2 .section > div {
padding: 0 200px;
padding: 0;
margin: 0 auto;
max-width: 1040px;
}

.redesign-v2 .with-marker::before {
Expand Down

0 comments on commit 206675f

Please sign in to comment.