diff --git a/static/css/main.css b/static/css/main.css index 600c2a2..b2a2b91 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -94,6 +94,7 @@ a { color: #d75b00; } + a:hover { text-decoration: underline; cursor: pointer; diff --git a/static/index.html b/static/index.html index 3de7555..42baa1a 100644 --- a/static/index.html +++ b/static/index.html @@ -22,7 +22,7 @@
@@ -51,10 +51,24 @@
+ + +
+ + + diff --git a/static/js/anim.js b/static/js/anim.js index f7f7610..31670c1 100644 --- a/static/js/anim.js +++ b/static/js/anim.js @@ -1,3 +1,31 @@ +var $animation_elements = $("#prank-desc, #activite-desc, #chasse-desc"); +var $window = $(window) + +function check_if_in_view() { + var window_height = $window.height(); + var window_top_position = $window.scrollTop(); + var window_bottom_position = (window_top_position + window_height); + + $.each($animation_elements, function() { + var $element = $(this); + var element_height = $element.outerHeight(); + var element_top_position = $element.offset().top; + var element_bottom_position = (element_top_position + element_height); + + //check to see if this current container is within viewport + if ((element_bottom_position >= window_top_position) && + (element_top_position <= window_bottom_position)) { + if(!$element.hasClass('animated')) { + $element.addClass('animated'); + new TypeIt('#' + $element.attr('id'), { + speed: 30, + }) + .go(); + } + } + }); + } + $(window).on("load", function() { /*let type = new TypeIt("#typed-data", { @@ -10,7 +38,8 @@ $(window).on("load", function() { $(document).on("click", function() { type.options({speed: 1}); });*/ - -}); + $(window).on("scroll resize", check_if_in_view); + $(window).trigger("scroll"); -$("#prank-button").hover(function () { $('.hover-circle').fadeIn(100) }, function(){ $('.hover-circle').fadeOut(100) }); \ No newline at end of file + $("#prank-button").hover(function () { $('.hover-circle').fadeIn(100) }, function(){ $('.hover-circle').fadeOut(100) }); +}); \ No newline at end of file diff --git a/static/js/main.js b/static/js/main.js index 83cb7bf..ce0de74 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -18,6 +18,10 @@ $(window).on("load", function() { t[1] = 0; t[2] = 0; } - $("#timer").text(t.join(":")); + $("#timer").text((new Date('December 17, 1995 ' + t.join(':'))).toLocaleTimeString('default', { + hour: '2-digit', + minute: '2-digit', + second: '2-digit' + })); }, 1000); }); \ No newline at end of file