// Chipsregen console.log ("Meine Seite läuft"); function createChip() { const chip = document.createElement("img"); chip.src = "img/Chips.png"; chip.classList.add("chip"); chip.style.left = Math.random() * window.innerWidth + "px"; chip.style.animationDuration = (Math.random() * 3 + 3) + "s"; chip.style.width = (Math.random() * 50 + 50) + "px"; document.body.appendChild(chip); setTimeout(() => { chip.remove(); }, 6000); } setInterval(createChip, 300); // Notenrechner function berechneNote(prozent) { if (prozent >= 90) { return "sehr gut"; } else if (prozent >= 75) { return "gut"; } else if (prozent >= 60) { return "befriedigend"; } else if (prozent >= 50) { return "ausreichend"; } else { return "nicht bestanden"; } } function startNotenrechner() { const punkte = Number( document.getElementById("punkte").value ); const max = Number( document.getElementById("max").value ); const ausgabe = document.getElementById("ergebnis"); if (isNaN(punkte) || isNaN(max) || max <= 0) { ausgabe.textContent = "Bitte gültige Zahlen eingeben!"; return; } const prozent = Math.round((punkte / max) * 100); ausgabe.textContent = `${punkte} von ${max} Punkten (${prozent} %) = ${berechneNote(prozent)}`; }