diff --git a/assets/css/style.css b/assets/css/style.css new file mode 100644 index 0000000..c6f3277 --- /dev/null +++ b/assets/css/style.css @@ -0,0 +1,62 @@ +h1{ + border: 2px dotted; + width: 40%; +} + +#emoji{ + color: red; + font-size: 150px; +} + +main{ + position: relative; + left:160px; /* Same as the width of the sidenav */ + width:80%; + margin-left: 20px; + font-size: 28px; /* Increased text to enable scrolling */ + padding: 0px 10px; +} + +.sidenav { + height: 100%; + width: 160px; + position: fixed; + z-index: 1; + top: 0; + left: 0; + background-color: #111; + overflow-x: hidden; + padding-top: 20px; + } + +.sidenav a { + padding: 6px 8px 6px 16px; + text-decoration: none; + font-size: 25px; + color: #818181; + display: block; +} + +.sidenav a:hover { + color: #f1f1f1; +} + + + +@media screen and (max-height: 450px) { + .sidenav {padding-top: 15px;} + .sidenav a {font-size: 18px;} +} + +#circle{ /* AUFGABE C */ + width: 100px; + height: 80px; + background: rgb(237, 183, 20); + border-radius: 45%; +} + +#hotspot{ /* AUFGABE E */ + width: 160px; + height: 120px; + background-color: blue; +} \ No newline at end of file diff --git a/assets/img/1_RR6spBZYaiATXhipWdvNlg.webp b/assets/img/1_RR6spBZYaiATXhipWdvNlg.webp new file mode 100644 index 0000000..df55e24 Binary files /dev/null and b/assets/img/1_RR6spBZYaiATXhipWdvNlg.webp differ diff --git a/assets/img/pic_bulboff.gif b/assets/img/pic_bulboff.gif new file mode 100644 index 0000000..65cacdd Binary files /dev/null and b/assets/img/pic_bulboff.gif differ diff --git a/assets/img/pic_bulbon.gif b/assets/img/pic_bulbon.gif new file mode 100644 index 0000000..72ecfc4 Binary files /dev/null and b/assets/img/pic_bulbon.gif differ diff --git a/assets/java/dom.js b/assets/java/dom.js new file mode 100644 index 0000000..e04e421 --- /dev/null +++ b/assets/java/dom.js @@ -0,0 +1,26 @@ + +/* Override id("app") mit neuem Text*/ +/* + document.getElementById("app").style.color = "blue"; + document.getElementById("app").innerHTML = "Hello Dude!"; + document.getElementById("app").textContent = "Hello All!"; + document.getElementById("app").innerText = "HELL-O Monday!!"; + + document.getElementById("app2").style.color = "green"; + document.getElementById("app2").innerHTML = "Hello Dude!"; + document.getElementById("app2").textContent = "Hello All!"; + document.getElementById("app2").innerText = "HELL-O Monday!!"; */ + + + +/*Sollte emoji verändern je nach Aktion*/ +/* function mOver(){ + let emojiObject = document.getElementById("emoji"); + emojiObject.style.color = 'blue'; + emojiObject.style.fontSize = '200px'; + } + + function mOut(element){ + element.style.color = 'red'; + element.style.fontSize = '100px'; + } */ \ No newline at end of file diff --git a/assets/java/dom2.js b/assets/java/dom2.js new file mode 100644 index 0000000..d7f0851 --- /dev/null +++ b/assets/java/dom2.js @@ -0,0 +1,24 @@ +// Hello Coders - hier noch die Aufgaben, welche wir zusammen erarbeiten: +/* + a) Vorbereitung: Lege zwei Buttons jeweils mit Identifikator (id) + und Beschriftung an. + Aufgabe: Auf Mausklick gib id und Beschriftung des gewählten Buttons + in der Konsole des Browsers aus. + + b) Vorbereitung: Lege einen "JA" Button an. + Aufgabe: Auf Mausklick wechsle die Beschriftung des Buttons auf "NEIN", + wenn vorher "JA" sichtbar war - und umgekehrt (toggle). + + c) Vorbereitung: Lege einen eingefärbten Kreis (CSS Circle) und den Button + "Löschen" daneben an. + Aufgabe: Auf Mausklick lösche den Kreis. + + d) Vorbereitung: Lege einen Paragraphen mit + "

