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 @@