1
0
mirror of https://github.com/bigchaindb/site.git synced 2024-11-22 01:36:55 +01:00

more bio tweaks

This commit is contained in:
Matthias Kretschmann 2017-08-23 00:33:46 +02:00
parent 79c74e363f
commit 959d2c51f3
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 54 additions and 0 deletions

View File

@ -6,13 +6,60 @@ document.addEventListener('DOMContentLoaded', function() {
trigger.addEventListener('click', function(e) {
for (var i = 0; i < bio.length; ++i) {
var item = bio[i]
if (item.style.display == 'block') {
item.style.display = 'none'
trigger.innerHTML = '<span>+</span>Show bios'
hide(item)
} else {
item.style.display = 'block'
trigger.innerHTML = '<span></span>Hide bios'
show(item)
}
}
})
})
function show(ele) {
raf = window.requestAnimationFrame(function() {
var opacity = 0
var height = 0
function increase () {
opacity += 0.1
height += 1
if (opacity >= 1) {
// complete
ele.style.opacity = 1
ele.style.height = '100%'
return true
}
ele.style.opacity = opacity
ele.style.height = height + '%'
requestAnimationFrame(increase)
}
increase()
});
}
function hide(ele) {
raf = window.requestAnimationFrame(function() {
var opacity = 1
var height = '100%'
function decrease () {
opacity += 0.1
height += 1
if (opacity >= 1) {
// complete
ele.style.opacity = 0
ele.style.height = 0
return true
}
ele.style.opacity = opacity
ele.style.height = height + '%'
requestAnimationFrame(decrease)
}
decrease()
})
}

View File

@ -69,6 +69,13 @@
margin-bottom: 0;
margin-top: $spacer;
display: none;
opacity: 0;
height: 0;
transition: .4s ease-out;
p:last-child {
margin-bottom: 0;
}
}
.team__bio__trigger {