Skip to content

Commit

Permalink
resolving conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kailasnadh790 committed May 21, 2024
2 parents 3f1c394 + 0d4d91c commit 6e96e53
Show file tree
Hide file tree
Showing 124 changed files with 8,084 additions and 5,799 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ module.exports = {
'import/extensions': ['error', {
js: 'always',
}],
'max-len': ['error', { "code": 200 }],
'function-paren-newline': 'off',
},
};
1 change: 1 addition & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ jobs:
node-version: '16' #required for npm 8 or later.
- run: npm install
- run: npm run lint
- run: npm test
env:
CI: true
21 changes: 21 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recursive": true
}
1 change: 1 addition & 0 deletions blocks/agent-search/builders/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const addSelectionTag = (wrapper, filter, value) => {
`;
wrapper.querySelector('.selection-tags-list').append(li);
};

/**
* Builds the Container for the search bar selections.
*
Expand Down
5 changes: 3 additions & 2 deletions blocks/header/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ body.light-nav {
/ 1fr min-content;
align-items: start;
overflow-y: scroll;
z-index: 50;
z-index: 1000;
}

.header.block nav[aria-expanded="true"] {
Expand Down Expand Up @@ -259,6 +259,7 @@ body.light-nav {
}

.header.block nav .nav-hamburger .open {
display: block;
position: absolute;
top: 0;
left: 0;
Expand Down Expand Up @@ -444,7 +445,7 @@ body.light-nav {
right: 0;
height: 5px;
background-color: var(--white);
z-index: 10;
z-index: 1010;
}

.header.block nav[aria-expanded="true"] .nav-sections > ul > li > ul {
Expand Down
16 changes: 16 additions & 0 deletions blocks/hero/hero.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ main .section.full-width > .hero-wrapper {
height: 100%;
}

/* video included */
.hero .hero-video {
position: absolute;
inset: 0;
margin: auto;
height: 100%;
width: 100%;
object-fit: cover;
object-position: center;
}

.hero .hero-video.hide {
display: none;
}

.hero.block > div {
padding: 0 16px;
width: 100%;
Expand Down Expand Up @@ -101,6 +116,7 @@ main .section.full-width > .hero-wrapper {
.hero.block > div .content h2,
.hero.block > div .content p {
color: var(--white);
z-index: 1;
}

.hero.block > .row > .headline {
Expand Down
30 changes: 29 additions & 1 deletion blocks/hero/hero.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
import {
preloadHeroImage,
} from '../../scripts/scripts.js';

import buildSearch from './search/search.js';

const decorateVideo = (parent, src) => {
const video = document.createElement('video');
video.classList.add('hero-video');
video.loop = true;
const source = document.createElement('source');
source.src = src;
source.type = 'video/mp4';
video.appendChild(source);
parent.appendChild(video);
video.muted = true;
video.play();
};

async function getPictures(block) {
let pictures = block.querySelectorAll('picture');
if (!pictures.length) {
Expand Down Expand Up @@ -32,6 +44,21 @@ function rotateImage(images) {
}

export default async function decorate(block) {
// check if it has a video
const video = block.querySelector('a[href*=".mp4"]');
const videoWrapper = video && video.closest('div');
videoWrapper.classList.add('video-wrapper');
const videoLink = videoWrapper?.firstElementChild;
// transform link into a video tag
if (videoLink) {
const parent = videoLink.parentElement;
const videoHref = videoLink.href;
videoLink.remove();
setTimeout(() => {
decorateVideo(parent, videoHref);
}, 3000);
}

const pictures = await getPictures(block);
preloadHeroImage(pictures[0]);
pictures[0].classList.add('active');
Expand Down Expand Up @@ -80,6 +107,7 @@ export default async function decorate(block) {

const wrapper = document.createElement('div');
wrapper.append(images);
if (videoWrapper) wrapper.append(videoWrapper);
// don't add contentWrapper if it's empty
if (contentWrapper.innerHTML !== '') wrapper.append(contentWrapper);
if (headlineWrapper.hasChildNodes()) {
Expand Down
3 changes: 0 additions & 3 deletions blocks/hero/search/agent.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@

.hero.block .agent-search .selection-tags {
position: absolute;
}

.hero.block .agent-search .selection-tags {
padding: 0;
}

Expand Down
227 changes: 0 additions & 227 deletions blocks/hero/search/home-delayed.js

This file was deleted.

Loading

0 comments on commit 6e96e53

Please sign in to comment.