Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon cards #119 #181

Merged
merged 26 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7f9912b
#509 Fix displaying header on dealer page
TomaszDziezykNetcentric Nov 8, 2023
7e42bcc
Merge pull request #511 from hlxsites/509-header-vs-dealer-sidebar
TomaszDziezykNetcentric Nov 9, 2023
97b1d20
fix done
santi-homps Nov 10, 2023
05ec056
Merge branch 'main' into 500-google-logo
SantiagoHomps-NC Nov 10, 2023
365a026
one trust position ix
santi-homps Nov 10, 2023
7315c8e
Merge pull request #513 from hlxsites/500-google-logo
SantiagoHomps-NC Nov 10, 2023
5355a15
Embed block match NZ one
jonatan-lledo-netcentric Nov 15, 2023
21d0393
Merge pull request #515 from hlxsites/set-embed-block-match-the-nz-one
jonatan-lledo-netcentric Nov 15, 2023
69a3ddf
Update feed.xml
aem-code-sync[bot] Nov 16, 2023
39be3e8
Fix createElement() v1-Cards
jonatan-lledo-netcentric Nov 16, 2023
5e1eab5
Merge pull request #517 from hlxsites/v1-cards-create-element-bug
jonatan-lledo-netcentric Nov 16, 2023
46d967e
Update feed.xml
aem-code-sync[bot] Nov 16, 2023
ebfe94c
Merge pull request #172 from Netcentric/develop
cogniSyb Nov 20, 2023
007d0c2
Update release.yml
cogniSyb Nov 20, 2023
b3c29e3
columns block adapted
santi-homps Nov 22, 2023
1626078
icon cards working
santi-homps Nov 23, 2023
4f370e8
css clean
santi-homps Nov 23, 2023
e01036b
adjustements
santi-homps Nov 27, 2023
5c9ae83
Merge branch 'develop' into 119-icon-cards
santi-homps Nov 27, 2023
963a9da
last changes
santi-homps Nov 28, 2023
88463a0
specific class
santi-homps Nov 28, 2023
12bcd56
btn state styling
santi-homps Nov 28, 2023
625ce24
comments corrected
santi-homps Nov 29, 2023
9dc6849
secondary btn margin corrected
santi-homps Nov 30, 2023
eb6e796
secondary btn class added
santi-homps Nov 30, 2023
dd59bbf
cleanup
santi-homps Nov 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
changelog:
exclude:
labels:
- ignore-for-release
- Ignore for release
categories:
- title: Functional requirements
labels:
Expand Down
7 changes: 4 additions & 3 deletions blocks/cards/cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ const updateListElements = (ul, isDarkVar = false, isCTABlock = false) => {
const buttons = li.querySelectorAll('.cards-card-body .button-container');
const { length } = buttons;
if (length === 0) return;
const tempLink = [...buttons].at(-1).firstChild;
const newLink = createElement('a', '', {
// Last button is the one we want to use at card level
const tempLink = [...buttons].at(-1).querySelector('a');
const newLink = createElement('a', {
props: { href: tempLink.href, title: tempLink.title },
});

buttons[length - 1].remove();
buttons[length - 1].remove(); // remove last button
newLink.innerHTML = li.innerHTML;
li.textContent = '';
li.appendChild(newLink);
Expand Down
12 changes: 9 additions & 3 deletions blocks/dealer-locator/dealer-locator.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
font-family: var(--ff-body);
}

/* cookie button position fix */
#onetrust-consent-sdk #ot-sdk-btn-floating.ot-floating-button {
bottom: 30px;
}

main .section.dealer-locator-container > div {
margin: 0;
}
Expand Down Expand Up @@ -711,18 +716,19 @@ main .section.dealer-locator-container > div {
width: 100%
}

.dealer-locator #map .gmnoprint + .gm-style-cc,
.dealer-locator #map .gmnoprint {
top: 0;
margin-top: 45px
}

@media (max-width: 992px) {
.dealer-locator #map .gmnoprint {
display:none
.dealer-locator #map .gm-bundled-control {
display: none;
}

.dealer-locator #map {
height: calc(50% - 39px);
height: calc(50% - 41px)
}
}

Expand Down
19 changes: 16 additions & 3 deletions blocks/embed/embed.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
import {
selectVideoLink, addPlayIcon, showVideoModal, isLowResolutionVideoUrl, createIframe,
createLowResolutionBanner,
createLowResolutionBanner, videoTypes,
} from '../../scripts/video-helper.js';

