jeg vet ikke hva jeg har gjort haha

This commit is contained in:
Rolf Martin Glomsrud 2020-01-14 13:04:21 +01:00
parent e1365a8c6a
commit 41d46eb5e8
3 changed files with 29 additions and 7 deletions

View file

@ -8,7 +8,7 @@
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
<link rel="stylesheet" href="css/styles.css?v=1.0">
<link rel="stylesheet" href="main.css">
</head>
@ -22,6 +22,7 @@
</div>
<h2>Feil:</h2>
<h2></h2>
<div id="ord"></div>

View file

@ -0,0 +1,8 @@
.ord{
float: left;
padding: 5px;
}
#yikes {
overflow: hidden;
}

View file

@ -7,10 +7,25 @@ var arrayWord = word.split("");
for(i = 0; i<arrayWord.length; i++){
var bokstav = document.createElement("P");
bokstav.setAttribute("class", "yikes");
bokstav.setAttribute("class", arrayWord[i]);
bokstav.style.visibility = "hidden";
bokstav.innerHTML = arrayWord[i];
var ordPlasement = get("ord");
ordPlasement.appendChild(bokstav);
}
function testLetter(){
stringToTest = get("myText");
string = stringToTest.value;
if(word.includes(string)){
console.log("tikes");
var show = get(string);
show.style.visibility = "visible";
}
}
var c = get("myCanvas");
var ctx = c.getContext("2d");
ctx.canvas.width = 0.25 * screenWidth;
@ -18,10 +33,7 @@ ctx.canvas.height = 0.25 * screenHeight;
ctx.moveTo(0, 0);
ctx.stroke();
function testLetter(){
stringToTest = get("myText");
console.log(stringToTest.value);
}
function draw(){
console.log(partsTracker);
if (partsTracker == 0){
@ -88,4 +100,5 @@ function draw(){
}
function get(a){
return document.getElementById(a);
}
}