diff --git a/bitcoinbonds.html b/bitcoinbonds.html
index ef04b1f..c0d8ea6 100644
--- a/bitcoinbonds.html
+++ b/bitcoinbonds.html
@@ -100,49 +100,6 @@
-
-
- Performance
+
+
+
-
- Product
+
Description of different bonds
-
@@ -272,8 +233,7 @@
-
- Purchase
+
The purchase of this product is open only during specified time when we are confident we can
give guarantees. It was last open from February 2017 to June 2017.Currently we are doing blockchain
@@ -282,7 +242,7 @@
directly on that FLO ID. Please drop your name and phone number along with FLO ID.
-
+
@@ -298,12 +258,25 @@
}
renderAllSeries()
+ let tile, tileParent, tileDimensions, tileParentDimensions
+ const animeInOptions = {
+ duration: 300,
+ fill: 'forwards',
+ easing: 'ease'
+ }
+ const animeOutOption = {
+ duration: 300,
+ fill: 'forwards',
+ easing: 'ease'
+ }
+
document.addEventListener('click', e => {
if(e.target.closest('.room-tile')){
- const tile = e.target.closest('.room-tile')
- const tileParent = tile.parentNode
- const tileDimensions = tile.getBoundingClientRect()
- const tileParentDimensions = tileParent.getBoundingClientRect()
+ pauseScrolling()
+ tile = e.target.closest('.room-tile')
+ tileParent = tile.parentNode
+ tileDimensions = tile.getBoundingClientRect()
+ tileParentDimensions = tileParent.getBoundingClientRect()
getRef('expanding_tile').classList.remove('hide-completely')
getRef('expanding_tile').animate([
{
@@ -317,19 +290,46 @@
transform: `translate(${- tileParentDimensions.left}px, ${- tileParentDimensions.top - window.pageYOffset}px)`
},
],
- {
- duration: 300,
- fill: 'forwards',
- easing: 'ease'
- })
+ animeInOptions)
.onfinish = () => {
- setTimeout(() => {
+ const index = [...tileParent.querySelectorAll('.room-tile')].findIndex(elem => elem === tile)
+ const roomContainer = document.querySelector('.room-container')
+ roomContainer.querySelectorAll('.room').forEach(child => child.classList.add('hide-completely'))
+ roomContainer.children[index + 1].classList.remove('hide-completely')
+ document.querySelector('.room-title').textContent = tile.querySelector('.room-tile__title').textContent
+ roomContainer.classList.remove('hide-completely')
+ roomContainer.animate(slideInDown, animeInOptions)
+ .onfinish = () => {
getRef('expanding_tile').classList.add('hide-completely')
-
- }, 500);
+ }
}
}
})
+
+ function hideRoom(){
+ const roomContainer = document.querySelector('.room-container')
+ roomContainer.animate(fadeOut, animeOutOption)
+ .onfinish = () => {
+ roomContainer.classList.add('hide-completely')
+ }
+ getRef('expanding_tile').classList.remove('hide-completely')
+ getRef('expanding_tile').animate([
+ {
+ height: `${window.innerHeight}px`,
+ width: `${document.querySelector('main').getBoundingClientRect().width}px`,
+ transform: `translate(${- tileParentDimensions.left}px, ${- tileParentDimensions.top - window.pageYOffset}px)`
+ },
+ {
+ height: `${tileDimensions.height}px`,
+ width: `${tileDimensions.width}px`,
+ transform: `translate(${tileDimensions.left - tileParentDimensions.left}px, ${tileDimensions.top - tileParentDimensions.top - window.pageYOffset}px)`
+ },
+ ], animeOutOption)
+ .onfinish = () => {
+ getRef('expanding_tile').classList.add('hide-completely')
+ resumeScrolling()
+ }
+ }