44 lines
908 B
JavaScript
44 lines
908 B
JavaScript
const bilder = [
|
|
{
|
|
dateiname: "robot.png",
|
|
beschreibung: "Frida Kahlo painting of a robot waving goodbye",
|
|
},
|
|
{
|
|
dateiname: "meadow.png",
|
|
beschreibung:
|
|
"A photo of a wide green meadow and a clear blue sky",
|
|
},
|
|
{
|
|
dateiname: "elephant.png",
|
|
beschreibung: "A pink elephant in a small room",
|
|
},
|
|
{
|
|
dateiname: "fhdortmund.png",
|
|
beschreibung: "An expressive oil painting of FH Dortmund in summer",
|
|
},
|
|
];
|
|
|
|
function holeStartBild(num){
|
|
return bilder[num];
|
|
}
|
|
|
|
function vor(current){
|
|
var next = current + 1;
|
|
if(next >= bilder.length){
|
|
next = 0;
|
|
}
|
|
return next;
|
|
}
|
|
|
|
function zurueck(current){
|
|
var prev = current - 1;
|
|
if(prev < 0){
|
|
prev = bilder.length - 1;
|
|
}
|
|
return prev;
|
|
}
|
|
// Hier den Code ergaenzen!
|
|
module.exports.bilder = bilder;
|
|
module.exports.holeStartBild = holeStartBild;
|
|
module.exports.vor = vor;
|
|
module.exports.zurueck = zurueck; |