Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…lfinance into feature/comp-creation-new
  • Loading branch information
npy11 authored and npy11 committed Jul 4, 2024
2 parents 0bd9e14 + 076d0ef commit a4bd767
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 22 deletions.
1 change: 1 addition & 0 deletions blocks/carousel/carousel.css
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
position: absolute;
left: 160px;
bottom: 60px;
gap: 8px;
}

.section.banner-carousel-wrapper .carousel-wrapper .carousel.block .button-container>button {
Expand Down
22 changes: 19 additions & 3 deletions blocks/footer/footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ footer.footer-wrapper .footer {

@media screen and (max-width:1366px) {
.footer-section-first .columns-wrapper p sup {
right: 27%;
right: 102px;
}
.footer-section-third {
display: none;
Expand Down Expand Up @@ -470,6 +470,7 @@ footer.footer-wrapper .footer {
margin-top: 8px;
}

.section.mobile-footer-section-third .wrappercreation-wrapper .wrapper-creation-container .image-href-desktop a>picture>img,
.section.mobile-footer-section-third .wrappercreation-wrapper .wrapper-creation-container .image-href-mobile a>picture>img {
width: 128px;
height: 38px;
Expand Down Expand Up @@ -503,7 +504,8 @@ footer.footer-wrapper .footer {
column-gap: 32px;
}

.section.footer-follow-us-wrapper .wrappercreation-wrapper .imgwithlink-wrapper .image-href-mobile a>picture img {
.section.footer-follow-us-wrapper .wrappercreation-wrapper .imgwithlink-wrapper .image-href-desktop a>picture img,
.section.footer-follow-us-wrapper .wrappercreation-wrapper .imgwithlink-wrapper .image-href-mobile a>picture img {
width: 22px;
height: 24px;
}
Expand Down Expand Up @@ -588,6 +590,7 @@ footer.footer-wrapper .footer {
margin-top: 0;
}

.section.mobile-footer-section-third .wrappercreation-wrapper .wrapper-creation-container .image-href-desktop a>picture>img,
.section.mobile-footer-section-third .wrappercreation-wrapper .wrapper-creation-container .image-href-mobile a>picture>img {
width: 128px;
height: 38px;
Expand All @@ -613,13 +616,26 @@ footer.footer-wrapper .footer {
margin-left: 16px;
}

.section.footer-follow-us-wrapper .wrappercreation-wrapper .imgwithlink-wrapper .image-href-mobile a>picture img {
.section.footer-follow-us-wrapper .wrappercreation-wrapper .imgwithlink-wrapper .image-href-desktop a>picture img,
.section.footer-follow-us-wrapper .wrappercreation-wrapper .imgwithlink-wrapper .image-href-mobile a>picture img {
width: 25px;
height: 40px;
}

.section.footer-last-wrapper .default-content-wrapper {
padding-bottom: 48px;
}

.footer-section-first {
padding-top: 48px;
}

.footer-section-second .columns > div {
flex-direction: row;
justify-content: space-between;
}
.footer-section-second .columns > div > div {
width: 25%;
}
/* footer third section onwords css end */
}
22 changes: 14 additions & 8 deletions blocks/header/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -375,17 +375,17 @@ header nav .nav-sections .nav-drop::after{
.header-wrapper .nav-wrapper nav .nav-sections .default-content-wrapper>ul>li>ul {
width: 100%;
left: 0;
padding: 0 8.7%;
padding: 0 11%;
background-color: rgb(239 239 239);
position: absolute;
top: 100%;
margin-top: 0;
}

.header-wrapper .nav-wrapper nav .nav-sections .default-content-wrapper>ul>li>ul>li {
width: 25%;
/* width: 25%;
display: flex;
flex-wrap: wrap;
flex-wrap: wrap; */
padding-left: 8px;
padding-right: 8px;
height: max-content;
Expand Down Expand Up @@ -423,11 +423,17 @@ header nav .nav-sections .nav-drop::after{
}

.header-wrapper .nav-wrapper nav .nav-sections .default-content-wrapper>ul>li[aria-expanded="true"]>ul {
display: flex;
/* display: flex;
flex-wrap: wrap;
gap: unset;
gap: unset; */
padding-top: 1rem;
padding-bottom: 1rem;
column-gap: 20px;
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
margin: 0 auto;
max-width: 100%;
row-gap: 20px;
}

.header-wrapper .nav-wrapper nav .nav-sections .default-content-wrapper>ul>li.nav-drop>p {
Expand Down Expand Up @@ -550,9 +556,9 @@ header nav .nav-sections .nav-drop::after{
display: none;
}

.header-wrapper .nav-wrapper nav .nav-sections .default-content-wrapper>ul>li:last-child ul>li {
/* .header-wrapper .nav-wrapper nav .nav-sections .default-content-wrapper>ul>li:last-child ul>li {
width: 12%;
}
} */

header nav .nav-sections .default-content-wrapper > ul > li > ul::before {
content: none;
Expand Down Expand Up @@ -611,7 +617,7 @@ header nav .nav-sections .default-content-wrapper > ul > li > ul::before {
.header-wrapper .nav-wrapper nav .nav-sections .default-content-wrapper > ul > li:nth-child(6) > ul > li:nth-child(1) > ul>li:nth-child(5)::after {
content: "New";
position: absolute;
right: 30%;
right: 25%;
background-color: #41c66e;
border-radius: 4px;
color: #fff;
Expand Down
13 changes: 7 additions & 6 deletions blocks/teaser/teaser.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { targetObject } from "../../scripts/scripts.js";

export function decorateButtons(...buttons) {
return buttons
.map((div) => {
Expand Down Expand Up @@ -41,7 +43,7 @@ export function generateTeaserDOM(props, classes) {
ctaImageUrl3,
mobileImage,
] = props;

const bgPicture = pictureBgContainer.querySelector("picture");
const picture = pictureContainer.querySelector("picture");
const hasShortDescr = shortDescr.textContent.trim() !== "";
Expand All @@ -55,13 +57,12 @@ export function generateTeaserDOM(props, classes) {
const bgPictureStyle = bgPicture?.querySelector('img')?.src || "";
const mobileImageStyle = mobileImage?.querySelector('img')?.src || "";
let bgImageAllow = bgPictureStyle;
const isMobile = window.matchMedia('(max-width: 768px)');
if(isMobile){
bgImageAllow = mobileImageStyle;
if (targetObject.isMobile) {
bgImageAllow = mobileImageStyle;
}

const teaserDOM = document.createRange().createContextualFragment(
`
`
<div class='background' style='background-image:url(${bgImageAllow})'>
<div class="front-picture">${picture ? picture.outerHTML : ""}</div>
<div class='foreground'>
Expand All @@ -80,7 +81,7 @@ export function generateTeaserDOM(props, classes) {
<div class="cta-image">${ctaImageAnchor3 ? ctaImageAnchor3.outerHTML : ""}</div>
</div>
</div>
`
`
);

// set the mobile background color
Expand Down
2 changes: 1 addition & 1 deletion blocks/testimonial/testimonial.css
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@

.section.testimonial-content-wrapper {
padding: 64px 0;
background-color: var(--cloud);
background-color: rgba(235,238,240,0.3);
}

.section.testimonial-content-wrapper .default-content-wrapper h2 {
Expand Down
10 changes: 7 additions & 3 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function moveAttributes(from, to, attributes) {
/* helper script start */
export let targetObject = {
model: null,
isMobile:window.matchMedia("(max-width: 1024px)").matches
isMobile: window.matchMedia("(max-width: 1024px)").matches
};

export function renderHelper(data, template, callBack) {
Expand Down Expand Up @@ -143,10 +143,10 @@ export function createCarousle(block, prevButton, nextButton) {
carousel.addEventListener("touchmove", drag);

carousel.addEventListener("wheel", scrollEvent); // Add scroll event listener
window.addEventListener("resize", () => {
function carouselResizeEventHandler() {
visibleSlides = getVisibleSlides();
setPositionByIndex();
});
}

function dragStart(event) {
isDragging = true;
Expand Down Expand Up @@ -249,6 +249,10 @@ export function createCarousle(block, prevButton, nextButton) {
checkLastChildVisibility();
}

window.addEventListener("resize", () => {
targetObject.isMobile = window.matchMedia("(max-width: 1024px)").matches;
carouselResizeEventHandler();
});
export function createButton(text, picture) {
const button = document.createElement("button");
button.classList.add("carousel-control", text);
Expand Down
1 change: 0 additions & 1 deletion styles/piramal-since/piramal-since.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
display: grid;
grid-template-columns: auto auto auto auto;
gap: 44px 86px;
justify-content: space-between;
text-align: center;
}

Expand Down

0 comments on commit a4bd767

Please sign in to comment.