diff options
| author | 8cy <[email protected]> | 2020-05-24 07:40:34 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-05-24 07:40:34 -0700 |
| commit | a7dc1894d3f030926a95b948bd46fa60e95b8dcb (patch) | |
| tree | aa5c1b50427f9658ea2de686ea8c2032f289a6a2 /public/js | |
| download | aghpb-online-a7dc1894d3f030926a95b948bd46fa60e95b8dcb.tar.xz aghpb-online-a7dc1894d3f030926a95b948bd46fa60e95b8dcb.zip | |
wow it actually works lol
Diffstat (limited to 'public/js')
| -rw-r--r-- | public/js/main.js | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/public/js/main.js b/public/js/main.js new file mode 100644 index 0000000..5a28206 --- /dev/null +++ b/public/js/main.js @@ -0,0 +1,62 @@ +$(document).ready(function () { + /* Every time the window is scrolled ... */ + $(window).scroll(function () { + /* Check the location of each desired element */ + $('.hideme').each(function (i) { + var bottom_of_object = $(this).position().top + $(this).outerHeight(); + var bottom_of_window = $(window).scrollTop() + $(window).height(); + + /* If the object is completely visible in the window, fade it it */ + if (bottom_of_window > bottom_of_object) { + $(this).animate({ + 'opacity': '1' + }, 500); + } + }); + }); + $('.hideme').each(function (i) { + var bottom_of_object = $(this).position().top + $(this).outerHeight(); + var bottom_of_window = $(window).scrollTop() + $(window).height(); + + /* If the object is completely visible in the window, fade it it */ + if (bottom_of_window > bottom_of_object) { + $(this).animate({ + 'opacity': '1' + }, 500); + } + if (document.getElementById("heading")) { + $(document.getElementById("heading")).animate({ + 'opacity': '1' + }, 500); + } + if (document.getElementById("title-quotes")) { + $(document.getElementById("title-quotes")).animate({ + 'opacity': '1' + }, 1500); + } + // document.getElementById("heading").animate({ + // 'opacity': '1' + // }, 500); + }); +}); + +$(window).on('keydown', function () { + if (event.keyCode == 123) + return false; + else if (event.ctrlKey && event.shiftKey && event.keyCode == 73) + return false; + else if (event.ctrlKey && event.keyCode == 73) + return false; + else if (event.ctrlKey && event.shiftKey && event.keyCode == 74) + return false; + else if (event.ctrlKey && event.keyCode == 74) + return false; +}); + +// if (window.location.hash) { +// var hash = window.location.hash; + +// $('html, body').animate({ +// scrollTop: $(hash).offset().top +// }, 1500, 'swing'); +// }
\ No newline at end of file |