Anzahl Clicks: 0

" + und daneben einen Button mit "increment" beschriftet an. + Aufgabe: Auf Mausklick erhöhe die Zahl jeweils mit 1. + + e) Vorbereitung: Lege ein blaues
an (120px, 160px). + Aufgabe: Wechsle die Farbe des
sobald der Mauszeiger darüber fährt + und wechsle zurück, sobald der Mauszeiger das
wieder verlässt. +*/ \ No newline at end of file diff --git a/assets/java/java.js b/assets/java/java.js new file mode 100644 index 0000000..0463e66 --- /dev/null +++ b/assets/java/java.js @@ -0,0 +1,291 @@ +console.log("Hallo du schon wieder!!"); + + +/* DU EI! */ +function news(){ + let neu = 3; + var eier = "Eier"; + var du = "du Ei!!"; + document.write("

" + "Du hast" + " " + neu + " " + eier + " " + du + "

"); +}; + +/* DISTANCE TO MILES */ +function mToKm(miles){ + return miles * 1.609; +}; +mToKm(3); + +/* PIZZA ORDER */ +function getPizzaOrder(name, ingredient){ + return name + ' wants to order pizza with ' + ingredient + '.'; +}; + getPizzaOrder('Peter', 'Hawaii'); + + +/* TO UPPER CASE */ +function toUpperCase(text){ + return text.toUpperCase(); +}; + +/* CALCULATE RADIUS */ +function circumference(radius){ + return radius * 2 * Math.PI +}; + +/* NICE WEATHER */ +function weather(niceWeather){ + if (niceWeather){ + return "go for a walk"; + } + else { + return "stay at home and watch netflix"; + } +}; + +/* AGE VERIFICATION */ +function old(age){ + if (age>=18){ + return'You can sign in you Perv.'; + } + else{ + return'You must be at least 18 to sign up.' + } +} + +/* WEEK DAYS */ +function weekDays(day){ + switch (new Date()){ + case "Monday": + return"Damnit, it's Monday again🤮"; + break; + case "Tuesday": + return"Yeah! I'm awake😴😴"; + break; + case "Wednesday": + return"Almost there🪗"; + break; + case "Thursday": + return"Party Time🥳🥳🥳🥳"; + break; + case "Friday": + return"Party On🤤🤤"; + break; + case "Saturday": + return"Ooooh Yeah🥳🥳"; + break; + case "Sunday": + return"Again?!!🤮🔨"; + break; + } +} + + +/* DAILY ACTIVITIES */ +function daily(){ + let dailyActivities = ['eat', 'sleep', 'shower']; + dailyActivities.push('cook', 'clean'); + for (let i = 0; i <= 7; i++){ + document.writeln(dailyActivities[i].toUpperCase()); + }; +} + +/* WEATHER DATA */ +function logWeatherData() { + let weatherData = { + date: '2022-12-01', + temperature: 30, + humidity: 10 + }; + + document.writeln(weatherData.date + '
'); + document.writeln(weatherData.humidity + '
'); + document.writeln(weatherData['temperature']+ '
'); + + weatherData.temperature = 40; + document.writeln(weatherData['temperature'] + '
'); + + let property = 'humidity'; + weatherData[property] = 99; + document.writeln(weatherData[property]); +} + +/* FULL NAME */ +function bigName(){ + const user = { + lastName: "Grimes", + firstName: "Petra", + id: 5566, + fullName: function(){ + return this.firstName + " " + this.lastName; + } + }; +document.writeln(user.fullName()); +} + + +/* FULL */ +function divi(a){ +a = a / 2; +document.writeln(a); +} + +/* HEROES */ +function logUsers() { + const users =[ + { + lastName: "Man", + firstName: "Spider", + age: 22, + origin: "USA" + },{ + lastName: "Man", + firstName: "Iron", + age: 44, + origin: "USA" + },{ + lastName: "Man", + firstName: "Super", + age: 2, + origin: "Krypton" + },{ + lastName: "Man", + firstName: "Bat", + age: 38, + origin: "USA" + },{ + lastName: "America", + firstName: "Captain", + age: 86, + origin: "USA" + },{ + lastName: "Samurai", + firstName: "Silver", + age: 21, + origin: "Japan" + },{ + lastName: "the Untouchable", + firstName: "Unus", + age: 24, + origin: "Turkey" + },{ + lastName: "von Strucker", + firstName: "Baron", + age: 65, + origin: "Germany" + },{ + lastName: "Chi", + firstName: "Shang", + age: 42, + origin: "China" + },{ + lastName: "Burb", + firstName: "Rio", + age: 35, + origin: "Switzerland" + } +]; + + /* // VORLAGE + document.write("

TITLE

"); + document.write("
    ") + for (let i = 0; i <= users.length; i++) { //LOOP + document.write("
  • "); + document.write( + [users[i].firstName + ' ' + users[i].lastName + ', ' +users[i].age + ); + document.write("
  • "); + }; + document.write("
      ") + */ + +// a), b), c), ALL HEROES + document.write("
      A,B,C) ALL HEROES
      "); + document.write("
        "); + for (let i = 0; i < users.length; i++) { //LOOP + document.write("
      • "); + document.write( + [i] + ': ' + users[i].firstName + ' ' + users[i].lastName + ', ' +users[i].age + ', ' + users[i].origin + ); + document.write("
      • "); + } + document.write("
      "); + document.write("

      ") + +// CHALLANGE D LIST THOSE YOUNGER OR SAME AS 40 + document.write("
      D) THOSE YOUNGER OR SAME AS 40
      "); + document.write("
        "); + for (let i = 0; i < users.length; i++) { + let user = users[i]; + + if (user.age <= 40){ + document.write("
      • "); + document.write( + i + ": " + user.firstName + ' ' + user.lastName+ ', ' +user.age + ', ' + user.origin + ); + document.write("
      • "); + } + } + document.write("
      "); + document.write("

      ") + +// CHALLANGE E LIST THOSE OLDER OR SAME AS 30 + document.write("
      E) THOSE OLDER OR SAME AS 30
      "); + document.write("
        "); + for (let i = 0; i < users.length; i++) { + if (users[i].age >= 30) writeToListItem(users[i], i); + } + document.write("
      "); + document.write("

      "); + +// CHALLANGE F LIST THOSE WICH ARE FROM CH OR DE + document.write("
      F) THOSE WICH COME FROM 'CH' AND 'DE'
      "); + document.write("
        "); + for (let i = 0; i < users.length; i++) { + let user = users[i]; + if (user.origin === "Switzerland" || user.origin === "Germany") writeToListItem(user, i); + } + document.write("
      "); + +// CHALLANGE G LIST OF THOSE NOT FROM SWITZERLAND AND YOUNGER THAN 30 + document.write("
      G) THOSE NOT FROM 'CH' AND YOUNGER THAN 30
      "); + document.write("
        "); + for (let i = 0; i < users.length; i++) { + let user = users[i]; + if (user.origin !== "Switzerland" && user.age < 30) writeToListItem(user, i); + } + document.write("
      "); + + + +// CHALLANGE H A FUNCTION RECALL TO SHOW THOSE NOT FROM SWITZERLAND AND OLDER THAN 20 +function filter(users,i,older20){ + document.write("
      H) THOSE NOT FROM 'CH' AND OLDER THAN 20
      "); + document.write("
        "); + for (let i = 0; i < users.length; i++); { + let user = users[i]; + if (older20AndCH(user)) writeToListItem(user, i); + } + document.write("
      "); + } + + + +function older20AndCH(user) { // FUNCTION SWISS AND OLDER THAN 20 + return (user.origin !== "Schweiz" && user.age > 20); + } + +function writeToListItem(user, i){ // FUNCTION TO DOCUMENT.WRITE SHORTENING + document.write('
    • '); + document.write( + i + ': ' + user.firstName + ' ' + user.lastName + ', ' + user.age + ', ' + user.origin + ); + document.write('
    • '); + } + +} + + + + + +/* !== nicht gleich, && heist ...und.. */ \ No newline at end of file diff --git a/assets/java/main.js b/assets/java/main.js new file mode 100644 index 0000000..f354616 --- /dev/null +++ b/assets/java/main.js @@ -0,0 +1,61 @@ +/* Definiere alle möglichen Wertekombinationen der + Booleschen Variablen a, b und c. +*/ +let combinations = [ + [false, false, false], // tripel + [false, false, true], + [false, true, false], + [false, true, true], + [true, false, false], + [true, false, true], + [true, true, false], + [true, true, true] + ]; + + // Generate einen output string (HTML fragment) mit Titel. + let html = line("Calculate logical expression with JavaScript"); + + // Schleife (Loop) über alle Kombinationen von Booleschen Werten. + for (let i = 0; i < combinations.length; i++) { + let tripel = combinations[i]; + + // html = html + makeTestReport(...); append html to the existing html + html += makeTestReport(tripel[0], tripel[1], tripel[2]); + } + + // Schreibe den Output in das

      tag. + writeOutput(html); + + // SUPPORT FUNCTIONS ------------------------------------------------ + + function makeTestReport(a, b, c) { + // Berechne das resultat der ersten Formel ab + ¬ac + bc + // "¬" wird mit Alt Gr + 6 erzeugt - danke Chaimaa. + let result1 = (a && b) || (!a && c) || (b && c); + + // Berechne das resultat der zweiten Formel ab + ¬ac + let result2 = (a && b) || (!a && c); + + // Generate einen output string (HTML fragment). + let html = line(); // Empty line. This is the same as html = html + line(); line("Calculate logical expression with JavaScript"); + html += line(`With a = ${a}, b = ${b} and c = ${c}`); + html += line(`ab + ¬ac + bc = ${result1}`); + html += line(`ab + ¬ac = ${result2}`); + + return html; // HTML Fragment zurückgeben. + } + + function line(text) { + if (text) { + // Das argument text ist ein nicht leerer String. + return text + '
      '; + } + else return '
      '; + } + + function writeOutput(html) { + document.getElementById("output").innerHTML = html; + // Wäre auch möglich mit document.querySelector("#output") + // innerText wäre für Text ohne HTML-Tags + } + \ No newline at end of file diff --git a/dom.html b/dom.html new file mode 100644 index 0000000..8d203d0 --- /dev/null +++ b/dom.html @@ -0,0 +1,86 @@ + + + + + + + Dom + + + + + + +

      +
      + + + + + + +
      + + + +
      + + + + + + +
      + + + + + +
      +
      + + diff --git a/form.html b/form.html new file mode 100644 index 0000000..25d7c4c --- /dev/null +++ b/form.html @@ -0,0 +1,67 @@ + + + + + + + First Form Validation + + + + + +
      + +
      + diff --git a/index.html b/index.html new file mode 100644 index 0000000..ba750cb --- /dev/null +++ b/index.html @@ -0,0 +1,38 @@ + + + + + + + INDEX + + + + + + + + + +
      + +
      + +

      INDEX-PAGE

      +

      Hier ist eine Seite die einige Funktionen
      + des JavaScripts und DOM's aufzeigt.

      +

      Viel Spass

      +
      +
      + + \ No newline at end of file diff --git a/javaStart.html b/javaStart.html new file mode 100644 index 0000000..f555e65 --- /dev/null +++ b/javaStart.html @@ -0,0 +1,235 @@ + + + + + + + Java Start + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/logicalExpr.html b/logicalExpr.html new file mode 100644 index 0000000..7cd2555 --- /dev/null +++ b/logicalExpr.html @@ -0,0 +1,34 @@ + + + + + + + Logical Expressions + + + + + + + +<,> + +
+ +
+ + diff --git a/mySecondDom.html b/mySecondDom.html new file mode 100644 index 0000000..749a443 --- /dev/null +++ b/mySecondDom.html @@ -0,0 +1,162 @@ + + + + + + + My Second Dom + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + \ No newline at end of file diff --git a/validation.html b/validation.html new file mode 100644 index 0000000..dca4b2c --- /dev/null +++ b/validation.html @@ -0,0 +1,141 @@ + + + + + + + First Form Validation + + + + + + + +
+

Bitte trage deinen vollständigen Namen ein!

+ + +
+ + \ No newline at end of file