neu
This commit is contained in:
parent
a19539ae57
commit
5cb687f97b
@ -19,6 +19,10 @@ body{
|
|||||||
#tom{
|
#tom{
|
||||||
position: fixed;
|
position: fixed;
|
||||||
}
|
}
|
||||||
|
#fuchs {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 1px;
|
||||||
|
}
|
||||||
#fuchs img{
|
#fuchs img{
|
||||||
width: 200px;
|
width: 200px;
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -36,10 +40,10 @@ body{
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
#rechnungen{
|
#rechnungen{
|
||||||
padding: 25px;
|
padding: 0px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 100px;
|
top: 1px;
|
||||||
}
|
}
|
||||||
#rechnung1, #rechnung2 {
|
#rechnung1, #rechnung2 {
|
||||||
width: 20%;
|
width: 20%;
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<Script src="js/Kevin.js"></Script>
|
||||||
<Script src="js/funktionen.js"></Script>
|
<Script src="js/funktionen.js"></Script>
|
||||||
<Script src="js/allg.js"></Script>
|
<Script src="js/allg.js"></Script>
|
||||||
|
|
||||||
|
30
js/Kevin.js
30
js/Kevin.js
@ -0,0 +1,30 @@
|
|||||||
|
const rechnungen = document.querySelector("#rechnungen");
|
||||||
|
let rechnungenTop = 1;
|
||||||
|
|
||||||
|
const rechenzeichen = ['+','-','*',':'];
|
||||||
|
const rechnung1Text = document.querySelector("#rechnung1");
|
||||||
|
const rechnung2Text = document.querySelector("#rechnung2");
|
||||||
|
|
||||||
|
rechnungen.style.top = rechnungenTop + "px";
|
||||||
|
function rechnungMoven(speed){
|
||||||
|
let nextTop = rechnungenTop + 10 * speed;
|
||||||
|
rechnungen.style.top = nextTop + "px";
|
||||||
|
if(nextTop > 800){
|
||||||
|
rechnungen.style.top = "1px";
|
||||||
|
rechnungenTop = 1;
|
||||||
|
rechnungenSpawn();
|
||||||
|
}else{
|
||||||
|
rechnungenTop = nextTop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function rechnungenSpawn(){
|
||||||
|
let index = Math.random()*rechenzeichen.length;
|
||||||
|
let randomZahl = Math.random()*20;
|
||||||
|
rechnung1Text.innerText = rechenzeichen[index] + randomZahl;
|
||||||
|
index = Math.random()*rechenzeichen.length;
|
||||||
|
randomZahl = Math.random()*20;
|
||||||
|
rechnung2Text.innerText = rechenzeichen[index] + randomZahl;
|
||||||
|
}
|
||||||
|
setInterval(()=>{
|
||||||
|
rechnungMoven(1);
|
||||||
|
}, 100);
|
@ -16,7 +16,7 @@ function addToScore(currentScore,zahl,rechenOperator){
|
|||||||
if(rechenOperator == "Mal"){
|
if(rechenOperator == "Mal"){
|
||||||
ergebnis = currentScore * zahl;
|
ergebnis = currentScore * zahl;
|
||||||
}
|
}
|
||||||
if(rechenOperator == "geteilt"){
|
if(rechenOperator == "Geteilt"){
|
||||||
ergebnis = currentScore / zahl;
|
ergebnis = currentScore / zahl;
|
||||||
}
|
}
|
||||||
return ergebnis;
|
return ergebnis;
|
||||||
|
Loading…
Reference in New Issue
Block a user