Skip to content

Commit

Permalink
code migarte from old repo
Browse files Browse the repository at this point in the history
  • Loading branch information
omprakashgupta1995 committed Jul 2, 2024
1 parent 89f71c9 commit 6f9fdea
Show file tree
Hide file tree
Showing 118 changed files with 16,988 additions and 130 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module.exports = {
extends: [
'airbnb-base',
'plugin:json/recommended',
'plugin:xwalk/recommended',
],
env: {
browser: true,
Expand Down
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Please always provide the [GitHub issue(s)](../issues) your PR is for, as well a
Fix #<gh-issue-id>

Test URLs:
- Before: https://main--{repo}--{owner}.hlx.live/
- After: https://<branch>--{repo}--{owner}.hlx.live/
- Before: https://main--piramalfinance--shamalijadhav.hlx.live/
- After: https://<branch>--piramalfinance--shamalijadhav.hlx.live/
49 changes: 0 additions & 49 deletions .github/workflows/cleanup-on-create.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Your project's description...

## Environments
- Preview: https://main--{repo}--{owner}.hlx.page/
- Live: https://main--{repo}--{owner}.hlx.live/
- Preview: https://main--piramalfinance--WWWPiramalFinanceCOM.hlx.page/
- Live: https://main--piramalfinance--WWWPiramalFinanceCOM.hlx.live/

## Installation

Expand All @@ -23,4 +23,4 @@ npm run lint
1. Add the [AEM Code Sync GitHub App](https://github.com/apps/aem-code-sync) to the repository
1. Install the [AEM CLI](https://github.com/adobe/helix-cli): `npm install -g @adobe/aem-cli`
1. Start AEM Proxy: `aem up` (opens your browser at `http://localhost:3000`)
1. Open the `{repo}` directory in your favorite IDE and start coding :)
1. Open the `piramalfinance` directory in your favorite IDE and start coding :)
23 changes: 23 additions & 0 deletions blocks/accordion-group/accordion-group.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@import "../accordion/accordion.css";

/* inside accordion group we can have text below first div */

.shade-box {
background-color: var(--spectrum-gray-100);
padding: 14px 21px 21px;
border-radius: 7px;
margin-bottom: 28px;
}

.accordion-group>.accordion details div {
font-size: var(--exlm-font-size-content);
line-height: var(--exlm-line-height-h4);
margin-left: 14px;
margin-top: 14px;
}

/* override /docs font size */
.accordion-group>.accordion details summary {
font-size: var(--spectrum-font-size-200);
line-height: var(--exlm-line-height-h4);
}
84 changes: 84 additions & 0 deletions blocks/accordion-group/accordion-group.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import { generateAccordionDOM } from "../accordion/accordion.js";

Check failure on line 1 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote

Check failure on line 1 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote

export default function decorate(block) {
// each row is an accordion entry
const accordions = [...block.children];

// loop through all accordion blocks
[...accordions].forEach((accordion) => {
// generate the accordion
const accordionDOM = generateAccordionDOM(accordion);
// empty the content ,keep root element with UE instrumentation
accordion.textContent = "";

Check failure on line 12 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote

Check failure on line 12 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
// add block classes
accordion.classList.add("accordion", "block");

Check failure on line 14 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote

Check failure on line 14 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote

Check failure on line 14 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote

Check failure on line 14 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
accordion.append(accordionDOM);
});

// use same styling as shade-box from /docs
block.classList.add("shade-box");

Check failure on line 19 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote

Check failure on line 19 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
try {
openFunctionFAQ(block);

Check failure on line 21 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

'openFunctionFAQ' was used before it was defined

Check failure on line 21 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

'openFunctionFAQ' was used before it was defined
block.closest(".faq-view-more-logic") ? viewMoreLogicFAQ() : "";

Check failure on line 22 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Expected an assignment or function call and instead saw an expression

Check failure on line 22 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote

Check failure on line 22 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

'viewMoreLogicFAQ' was used before it was defined

Check failure on line 22 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote

Check failure on line 22 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Expected an assignment or function call and instead saw an expression

Check failure on line 22 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote

Check failure on line 22 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

'viewMoreLogicFAQ' was used before it was defined

Check failure on line 22 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
} catch (error) {
console.error(error);

Check warning on line 24 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement

Check warning on line 24 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
}
}

function openFunctionFAQ(block) {
const titles = block.querySelectorAll("details summary");

titles.forEach(function (title) {

Check warning on line 31 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Unexpected unnamed function

Check warning on line 31 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Unexpected unnamed function
title.addEventListener("click", function () {

Check warning on line 32 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Unexpected unnamed function

Check warning on line 32 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Unexpected unnamed function
if(this.classList.contains('active')){
setTimeout(() => {
this.closest("details").removeAttribute("open");
}, 1000);
this.classList.remove("active");
}else{
titles.forEach(function (title) {

Check warning on line 39 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Unexpected unnamed function

Check warning on line 39 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Unexpected unnamed function
title.closest("details").removeAttribute("open");
title.classList.remove("active");
});

this.classList.toggle("active");
}
});
});

}

function viewMoreLogicFAQ() {
document.querySelectorAll(".faq-section-wrapper.faq-view-more-logic").forEach((each) => {
const allFAQSection = each.querySelectorAll(".accordion.block");

allFAQSection.forEach((eachFAQ, index) => {
if (index == 5) {
eachFAQ.classList.add("faq-blur");
}
eachFAQ.classList.toggle("dp-none", index > 5);
});

const buttonContainer = each.querySelector(".button-container");
if (buttonContainer) {
const buttonText = buttonContainer.querySelector("a").textContent.trim();
buttonContainer.innerHTML = buttonText;
viewMoreFAQ(each);
}
});
}
function viewMoreFAQ(eachs) {
const faqButtonContainer = eachs.querySelector(".faq-section-wrapper .button-container");
faqButtonContainer.addEventListener("click", function () {

Check warning on line 72 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Unexpected unnamed function

Check warning on line 72 in blocks/accordion-group/accordion-group.js

View workflow job for this annotation

GitHub Actions / build

Unexpected unnamed function
const isViewMoreFAQ = this.textContent.toLowerCase() === "view more";
this.innerText = isViewMoreFAQ ? "View Less" : "View More";

eachs.querySelectorAll(".accordion.block").forEach((eachFAQ, index) => {
if (index == 5) {
var checkBlurClass = eachFAQ.classList.contains("faq-blur");
checkBlurClass ? eachFAQ.classList.remove("faq-blur") : eachFAQ.classList.add("faq-blur");
}
eachFAQ.classList.toggle("dp-none", !isViewMoreFAQ && index > 5);
});
});
}
Loading

0 comments on commit 6f9fdea

Please sign in to comment.