diff --git a/blob-animation.js b/animations.js similarity index 65% rename from blob-animation.js rename to animations.js index b83f9e4..17db5f0 100644 --- a/blob-animation.js +++ b/animations.js @@ -1,14 +1,17 @@ var stage = 0 $(document).ready(function () { + var up = document.getElementById("upload") + if (up != null) {up.addEventListener ("click", ButtonPress)} var height1 = $("#eins").height (); var height2 = $("#zwei").height (); + if (height1 < 300) {height1 += 550}; console.log (height1, height2); $(window).scroll(function () { var pos = $(this).scrollTop (); - if (stage ==1 && pos-200 >= height2) { console.log ( moveBlobs (2050, 600, 2))} + if (stage ==1 && pos-200 >= height2) { moveBlobs (2050, 600, 2)} else if (stage == 2 && pos < height2 ) { moveBlobs (1000, 1000, 1)} else if (stage == 0 && pos+600 >= height1){ moveBlobs (1000, 1000, 1)} - else if (stage == 1 && pos < height1-450){ moveBlobs (0,0,0) } + else if ((stage == 1 && pos < height1-450)) { moveBlobs (0,0,0) } }) } ) @@ -53,4 +56,27 @@ function moveBlobs (t, r, to) { $("#red").css ({ 'animation': '' }) stage = to; }, (dur*1000)-1) -} \ No newline at end of file +} + +function ButtonPress () { + document.body.style.cursor = "progress" + $("#upload").css ({ + 'cursor': 'not-allowed', + 'animation': 'text-in-out 1s' + }) + setTimeout (function () { + document.getElementById("upload").textContent = "Verarbeite..." + $("#upload").css ({ + 'padding-right': '140px', + 'padding-left': '139px', + 'padding-top': '80px', + 'padding-bottom': '57px', + }) + }, 500) + setTimeout (function() { + $("#upload").css ({ + 'animation': 'border-in-out 2s infinite' + }) + }, 1000) +} + diff --git a/index.html b/index.html index b069ea6..d180bca 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@