From aa333094e00b99183b08ae58f90a3f36294614bf Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 23 Sep 2026 17:11:32 +0200 Subject: [PATCH] Adding Javascript Code --- JavaScript/assets/css/style.css | 25 +++++++++++++ JavaScript/assets/js/manipulation.js | 36 +++++++++++++++++++ JavaScript/index.html | 53 ++++++++++++++++++---------- 3 files changed, 95 insertions(+), 19 deletions(-) create mode 100644 JavaScript/assets/css/style.css create mode 100644 JavaScript/assets/js/manipulation.js diff --git a/JavaScript/assets/css/style.css b/JavaScript/assets/css/style.css new file mode 100644 index 0000000..603d627 --- /dev/null +++ b/JavaScript/assets/css/style.css @@ -0,0 +1,25 @@ +button { + width: 100%; + padding: 10px; + margin: 8px ; + background-color: darkcyan; + color: white; + border: none; + border-radius: 4px; + cursor: pointer; +} + +input{ + width: 100%; +} + + +.webBox{ + text-align: center; +} + +.boxText{ + display:block; + float:left; + padding:5px 10px +} \ No newline at end of file diff --git a/JavaScript/assets/js/manipulation.js b/JavaScript/assets/js/manipulation.js new file mode 100644 index 0000000..f82ef94 --- /dev/null +++ b/JavaScript/assets/js/manipulation.js @@ -0,0 +1,36 @@ +function setSize(varWidth, varHeight){ + var box = document.getElementById("webBoxSel"); + var boxHeight = (varHeight / 2); + var boxwidth = (varWidth / 2); + + if(boxHeight >= 300) + { + box.style.backgroundColor = 'red'; + }else{ + box.style.backgroundColor = 'yellow'; + } + + box.style.width = boxwidth+'px'; + box.style.height = boxHeight+'px'; + + var textInBox = document.getElementById("boxText"); + + textInBox.style.color = 'blue'; + textInBox.style.margin = '25%'; + textInBox.style.marginLeft = '25%'; + +} + +if(document.readyState === "loading"){ + const varW = window.outerWidth; + const varH = window.outerHeight; + setSize(varW, varH); +} + +window.addEventListener("resize", function (){ + + const varW = window.outerWidth; + const varH = window.outerHeight; + setSize(varW, varH); +}) + diff --git a/JavaScript/index.html b/JavaScript/index.html index bb1c950..ea7f7a9 100644 --- a/JavaScript/index.html +++ b/JavaScript/index.html @@ -6,37 +6,52 @@ Javascript Grundlagen - + -
-
-
- asdasd +
+
+
+
+ Text + + +
-
- asddsa +
+
+ Schriftgröße + + px + +
-
- asdsda +
+
+ Drechung + + ° + +
- -
+ + +
+ Das ist nur ein BeipielText - - - - +
+
- - - - + + \ No newline at end of file