export default function decorate(block) {
const { youtube, local, both } = videoTypes;
const isAutoplay = block.classList.contains('autoplay');
const isLoopedVideo = block.classList.contains('loop');
const isFullWidth = block.classList.contains('full-width');
const isYoutubeOnly = block.classList.contains('youtube-only');
const isLocalOnly = block.classList.contains('local-only');
const isBothOrDefault = block.classList.contains('both') || (!isYoutubeOnly && !isLocalOnly);
const videoWrapper = document.createElement('div');
// removing classes to avoid collision with other css
block.classList.remove('loop', 'autoplay', 'full-width');
videoWrapper.classList.add('embed-video');

let videoType;
if (isBothOrDefault) {
videoType = both;
} else if (isYoutubeOnly) {
videoType = youtube;
} else if (isLocalOnly) {
videoType = local;
}

const links = block.querySelectorAll('a');
const selectedLink = selectVideoLink(links, isFullWidth ? 'local' : 'auto');
const selectedLink = selectVideoLink(links, isFullWidth ? 'local' : 'auto', videoType);
const video = document.createElement('video');
const source = document.createElement('source');

Expand Down Expand Up @@ -66,7 +79,7 @@ export default function decorate(block) {
});
}

if (!isFullWidth) {
if (!isFullWidth && !isLocalOnly) {
const banner = createLowResolutionBanner();
videoWrapper.prepend(banner);
}
Expand Down
67 changes: 2 additions & 65 deletions blocks/v2-columns/v2-columns.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,43 +67,6 @@
margin: 5px 0 0;
}

.v2-columns--info .v2-columns__column {
gap: 8px;
}

.v2-columns--info .icon {
margin-bottom: 8px;
}

.v2-columns--info .v2-columns__heading {
margin: 0;
}

.v2-columns--info .v2-columns__body {
margin: 0 0 22px;
}

.v2-columns--info .v2-columns__column--info-main {
gap: 24px;
}

.v2-columns--info .v2-columns__column--info-main .v2-columns__heading {
padding-top: 24px;
margin: 0;
}

.v2-columns--info .v2-columns__column--with-text {
padding: 0;
}

.v2-columns--info .v2-columns__row {
gap: 40px;
}

.v2-columns--info .v2-columns__button {
margin-bottom: 16px;
}

@media (min-width: 744px) {
.v2-columns {
width: 100%;
Expand All @@ -123,42 +86,16 @@
order: unset;
}

.v2-columns:not(.v2-columns--info) .v2-columns__column--with-text {
.v2-columns .v2-columns__column--with-text {
padding: 0 56px;
}

.v2-columns:not(.v2-columns--info) .v2-columns__column--with-text .v2-columns__heading {
.v2-columns .v2-columns__column--with-text .v2-columns__heading {
margin: 24px 0 12px;
font-size: var(--headline-1-font-size);
}

.v2-columns__column--with-text .v2-columns__body {
margin: 0 0 14px;
}

.v2-columns--info .v2-columns__row {
justify-content: space-between;
align-items: flex-start;
}

.v2-columns--info .v2-columns__body:last-child {
margin: 0;
}

.v2-columns--info .v2-columns__column {
max-width: 245px;
}

.v2-columns--info .v2-columns__column--info-main {
align-self: center;
max-width: 329px;
width: 100%;
}
}

@media (min-width: 1200px) {
.v2-columns--info {
padding: 20px 40px;
background: var(--c-primary-white);
}
}
35 changes: 1 addition & 34 deletions blocks/v2-columns/v2-columns.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { createElement, variantsClassesToBEM } from '../../scripts/common.js';
import { createElement } from '../../scripts/common.js';

export default async function decorate(block) {
const blockName = 'v2-columns';
const variantClasses = ['info'];
variantsClassesToBEM(block.classList, variantClasses, blockName);

const rows = [...block.querySelectorAll(':scope > div')];
const columns = [...block.querySelectorAll(':scope > div > div')];
Expand Down Expand Up @@ -64,35 +62,4 @@ export default async function decorate(block) {
prevEl.replaceWith(pretitle);
}
});

// logic for info variant
if (block.classList.contains(`${blockName}--info`)) {
const headings = [...block.querySelectorAll('h3, h4, h5, h6')];
const h2List = [...block.querySelectorAll('h2')];

headings.forEach((h) => {
h.classList.add('h5');
h.classList.remove('h2');
});

h2List.forEach((h) => {
h.classList.add('with-marker', 'h2');
h.classList.remove('h1');
h.closest(`.${blockName}__column`)?.classList.add(`${blockName}__column--info-main`);
});

// replacing headings (h3, h4, h5, h6) with strong so the block will not break semantic
// (example breaking semantic: col 1 -> h5, col 2 -> h2)
headings.forEach((heading) => {
const newHeadingEl = createElement('strong', { classes: [...heading.classList] });
newHeadingEl.innerHTML = heading.innerHTML;
heading.replaceWith(newHeadingEl);
});

const buttons = [...block.querySelectorAll('.button-container a')];
buttons.forEach((button) => {
button.classList.add('standalone-link', `${blockName}__button`);
button.classList.remove('button', 'button--primary', 'button--large');
});
}
}
Loading