jeg vet ikke hva jeg har gjort haha
This commit is contained in:
parent
e1365a8c6a
commit
41d46eb5e8
3 changed files with 29 additions and 7 deletions
|
@ -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>
|
||||
|
||||
|
||||
|
||||
|
|
8
main.css
8
main.css
|
@ -0,0 +1,8 @@
|
|||
.ord{
|
||||
float: left;
|
||||
padding: 5px;
|
||||
}
|
||||
#yikes {
|
||||
|
||||
overflow: hidden;
|
||||
}
|
25
script.js
25
script.js
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue