CMT3 - Opdracht9

Size
2,464 Kb
Views
8,096

How do I make an cmt3 - opdracht9?

What is a cmt3 - opdracht9? How do you make a cmt3 - opdracht9? This script and codes were developed by Karlien Huygels on 29 October 2022, Saturday.

CMT3 - Opdracht9 Previews

CMT3 - Opdracht9 - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CMT3 - Opdracht9</title> <link href="https://fonts.googleapis.com/css?family=Bangers|BenchNine" rel="stylesheet"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>EENENTWINTIGEN</h1>
<h2>Trek een kaart door te klikken, maar ga niet hoger dan 21.</h2>
<div></div>
<p id="vorig"></p>
<p id="totaal"></p>
<p id="resultaat"></p> <script src="js/index.js"></script>
</body>
</html>

CMT3 - Opdracht9 - Script Codes CSS Codes

body{ text-align: center; background-color: black;
}
div{ displday: block; margin: auto; width: 200px; height: 220px; border: 5px solid orange; border-radius: 5px; font-size: 10em; padding-top: 80px; background-color: snow; font-family: 'Bangers', cursive;
}
h1{ font-family: 'Bangers', cursive; font-size: 7em; letter-spacing: 5px; margin: 70px 0 -10px 0; color: orange;
}
h2,p{ font-family: 'BenchNine', sans-serif; font-size: 2em; color: snow;
}
p{ margin-bottom: -20px;
}
#resultaat{ font-family: 'Bangers', cursive; font-size: 3em; color: orange;
}

CMT3 - Opdracht9 - Script Codes JS Codes

var random = function (getal) { return Math.floor((Math.random() * getal)+1);
}
function main(){ var div = document.getElementsByTagName("div")[0]; var resultaat = document.getElementById("resultaat"); var vorig = document.getElementById("vorig"); var par = document.getElementById("totaal"); var i = 0; var getal = random(10).toString(); div.innerHTML = getal; vorig.innerHTML = "Vorige kaart: " + getal; div.onclick = function(){ if(getal < 10){ var getal1 = random(10).toString(); div.innerHTML = getal1; var totaal = Number(getal) + Number(getal1); console.log(totaal); par.innerHTML = "Totaal: " + totaal; i++; div.onclick = function(){ var getal2 = random(10).toString(); div.innerHTML = getal2; vorig.innerHTML = "Vorige kaart: " + getal1; totaal = Number(getal) + Number(getal1) + Number(getal2); console.log(totaal); par.innerHTML = "Totaal: " + totaal; if(totaal > 21){ resultaat.innerHTML = "loser!!!"; } else if(totaal === 21){ resultaat.innerHTML = "winner!!!"; } div.onclick = function(){ var getal3 = random(10).toString(); div.innerHTML = getal3; vorig.innerHTML = "Vorige kaart: " + getal2; totaal = Number(getal) + Number(getal1) + Number(getal2) + Number(getal3); par.innerHTML = "Totaal: " + totaal; if(totaal > 21){ resultaat.innerHTML = "loser!!!"; } else if(totaal === 21){ resultaat.innerHTML = "winner!!!"; } div.onclick = function(){ var getal4 = random(10).toString(); div.innerHTML = getal4; vorig.innerHTML = "Vorige kaart: " + getal3; totaal = Number(getal) + Number(getal1) + Number(getal2) + Number(getal3) + Number(getal4); par.innerHTML = "Totaal: " + totaal; if(totaal > 21){ resultaat.innerHTML = "loser!!!"; } else if(totaal === 21){ resultaat.innerHTML = "winner!!!"; } div.onclick = function(){ var getal5 = random(10).toString(); div.innerHTML = getal5; vorig.innerHTML = "Vorige kaart: " + getal4; totaal = Number(getal) + Number(getal1) + Number(getal2) + Number(getal3) + Number(getal4) + Number(getal5); par.innerHTML = "Totaal: " + totaal; if(totaal > 21){ resultaat.innerHTML = "loser!!!"; } else if(totaal === 21){ resultaat.innerHTML = "winner!!!"; } } } } } } }
}
window.onload = function (){ main();
}
CMT3 - Opdracht9 - Script Codes
CMT3 - Opdracht9 - Script Codes
Home Page Home
Developer Karlien Huygels
Username KarlienHuygels
Uploaded October 29, 2022
Rating 3
Size 2,464 Kb
Views 8,096
Do you need developer help for CMT3 - Opdracht9?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Karlien Huygels (KarlienHuygels) Script Codes
Create amazing love letters with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!