-
-
- Bob's Fund
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Harum cumque aut illum soluta. Inventore nihil quisquam harum quo mollitia sunt!
-
- Rooms
-
-
-
-
-
-
-
-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque, modi.
-
-
-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quasi facere officiis eius iusto quibusdam tenetur illo blanditiis asperiores et corporis!
-
-
-
-
-
-
-
- ICO
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Harum cumque aut illum soluta. Inventore nihil quisquam harum quo mollitia sunt!
-
- Rooms
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -659,19 +572,6 @@
},
]
- const icoPhases = [
- {
- phase: 1,
- date: 'Aug 17',
- info: ''
- },
- {
- phase: 2,
- date: 'Oct 17',
- info: ''
- }
- ]
-
function renderAllSeries(){
const frag = document.createDocumentFragment()
getRef('bit_bond_series__container').innerHTML = ''
@@ -689,29 +589,16 @@
getRef('bob_fund_investors__container').append(frag)
}
function renderAllIcoInvestors(){
- const frag1 = document.createDocumentFragment()
- const frag2 = document.createDocumentFragment()
- getRef('ico_investors__container').innerHTML = ''
- getRef('ico_page__carousel').innerHTML = ''
- icoInvestors.forEach(investor => {
- frag1.append(render.icoInvestorRow(investor, {thumbnail: true}))
- frag2.append(render.icoInvestorRow(investor, {thumbnail: false}))
- })
- getRef('ico_investors__container').append(frag1)
- getRef('ico_page__carousel').append(frag2)
- }
- function renderAllIcoPhases(){
- getRef('ico_phase_list').innerHTML = ''
const frag = document.createDocumentFragment()
- icoPhases.forEach(phase => {
- frag.append(render.icoPhase(phase))
+ getRef('ico_investors__container').innerHTML = ''
+ icoInvestors.forEach(investor => {
+ frag.append(render.icoInvestorRow(investor, {thumbnail: true}))
})
- getRef('ico_phase_list').append(frag)
+ getRef('ico_investors__container').append(frag)
}
+ renderAllIcoInvestors()
renderAllSeries()
renderAllFundInvestors()
- renderAllIcoInvestors()
- renderAllIcoPhases()
document.addEventListener('click', e => {
diff --git a/index.js b/index.js
index d8e1d1e..1042e55 100644
--- a/index.js
+++ b/index.js
@@ -233,15 +233,15 @@ const siteMap = [
floor: "Current Products",
outlets: [
{
- name: "bitcoin bonds",
+ name: "Bitcoin Bonds",
url: "bitcoinbonds",
},
{
- name: `bob's fund`,
+ name: `Bob's Fund`,
url: `bob'sfund`,
},
{
- name: "ico",
+ name: "ICO",
url: "ico",
},
],
@@ -307,7 +307,7 @@ const siteMap = [
url: "blockchaincloud",
},
{
- name: `Upi On Blockchain`,
+ name: `UPI On Blockchain`,
url: `upionblockchain`,
},
{
@@ -431,6 +431,17 @@ const render = {
li.querySelector('.outlet-list').append(frag)
return li
+ },
+ outletSwitcherButton(outletObj, activeOutlet) {
+ const { name, url} = outletObj
+ const button = document.createElement('a')
+ button.classList.add('outlet_switcher__button')
+ if (activeOutlet === url) {
+ button.classList.add('outlet_switcher__button--active')
+ }
+ button.href = url
+ button.textContent = name
+ return button;
}
};
@@ -641,9 +652,26 @@ function renderSiteMap() {
const frag = document.createDocumentFragment()
siteMap.forEach(floor => frag.append(render.floorListitem(floor)))
getRef('floor_list').append(frag)
+ const pathArray = location.pathname.split('/')
+ for (floor of siteMap) {
+ for (outlet of floor.outlets) {
+ if (pathArray[pathArray.length - 1].indexOf(outlet.url) > -1) {
+ renderFloorOutlets(floor, outlet.url)
+ break;
+ }
+ }
+ }
}
renderSiteMap()
+function renderFloorOutlets(floorObj, activeOutlet) {
+ const { floor, outlets } = floorObj
+ const frag = document.createDocumentFragment()
+ outlets.forEach(outlet => frag.append(render.outletSwitcherButton(outlet, activeOutlet)))
+ getRef('outlet_switcher__outlet_container').append(frag)
+ getRef('outlet_switcher__floor_num').textContent = floor
+}
+
let isSiteMapOpen = false;
const animeOptions = {
@@ -687,3 +715,4 @@ function resumeScrolling() {
isSiteMapOpen = false;
getRef("elevator_popup").classList.add("hide-completely");
}
+