moved some files around

This commit is contained in:
Geir Okkenhaug Jerstad 2024-08-19 14:41:28 +02:00
parent c8446d5c93
commit 7ee0c5f323
6 changed files with 29 additions and 25 deletions

View file

@ -1,89 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bytting av bakgrunnsfarge på nettleser</title>
<style>
div.bg {
width: 100px;
height: 20px;
border: solid black 1px;
}
.page {
padding: 0;
}
.green-bg {
background: green;
}
.red-bg {
background: red;
}
.blue-bg {
background: blue;
}
.white-text {
color: white;
}
</style>
</head>
<body>
<div id="page">
<h2 id="title">Class List</h2>
<div id="farge1" class="green-bg" onclick="getColor1()">farge1</div>
<div id="farge2" class="blue-bg" onclick="getColor2()">farge2</div>
<div id="farge3" class="red-bg" onclick="getcolor3()">farge3</div>
<button onclick="changeBgColor()">Forandre hele bakgrunnen</button>
<div id="box-1" class="bg" onclick="setColor1()"></div>
<div id="box-2" class="bg" onclick="setColor2()"></div>
</div>
<script>
//let bgColor = document.getElementsByClassName();
var farge;
console.log(farge1, farge2, farge3);
function getColor1() {
farge = document.getElementById('farge1').className;
}
function getColor2() {
farge = document.getElementById('farge2').className;
console.log(farge)
}
function getcolor3() {
farge = document.getElementById('farge3').className;
console.log(farge)
}
function setColor1() {
document.getElementById('box-1').classList.add(farge);
console.log(farge)
}
function setColor2() {
document.getElementById('box-2').classList.add(farge);
console.log(farge)
}
function changeBgColor() {
document.getElementById('page').classList.add(farge);
}
// paragraph.classList.add('bold', 'red-bg', 'big-font');
// paragraph.classList.remove('bold');
// paragraph.classList.replace('big-font', 'white-text');
// paragraph.classList.toggle('red-bg');
// paragraph.classList.toggle('red-bg');
// console.log(paragraph.classList.contains('red-bg'));
// console.log(paragraph.classList);
</script>
</body>
</html>

View file

@ -1,39 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="page">
<div id="header">Stoppeklokke</div>
<div id="buttons">
<button onclick="myTimer()">Start</button>
<button onclick="stopTimer()">Stopp</button>
<button onclick="resetTimer()">Rundetid</button>
</div>
<div id="time"></div><br>
<div id="round"></div><br>
</div>
<script>
let time = 1;
function myTimer() {
setInterval(counter,1000)
}
function counter() {
document.getElementById('time').innerHTML = time;
++time;
}
function resetTimer() {
document.getElementById('round').innerHTML += `<li>${time -1} sekunder</li`;
clearInterval(time)
time = 0;
}
function stopTimer(){
location.reload();
}
</script>
</body>
</html>

View file

@ -17,6 +17,7 @@
console.log(yo, yo2);
}
console.log(yo);
console.log(yo2);
}
testScopes();
</script>