From fe0b5a944b509c7e33b3311e323a5c58e6342371 Mon Sep 17 00:00:00 2001 From: Geir Okkenhaug Jerstad Date: Thu, 15 Aug 2024 14:38:20 +0200 Subject: [PATCH] javascript og lit css --- eloquentjavascript/script.js | 37 ++++++++- intro_html/css.html | 19 ++++- intro_js/betale.html | 49 +++++++++++ intro_js/index.html | 29 +++++++ team/variabler/script.js => intro_js/intro.js | 0 prosjekt/index.html | 42 ++++++---- team/variabler/healthMana.html | 83 ------------------- team/variabler/style.css | 0 8 files changed, 156 insertions(+), 103 deletions(-) create mode 100644 intro_js/betale.html create mode 100644 intro_js/index.html rename team/variabler/script.js => intro_js/intro.js (100%) delete mode 100644 team/variabler/healthMana.html delete mode 100644 team/variabler/style.css diff --git a/eloquentjavascript/script.js b/eloquentjavascript/script.js index 79a6fef..8878af5 100644 --- a/eloquentjavascript/script.js +++ b/eloquentjavascript/script.js @@ -2,4 +2,39 @@ let number = 0; while (number <= 12) { console.log(number); number = number + 2; -} \ No newline at end of file +} + + +let result = 1; +let counter = 0; +while (counter < 10) { + result = result * 2; + counter = counter + 1; +} +console.log(result); + +for (let number = 0; number <= 12; number = number +2){ + console.log(number); + ; +} + +for (let current = 20; ;current = current +1){ + if (current % 7 == 0){ + console.log(current); + break; + } +} + +switch (prompt("What is the weather like?")) { + case "rainy": + console.log("Remember to bring an umbrella."); + break; + case "sunny": + console.log("Dress lightly."); + case "cloudy": + console.log("Go outside."); + break; + default: + console.log("Unknown weather type!"); + break; + } diff --git a/intro_html/css.html b/intro_html/css.html index 2b07a4b..455c1ad 100644 --- a/intro_html/css.html +++ b/intro_html/css.html @@ -13,7 +13,12 @@ div.page{ height: 100vh; display: grid; - grid-template-areas: "header header """""; + grid-template-columns: 1fr 4fr; + grid-template-rows: 20px 10fr 20px; + grid-template-areas: + 'menu header' + 'menu mainContent' + 'menu footer'; ; } div.header { background-color: aquamarine; @@ -34,6 +39,18 @@ background-color: crimson; grid-area: footer; } + @media only screen and (max-width: 400px) { + div.page { + grid-template-columns: 1fr; + grid-template-rows: 20px 1fr 4fr 20px; + grid-template-areas: + 'header' + 'menu' + 'mainContent' + 'footer'; + } + + } diff --git a/intro_js/betale.html b/intro_js/betale.html new file mode 100644 index 0000000..3a93b56 --- /dev/null +++ b/intro_js/betale.html @@ -0,0 +1,49 @@ + + + + + + + JS intro variable opertaor og parametre + + + + + Per har betalt:
+ Paal har betalt:
+ Espen har betalt:
+ + +
+ + + + + \ No newline at end of file diff --git a/intro_js/index.html b/intro_js/index.html new file mode 100644 index 0000000..5c86b22 --- /dev/null +++ b/intro_js/index.html @@ -0,0 +1,29 @@ + + + + + + + Document + + + +
+
+ + + + \ No newline at end of file diff --git a/team/variabler/script.js b/intro_js/intro.js similarity index 100% rename from team/variabler/script.js rename to intro_js/intro.js diff --git a/prosjekt/index.html b/prosjekt/index.html index 513f4f7..3dbbedb 100644 --- a/prosjekt/index.html +++ b/prosjekt/index.html @@ -7,35 +7,41 @@ Super cool project for homelabers -
- +
+
Header
+ +
MainContent
+
diff --git a/team/variabler/healthMana.html b/team/variabler/healthMana.html deleted file mode 100644 index d0d56ec..0000000 --- a/team/variabler/healthMana.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - Health og Mana - - - -
Add or delete potions from inventory
-
- - - - -
-
-
-
Inventory
-
-
- -
-
- - - \ No newline at end of file diff --git a/team/variabler/style.css b/team/variabler/style.css deleted file mode 100644 index e69de29..0000000