2
0
mirror of https://github.com/offen/website.git synced 2024-11-25 18:20:28 +01:00
website/homepage/theme/static/scripts/fade.js

11 lines
292 B
JavaScript

;(function () {
var icon = document.querySelector('body.index .icon')
if (!icon) {
return
}
window.addEventListener('scroll', function () {
var scrollTop = parseInt(window.document.documentElement.scrollTop, 10)
icon.style.opacity = Math.min(scrollTop / 100, 1)
})
})()