diff --git a/content/.vuepress/components/Ecosystem.vue b/content/.vuepress/components/Ecosystem.vue index 7c4baf3..22365a2 100644 --- a/content/.vuepress/components/Ecosystem.vue +++ b/content/.vuepress/components/Ecosystem.vue @@ -2,22 +2,36 @@
@@ -195,22 +209,36 @@ @@ -254,31 +282,92 @@ break; } }, + openSubmodule (ecosystemComponentClassName) { if (!document.getElementsByClassName(ecosystemComponentClassName)[0].classList.contains("on")) return; // do not activate unless submodule is `.on` - resetClasses(); + document.querySelectorAll(".ecosystem__submodule").forEach(n => { + n.classList.remove("active"); + n.classList.remove("on"); + }); + document.querySelectorAll(".ecosystem__module").forEach(n => n.classList.remove("active")); switch (true) { case (ecosystemComponentClassName === "chainquery"): + setSubmoduleConnectionTitle(ecosystemComponentClassName); + + if (document.getElementsByClassName(ecosystemComponentClassName)[0].classList.contains("green")) { + document.querySelector(`.${ecosystemComponentClassName} .__connection-details`).innerHTML = ` + ${ecosystemComponentClassName} is an application built on top of LBRY. + `; + } + + if (document.getElementsByClassName(ecosystemComponentClassName)[0].classList.contains("red")) { + document.querySelector(`.${ecosystemComponentClassName} .__connection-details`).innerHTML = ` + ${ecosystemComponentClassName} is an application built on top of the LBRY blockchain. + `; + } + document.getElementsByClassName("ecosystem")[0].className += " expand-left"; - document.getElementsByClassName("chainquery")[0].className += " active"; + document.getElementsByClassName(ecosystemComponentClassName)[0].className += " active"; break; + + case (ecosystemComponentClassName === "wallet"): + setSubmoduleConnectionTitle(ecosystemComponentClassName); + + if (document.getElementsByClassName(ecosystemComponentClassName)[0].classList.contains("blue")) { + document.querySelector(`.${ecosystemComponentClassName} .__connection-details`).innerHTML = ` + ${ecosystemComponentClassName} is an application built on top of the LBRY data network. + `; + } + + if (document.getElementsByClassName(ecosystemComponentClassName)[0].classList.contains("red")) { + document.querySelector(`.${ecosystemComponentClassName} .__connection-details`).innerHTML = ` + ${ecosystemComponentClassName} is an application built on top of the LBRY blockchain. + `; + } + document.getElementsByClassName("ecosystem")[0].className += " expand-left"; - document.getElementsByClassName("wallet")[0].className += " active"; + document.getElementsByClassName(ecosystemComponentClassName)[0].className += " active"; break; + + case (ecosystemComponentClassName === "lighthouse"): + setSubmoduleConnectionTitle(ecosystemComponentClassName); + + if (document.getElementsByClassName(ecosystemComponentClassName)[0].classList.contains("green")) { + document.querySelector(`.${ecosystemComponentClassName} .__connection-details`).innerHTML = ` + ${ecosystemComponentClassName} is an application built on top of LBRY. + `; + } + + if (document.getElementsByClassName(ecosystemComponentClassName)[0].classList.contains("red")) { + document.querySelector(`.${ecosystemComponentClassName} .__connection-details`).innerHTML = ` + ${ecosystemComponentClassName} is an application built on top of the LBRY blockchain. + `; + } + document.getElementsByClassName("ecosystem")[0].className += " expand-right"; - document.getElementsByClassName("lighthouse")[0].className += " active"; + document.getElementsByClassName(ecosystemComponentClassName)[0].className += " active"; break; + + case (ecosystemComponentClassName === "reflector"): + setSubmoduleConnectionTitle(ecosystemComponentClassName); + + if (document.getElementsByClassName(ecosystemComponentClassName)[0].classList.contains("blue")) { + document.querySelector(`.${ecosystemComponentClassName} .__connection-details`).innerHTML = ` + ${ecosystemComponentClassName} is an application built on top of the LBRY data network. + `; + } + document.getElementsByClassName("ecosystem")[0].className += " expand-right"; - document.getElementsByClassName("reflector")[0].className += " active"; + document.getElementsByClassName(ecosystemComponentClassName)[0].className += " active"; break; @@ -287,6 +376,7 @@ break; } }, + close () { resetClasses(); document.querySelectorAll(".ecosystem__module").forEach(n => n.classList.remove("active")); @@ -296,6 +386,20 @@ + function setSubmoduleConnectionTitle(submoduleClass) { + if (document.getElementsByClassName(submoduleClass)[0].classList.contains("blue")) { + document.querySelector(`.${submoduleClass} .__connection`).innerHTML = "Connection to Data Network"; + } + + if (document.getElementsByClassName(submoduleClass)[0].classList.contains("green")) { + document.querySelector(`.${submoduleClass} .__connection`).innerHTML = "Connection to Applications"; + } + + if (document.getElementsByClassName(submoduleClass)[0].classList.contains("red")) { + document.querySelector(`.${submoduleClass} .__connection`).innerHTML = "Connection to Blockchain"; + } + } + function resetClasses() { document.querySelectorAll(".ecosystem__submodule").forEach(n => { n.classList.remove("active"); @@ -350,9 +454,6 @@ - .ecosystem__modules { - } - .ecosystem__module { position: relative; width: 100%; @@ -485,23 +586,15 @@ &.lbrycrd { margin-bottom: 1rem; - &:not(.active) { - &::before { - background-color: $red; - } + &:not(.active)::before { + background-color: $red; } - &.active { - &::before { - border: 2px solid $red; - } + &.active::before { + border: 2px solid $red; } } - &.lbry, - &.applications { - } - &.lbry { margin-bottom: 1rem; @@ -526,10 +619,8 @@ } } - &.active { - &::before { - border: 2px solid $blue; - } + &.active::before { + border: 2px solid $blue; } } @@ -554,10 +645,8 @@ } } - &.active { - &::before { - border: 2px solid $green; - } + &.active::before { + border: 2px solid $green; } } } @@ -604,39 +693,28 @@ } &.active { - width: 100%; height: 100%; + width: 100%; height: 100%; max-height: 383px; + border-style: solid; + overflow-y: auto; + padding: 2rem; + + .ecosystem__submodule__title { + margin-bottom: 1rem; + } } /* - &:not(:hover) { - .ecosystem__submodule__description { - opacity: 0; - visibility: hidden; - } - } - */ - - h3 { - text-align: center; - } - &.chainquery, &.wallet { - .ecosystem__submodule__description { - left: -2px; - } } &.lighthouse, &.reflector { - .ecosystem__submodule__description { - right: -2px; - } } + */ &:not(.blue):not(.green):not(.red) { - // border-style: dashed; border-color: rgba($gray, 0.3); } @@ -649,29 +727,33 @@ } &.blue { - // background-color: rgba($blue, 0.3); + background-color: rgba($blue, 0.025); border-color: $blue; } &.green { - // background-color: rgba($green, 0.3); + background-color: rgba($green, 0.025); border-color: $green; } &.red { - // background-color: rgba($red, 0.3); + background-color: rgba($red, 0.025); border-color: $red; } } + .ecosystem__submodule__title { + text-align: center; + } + .ecosystem__submodule__description { - // background-color: $white; - // border: 2px solid rgba($gray, 0.3); - // color: $black; - // padding: 1rem; - // position: absolute; - // transition: all 0.2s; - // width: 350px; + margin-bottom: 2rem; + } + + .ecosystem__submodule__description__title { + color: rgba($black, 0.3); + letter-spacing: 0.1rem; + text-transform: uppercase; } diff --git a/content/.vuepress/scss/pages/_page.scss b/content/.vuepress/scss/pages/_page.scss index bd4ce8b..74afcb6 100644 --- a/content/.vuepress/scss/pages/_page.scss +++ b/content/.vuepress/scss/pages/_page.scss @@ -82,7 +82,7 @@ } } - h3:not(.__title) { + h3:not(.ecosystem__submodule__title) { @media (min-width: 901px) { font-size: 1.5rem; } @@ -96,7 +96,7 @@ } } - h4 { + h4:not(.ecosystem__submodule__description__title) { letter-spacing: 0.05rem; text-transform: uppercase;