Adding Javascript Code
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
})
|
||||||
|
|
||||||
+32
-17
@@ -6,37 +6,52 @@
|
|||||||
<title>Javascript Grundlagen</title>
|
<title>Javascript Grundlagen</title>
|
||||||
<meta name="description" content="">
|
<meta name="description" content="">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" href="">
|
<link rel="stylesheet" href="assets/css/style.css">
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container-sm">
|
||||||
<div class="row g-3">
|
<div class="row">
|
||||||
<div class="col mb">
|
<div class="col-sm">
|
||||||
asdasd
|
<div class="input-group">
|
||||||
|
<span class="input-group-text">Text</span>
|
||||||
|
<input type="text" class="form-control" placeholder="Hello World">
|
||||||
|
<button>Text ändern</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col mb">
|
<div class="col-sm">
|
||||||
asddsa
|
<div class="input-group">
|
||||||
|
<span class="input-group-text">Schriftgröße</span>
|
||||||
|
<input type="text" class="form-control" placeholder="Hello World">
|
||||||
|
<span class="input-group-text">px</span>
|
||||||
|
<button>Schrift ändern</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col mb">
|
<div class="col-sm">
|
||||||
asdsda
|
<div class="input-group">
|
||||||
|
<span class="input-group-text">Drechung</span>
|
||||||
|
<input type="text" class="form-control" placeholder="Hello World">
|
||||||
|
<span class="input-group-text">°</span>
|
||||||
|
<button>Drehung ändern</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
<div id="webBoxSel" class="container webBox">
|
||||||
|
<span class="boxText">Das ist nur ein BeipielText</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="assets/js/manipulation.js"></script>
|
||||||
|
|
||||||
<script src="" async defer></script>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user