2
0
mirror of https://github.com/offen/website.git synced 2024-12-26 06:40:21 +01:00
website/homepage/theme/static/scripts/fade.js

11 lines
292 B
JavaScript
Raw Normal View History

;(function () {
var icon = document.querySelector('body.index .icon')
if (!icon) {
return
2021-05-13 09:58:06 +02:00
}
window.addEventListener('scroll', function () {
var scrollTop = parseInt(window.document.documentElement.scrollTop, 10)
icon.style.opacity = Math.min(scrollTop / 100, 1)
})
})()