diff --git a/bitcoinbonds.html b/bitcoinbonds.html
index dcf5e22..67484b6 100644
--- a/bitcoinbonds.html
+++ b/bitcoinbonds.html
@@ -78,13 +78,8 @@
-
-
- A Bitcoin Bond is an investment package whereby the investor
-
-
-
Bondholders get a minimum guarantee of 13% interest per annum during the lock-in period or 50% of all Bitcoin price gains whichever is higher.
It offers full capital protection if Bitcoin prices fall below acquisition price.
@@ -115,9 +110,10 @@
+
Current value
-
+
@@ -831,8 +836,8 @@ const animeOutOption = {
}
window.addEventListener('hashchange', e => {
- showRoom(window.location.hash, true)
if (allRooms.length) {
+ showRoom(window.location.hash, true)
renderRoomShorcuts()
}
})
@@ -872,15 +877,19 @@ function showRoom(roomId, animate = false) {
const roomContainer = document.querySelector('.room-container')
roomContainer.querySelectorAll('.room').forEach(child => child.classList.add('hide-completely'))
document.querySelector(roomId).classList.remove('hide-completely')
- document.querySelector('.room-title').textContent = tile.querySelector('.room-tile__title').textContent
+ getRef('room_title').textContent = tile.querySelector('.room-tile__title').textContent
+ getRef('hero_title').textContent = tile.querySelector('.room-tile__title').textContent
roomContainer.classList.remove('hide-completely')
if (animate && !isRoomOpen) {
roomContainer.animate(slideInDown, animeInOptions)
.onfinish = () => {
getRef('expanding_tile').classList.add('hide-completely')
+ isRoomOpen = true
}
}
- isRoomOpen = true
+ else {
+ isRoomOpen = true
+ }
}
}
@@ -929,4 +938,30 @@ function renderRoomShorcuts() {
if (allRooms.length) {
renderRoomShorcuts()
+}
+
+const heroTitleObserver = new IntersectionObserver(entries => {
+ entries.forEach(entry => {
+ if (entry.isIntersecting) {
+ getRef('room_title').animate(slideOutDown, animeInOptions)
+ .onfinish = () => {
+ getRef('room_title').classList.add('hide-completely')
+ }
+ // getRef('hero_title').animate(slideInDown, animeOutOption)
+ }
+ else {
+ if (isRoomOpen)
+ getRef('room_title').classList.remove('hide-completely')
+ getRef('room_title').animate(slideInUp, animeInOptions)
+ // getRef('hero_title').animate(slideOutDown, animeOutOption)
+ }
+ })
+},
+ {
+ threshold: 1
+ }
+)
+
+if (getRef('hero_title')) {
+ heroTitleObserver.observe(getRef('hero_title'))
}
\ No newline at end of file