Last active
May 25, 2019 05:03
-
-
Save zwily/4947417 to your computer and use it in GitHub Desktop.
Puts a big annoying arrow in your Limechat window when you're not scrolled down, like a dummy. (requires limescripts)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Puts a big annoying arrow in your window when you're not scrolled down, like a dummy | |
# | |
scrollAlert = $("<div id='scrolldown-arrow'>⬇</div>") | |
showing = false | |
body = $ document.body | |
win = $ window | |
doc = $ document | |
style = $ """ | |
<style type='text/css'> | |
@-webkit-keyframes bounce { | |
30% { | |
-webkit-transform: translateY(3%) scale(1.05, 1); | |
} | |
} | |
#scrolldown-arrow { | |
display: none; | |
position: fixed; | |
z-index: 10000; | |
bottom: -10px; | |
left: 10px; | |
font-size: 10em; | |
opacity: 0.5; | |
-webkit-animation-name: bounce; | |
-webkit-animation-duration: 1000ms; | |
-webkit-animation-iteration-count: infinite; | |
-webkit-animation-timing-function: ease-out; | |
</style> | |
""" | |
$(document.getElementsByTagName("head")[0]).append(style) | |
show = -> | |
return if showing | |
scrollAlert.appendTo(body).fadeIn() | |
showing = true | |
remove = -> | |
return unless showing | |
scrollAlert.fadeOut -> scrollAlert.remove() | |
showing = false | |
checkBottom = -> | |
atBottom = win.scrollTop() + win.height() >= doc.height() | |
if atBottom then remove() else show() | |
$(window).scroll checkBottom | |
bind 'line', checkBottom |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment