diff --git a/app/components/client/ecosystem-scripts.js b/app/components/client/ecosystem-scripts.js index f915142..ca22853 100644 --- a/app/components/client/ecosystem-scripts.js +++ b/app/components/client/ecosystem-scripts.js @@ -70,7 +70,7 @@ function open(ecosystemComponentClassName) { } function openSubmodule(ecosystemComponentClassName) { - if (!document.getElementsByClassName(ecosystemComponentClassName)[0].classList.contains("on")) return; // do not activate unless submodule is ".on" + // if (!document.getElementsByClassName(ecosystemComponentClassName)[0].classList.contains("on")) return; // do not activate unless submodule is ".on" document.querySelectorAll(".ecosystem__submodule").forEach(n => { n.classList.remove("active"); @@ -170,16 +170,22 @@ for (const subModule of subModules) { function setSubmoduleConnectionTitle(submoduleClass) { - if (document.getElementsByClassName(submoduleClass)[0].classList.contains("blue")) { - document.querySelector(`.${submoduleClass} .__parent.blue`).className += " active"; - } + switch(true) { + case document.getElementsByClassName(submoduleClass)[0].classList.contains("blue"): + document.querySelector(`.${submoduleClass} .__parent.blue`).className += " active"; + break; - if (document.getElementsByClassName(submoduleClass)[0].classList.contains("green")) { - document.querySelector(`.${submoduleClass} .__parent.green`).className += " active"; - } + case document.getElementsByClassName(submoduleClass)[0].classList.contains("green"): + document.querySelector(`.${submoduleClass} .__parent.green`).className += " active"; + break; - if (document.getElementsByClassName(submoduleClass)[0].classList.contains("red")) { - document.querySelector(`.${submoduleClass} .__parent.red`).className += " active"; + case document.getElementsByClassName(submoduleClass)[0].classList.contains("red"): + document.querySelector(`.${submoduleClass} .__parent.red`).className += " active"; + break; + + default: + document.getElementsByClassName(submoduleClass)[0].classList.add("single"); + break; } } @@ -190,6 +196,7 @@ function resetClassesAndStorage() { n.classList.remove("green"); n.classList.remove("on"); n.classList.remove("red"); + n.classList.remove("single"); }); document.querySelectorAll(".ecosystem__module").forEach(n => n.classList.remove("active")); diff --git a/app/sass/partials/_ecosystem.scss b/app/sass/partials/_ecosystem.scss index aaded55..0bf6656 100644 --- a/app/sass/partials/_ecosystem.scss +++ b/app/sass/partials/_ecosystem.scss @@ -355,18 +355,17 @@ margin-bottom: 2rem; .__close { - top: -0.7rem; right: -2rem; + width: 1.3rem; + top: -0.7rem; left: 0; } } .__parents { - top: 2rem; right: 4rem; - font-size: 1.15rem; line-height: 1.33; list-style-type: none; - padding-right: 1rem; - position: absolute; + padding-left: 6.5rem; + position: relative; z-index: 1; &::before, @@ -376,7 +375,7 @@ &::before { @include font-serif; - top: 0.3rem; left: -3.4rem; + top: 0.3rem; left: 3rem; color: $lbry-gray-4; content: "back to"; @@ -387,11 +386,18 @@ &::after { width: 2px; height: 100%; - top: 0; right: 0; + top: 0; left: 2rem; background-color: $lbry-gray-1; content: ""; } + + .single & { + &::before, + &::after { + display: none; + } + } } .__parent {