alles relativ

This commit is contained in:
2023-12-27 16:08:07 +01:00
parent 82933b7f46
commit 94b352a2b2
4 changed files with 66 additions and 53 deletions

View File

@ -6,21 +6,20 @@ $(document).ready(function () {
uplabel = document.getElementById("filelabel")
upline = document.getElementById("formline")
upbtn = document.getElementById("upload")
if (upbtn != null) {upbtn.addEventListener ("click", ButtonPress)}
var height1 = $("#eins").height ();
var height2 = $("#zwei").height ();
if (height1 < 300) {height1 += 550};
console.log (height1, height2);
$("#fileselect").change(function() {
uplabel.textContent = this.files[0].name + " (Klick zum Ändern)"
changeFile ()
});
if (upbtn != null) {upbtn.addEventListener ("click", ButtonPress)}
$(window).scroll(function () {
var height1 = $("#eins").height ();
var height2 = $("#zwei").height ();
var screenheight = $("body").height();
var pos = $(this).scrollTop ();
if (stage ==1 && pos-200 >= height2) { moveBlobs ("225vh", 600, 2)}
else if (stage == 2 && pos < height2 ) { moveBlobs ("95vh", 1000, 1)}
else if (stage == 0 && pos+600 >= height1){ moveBlobs ("95vh", 1000, 1)}
else if ((stage == 1 && pos < height1-450)) { moveBlobs (0,0,0) }
if (stage == 1 && pos-(screenheight/4.5) >= height2) { moveBlobs ("225vh", "31vw", 2)}
else if (stage == 2 && pos-(screenheight/1.9) < height2 ) { moveBlobs ("95vh", "52vw", 1)}
else if (stage == 0 && pos+(screenheight/1.5) >= height1){ moveBlobs ("95vh", "52vw", 1)}
else if ((stage == 1 && pos < height1-(screenheight/2))) { moveBlobs (0,0,0) }
})
}
)
@ -58,7 +57,7 @@ function moveBlobs (t, r, to) {
setTimeout (function () {
$("#blobs").css ({
'top': t,
'right': r + 'px',
'right': r,
'animation': '',});
$("#green").css ({ 'animation': 'appear 0.4s -0.075s ease-in' })
$("#blue").css ({ 'animation': 'appear 0.4s 0s ease-in' })
@ -88,17 +87,20 @@ function changeFile (){
function ButtonPress () {
upbtn.setAttribute ('disabled', 'disabled')
uplabel.setAttribute('hidden', 'hidden')
upline.setAttribute('hidden', 'hidden')
document.body.style.cursor = "progress"
$("#fileupload").css ({
'cursor': 'not-allowed',
'animation': 'text-in-out 1s'
})
$("#formline").css ({
'animation': 'border-out 1s'
})
$("#upload").css ({
'cursor': 'not-allowed',
})
setTimeout (function () {
uplabel.setAttribute('hidden', 'hidden')
upline.setAttribute('hidden', 'hidden')
upbtn.value = "Verarbeite..."
$('#upload').css ({'padding-top': '3vw'})
}, 500)