moved some files around
This commit is contained in:
parent
c8446d5c93
commit
7ee0c5f323
|
@ -1,3 +1,21 @@
|
|||
const square = function(x) {
|
||||
const square = function (x) {
|
||||
return x * x;
|
||||
}
|
||||
|
||||
const hummus = function (factor) {
|
||||
const ingredient = function (amount, unit, name) {
|
||||
let ingredientAmount = amount * factor;
|
||||
if (ingredientAmount > 1) {
|
||||
unit += "s";
|
||||
}
|
||||
console.log(`${ingredientAmount} ${unit} ${name}`);
|
||||
|
||||
};
|
||||
ingredient(1, "can", "chickpeas");
|
||||
ingredient(0.25, "cup", "tahini");
|
||||
ingredient(0.25, "cup", "lemon juice");
|
||||
ingredient(1, "clove", "garlic");
|
||||
ingredient(2, "tablespoon", "olive oil");
|
||||
ingredient(0.5, "teaspoon", "cumin");
|
||||
};
|
||||
hummus(10);
|
|
@ -13,9 +13,6 @@
|
|||
function start(){
|
||||
triangle += "#"
|
||||
document.getElementById('triangle').innerHTML += `<ul>${triangle}</ul>`
|
||||
if (document.getElementById('triangle').innerHTML.length() == 5) {
|
||||
console.log('Nice');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -69,11 +69,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div id="head" class="bodyPart">
|
||||
<button onclick="selectHead4()">◀</button>
|
||||
<img src="img/head1.png">
|
||||
<button onclick="selectHead2()">▶</button>
|
||||
</div>
|
||||
|
||||
<div id="body" class="bodyPart">
|
||||
<button onclick="selectBody4()">◀</button>
|
||||
<img src="img/body1.png">
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
console.log(yo, yo2);
|
||||
}
|
||||
console.log(yo);
|
||||
console.log(yo2);
|
||||
}
|
||||
testScopes();
|
||||
</script>
|
||||
|
|
|
@ -36,8 +36,8 @@
|
|||
|
||||
<body>
|
||||
<div id="page">
|
||||
<h2 id="title">Class List</h2>
|
||||
|
||||
<h2 id="title">Class</h2>
|
||||
<p>Klikk på farge for å velge, klikk på boks eller knapp for å sette fargen</p>
|
||||
<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>
|
||||
|
@ -54,35 +54,27 @@
|
|||
console.log(farge1, farge2, farge3);
|
||||
function getColor1() {
|
||||
farge = document.getElementById('farge1').className;
|
||||
console.log(farge);
|
||||
}
|
||||
function getColor2() {
|
||||
farge = document.getElementById('farge2').className;
|
||||
console.log(farge)
|
||||
console.log(farge);
|
||||
}
|
||||
function getcolor3() {
|
||||
farge = document.getElementById('farge3').className;
|
||||
console.log(farge)
|
||||
console.log(farge);
|
||||
}
|
||||
function setColor1() {
|
||||
document.getElementById('box-1').classList.add(farge);
|
||||
console.log(farge)
|
||||
console.log(farge);
|
||||
}
|
||||
function setColor2() {
|
||||
document.getElementById('box-2').classList.add(farge);
|
||||
console.log(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>
|
||||
|
Loading…
Reference in a new issue