Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Sm1pleScr1pt committed Jul 3, 2024
2 parents daf7446 + 8202caa commit a89ff8d
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 9 deletions.
33 changes: 26 additions & 7 deletions blocks/header/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ header nav .nav-sections .default-content-wrapper > ul > li > ul::before {
}

.header-wrapper .nav-wrapper nav[aria-expanded="true"] .nav-sections {
display: block;
display: none;
position: absolute;
top: 100%;
overflow-y: auto;
Expand Down Expand Up @@ -966,7 +966,7 @@ header nav .nav-sections .default-content-wrapper > ul > li > ul::before {
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(1) li:nth-child(2) span,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(1) li:nth-child(3) span,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(1) li:nth-child(4) span{
/* color: #212529; */
color: #212529;
font-size: 14px;
line-height: 20px;
padding-left: 8px;
Expand Down Expand Up @@ -996,16 +996,38 @@ header nav .nav-sections .default-content-wrapper > ul > li > ul::before {
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(1) li:nth-child(4)::after{
position: absolute;
content: '';
border: solid black;
border: 1px solid black;
border-width: 0 2px 2px 0;
display: inline-block;
padding: 3.5px;
margin-top: -3px;
transform: rotate(45deg);
right: 3px;
top: 24px;
transition: transform .3s linear;
display: inline;
}
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(6) li:nth-child(1).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(6) li:nth-child(2).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(6) li:nth-child(3).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(6) li:nth-child(4).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(4) li:nth-child(3).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(3) li:nth-child(1).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(3) li:nth-child(2).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(3) li:nth-child(3).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(3) li:nth-child(4).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(2) li:nth-child(1).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(2) li:nth-child(2).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(2) li:nth-child(3).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(2) li:nth-child(4).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(1) li:nth-child(1).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(1) li:nth-child(2).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(1) li:nth-child(3).active::after,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(1) li:nth-child(4).active::after{
/* transform: rotate(225deg);
border: 1px solid #f26841;
border-width: 0 2px 2px 0; */
}

.section.mobile-view-header .code-wrapper .code div div ul:nth-child(6) > li:nth-child(1) > ul,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(6) > li:nth-child(2) > ul,
.section.mobile-view-header .code-wrapper .code div div ul:nth-child(6) > li:nth-child(3) > ul,
Expand All @@ -1021,9 +1043,6 @@ header nav .nav-sections .default-content-wrapper > ul > li > ul::before {
display: none;
padding-left: 19px;
}
/* .section.mobile-view-header .code-wrapper .code div div ul:nth-child(2) > li:nth-child(1) > ul > li:nth-child(1){
margin-bottom: 1pc;
} */
.section.mobile-view-header .code-wrapper .code div > div > ul:nth-child(6) > li:nth-child(1) > ul li,
.section.mobile-view-header .code-wrapper .code div > div > ul:nth-child(6) > li:nth-child(2) > ul li,
.section.mobile-view-header .code-wrapper .code div > div > ul:nth-child(6) > li:nth-child(3) > ul li,
Expand Down
7 changes: 5 additions & 2 deletions blocks/tab-link/tab-link.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createButton, createCarousle, getProps } from "../../scripts/scripts.js";
import { createButton, createCarousle, getProps,targetObject } from "../../scripts/scripts.js";

export default function decorate(block) {
console.log("tab link block");
const [, classes, prev, next] = getProps(block, {
picture: true
})
if (classes === "carousel") {
if (classes === "carousel" && !targetObject.isMobile) {
block.children[3].remove();
block.children[2].remove();
block.children[1].remove();
Expand Down Expand Up @@ -46,9 +46,11 @@ export default function decorate(block) {
if (model.classList.contains("model-mob-hide")) {
model.classList.remove("model-mob-hide");
document.body.classList.remove("overlay-active");
document.body.style.overflow="auto";
} else {
model.classList.add("model-mob-hide");
document.querySelector("body").classList.add("overlay-active");
document.body.style.overflow="hidden";
}
})

Expand All @@ -60,5 +62,6 @@ export default function decorate(block) {
overlay.addEventListener('click', function () {
model.classList.remove("model-mob-hide");
document.body.classList.remove("overlay-active");
document.body.style.overflow="auto";
});
}
36 changes: 36 additions & 0 deletions component-models.json
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,42 @@
"label": "Tab Id",
"description": "Sets the id of the tab.",
"multi": true
},
{
"component": "text",
"valueType": "string",
"name": "tab-name-child-1",
"value": "",
"label": "Tab Name Child 1",
"description": "Sets the name of the tab child 1.",
"multi": true
},
{
"component": "text",
"valueType": "string",
"name": "tab-name-child-1-id",
"value": "",
"label": "Tab Name Child 1 Id",
"description": "Sets the id of the tab child 1.",
"multi": true
},
{
"component": "text",
"valueType": "string",
"name": "tab-name-child-2",
"value": "",
"label": "Tab Name Child 2",
"description": "Sets the name of the tab child 2.",
"multi": true
},
{
"component": "text",
"valueType": "string",
"name": "tab-name-child-2-id",
"value": "",
"label": "Tab Name Child 2 Id",
"description": "Sets the id of the tab child 2.",
"multi": true
}
]
},
Expand Down
1 change: 1 addition & 0 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function moveAttributes(from, to, attributes) {
/* helper script start */
export let targetObject = {
model: null,
isMobile:window.matchMedia("(max-width: 1024px)").matches
};

export function renderHelper(data, template, callBack) {
Expand Down

0 comments on commit a89ff8d

Please sign in to comment.