24.09.2026

This commit is contained in:
2026-09-24 16:39:31 +02:00
parent 50c6868dfe
commit 72df5857cb
7 changed files with 274 additions and 47 deletions
+5 -26
View File
@@ -13,38 +13,17 @@
<input type="text" name="userName" id="username" placeholder="Jonny">
<br><br>
<label for="password">Passwort</label>
<input type="password" id="togglePasswordBtn" name="passWord" placeholder="Password"><br><br>
<div>
<input type="password" id="togglePasswordBtn" class="passField" name="passWord" placeholder="Password">
<button class="icon"> 👁 </button><br><br>
</div>
<button id="togglePasswordBtn" onclick="togglePassword()">Passwort anzeigen/ausblenden</button><br>
<button id="togglePasswordBtn2">Passwort anzeigen/ausblenden</button>
</div>
<script>
function togglePassword(){
var passwordField = document.getElementById("togglePasswordBtn");
if(passwordField.type === 'password'){
passwordField.type = 'text';
}
else if(passwordField.type === 'text'){
passwordField.type = 'password';
}
}
document.getElementById('togglePasswordBtn2').addEventListener('click', function() {
var passwordField2 = document.getElementById("togglePasswordBtn");
if(passwordField2.type === 'password'){
passwordField2.type = 'text';
}
else if(passwordField2.type === 'text'){
passwordField2.type = 'password';
}
});
</script>
<script src="assets/js/scripts.js"></script>
</body>
</html>
+32
View File
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="#">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<script>
function test(para1, para2){
document.write("Parameter 1 ist imt dem Wert: " + para1 + "<br />");
document.write("Parameter 2 ist imt dem Wert: " + para2 + "<br />");
for(var i = 2; i < arguments.length; i++)
{
document.write("Zusätzliche Paramter " + (i -1) + " mit dem Wert: " + arguments[i] + "<br />");
}
}
test(10,11,12,13,15,16,17,18,19,20);
</script>
</body>
</html>
+25 -1
View File
@@ -10,7 +10,7 @@ body {
border-radius: 8px;
background-color: #f9f9f9;
}
input[type="text"], input[type="password"] {
input[type="text"] {
width: 100%;
padding: 10px;
margin: 8px 0;
@@ -19,6 +19,8 @@ input[type="text"], input[type="password"] {
border-radius: 4px;
box-sizing: border-box;
}
button {
width: 100%;
padding: 10px;
@@ -31,4 +33,26 @@ button {
}
button:hover {
background-color: #45a049;
}
input[type="password"].passField {
width: calc(100% - 40px);
padding: 10px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
button.icon {
width: 30px;
padding: 9px;
margin: 0px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
+23
View File
@@ -0,0 +1,23 @@
function togglePassword(){
var passwordField = document.getElementById("togglePasswordBtn");
if(passwordField.type === 'password'){
passwordField.type = 'text';
}
else if(passwordField.type === 'text'){
passwordField.type = 'password';
}
}
document.getElementById('togglePasswordBtn2').addEventListener('click', function() {
var passwordField2 = document.getElementById("togglePasswordBtn");
if(passwordField2.type === 'password'){
passwordField2.type = 'text';
}
else if(passwordField2.type === 'text'){
passwordField2.type = 'password';
}
});
+33 -5
View File
@@ -15,11 +15,39 @@ input{
.webBox{
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
.boxText{
display:block;
float:left;
padding:5px 10px
.btnBG{
color: red;
}
@media screen and (max-width: 600px) {
button {
width: 100%;
padding: 10px;
margin: 8px ;
background-color: #4CAF50;;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
button.btnColor {
width: 100%;
padding: 10px;
margin: 8px ;
background-color: #4CAF50;;
color: red;
border: none;
border-radius: 4px;
cursor: pointer;
}
}
+132 -7
View File
@@ -1,19 +1,19 @@
function setSize(varWidth, varHeight){
var box = document.getElementById("webBoxSel");
var boxHeight = (varHeight / 2);
var boxwidth = (varWidth / 2);
let box = document.getElementById("webBoxSel");
let boxHeight = (varHeight / 2);
let boxWidth = (varWidth / 2);
if(boxHeight >= 300)
if((boxHeight >= 300) && (boxWidth >= 300))
{
box.style.backgroundColor = 'red';
}else{
box.style.backgroundColor = 'yellow';
}
box.style.width = boxwidth+'px';
box.style.width = boxWidth+'px';
box.style.height = boxHeight+'px';
var textInBox = document.getElementById("boxText");
let textInBox = document.getElementsByClassName('boxTextClass')[0];
textInBox.style.color = 'blue';
textInBox.style.margin = '25%';
@@ -32,5 +32,130 @@ window.addEventListener("resize", function (){
const varW = window.outerWidth;
const varH = window.outerHeight;
setSize(varW, varH);
})
});
document.getElementById("textValueBtn").addEventListener('click', function(){
let textInBox = document.getElementById("boxTextID");
let changeText = document.getElementById("textValue").value;
if(changeText.length == 0)
{
alert("Text: Not a valid text for this action.")
}else{
textInBox.innerText = changeText;
}
});
document.getElementById("textSizeBtn").addEventListener('click', function(){
let textInBox = document.getElementById("boxTextID");
let changeSize = document.getElementById("textSize").value;
if(!isNaN(changeSize))
{
alert("Size: Not a valid number for this action.")
}else{
textInBox.style.fontSize = changeSize+"px";
}
});
document.getElementById("textAngleBtn").addEventListener('click', function(){
let textInBox = document.getElementById("boxTextID");
let changeAngle = document.getElementById("textAngle").value;
if(!isNaN(changeAngle))
{
alert("Angle: Not a valid number for this action.")
}else{
textInBox.style.transform = "rotate("+changeAngle+"deg)";
}
});
document.getElementById("startBinCalc").addEventListener('click', function(){
let dezNumberToBin1 = tryParseInt(document.getElementById("binValue1").value);
let dezNumberToBin2 = tryParseInt(document.getElementById("binValue2").value);
if(isNaN(dezNumberToBin1) || isNaN(dezNumberToBin2))
{
alert("BinaryNumberAddition: At least one number is not valid for this action.")
}else{
let bin1 = calcDezToBin(dezNumberToBin1);
let bin2 = calcDezToBin(dezNumberToBin2);
additionTwoBinNumbers(bin1, bin2);
document.getElementById('binCalcResult').innerText = bin1 + " - " + bin2;
}
});
function calcDezToBin(dezNumber){
let tempNumber = dezNumber;
let remainderString = "";
let lastNumber = 0;
while(tempNumber != 0)
{
lastNumber = Math.floor(tempNumber/2);
remainderString += tempNumber%2;
tempNumber = lastNumber;
}
let binaryValue = flipBinString(remainderString);
return binaryValue;
//document.getElementById('binCalcResult').innerText = binaryValue;
}
function tryParseInt(str) {
let retValue = null;
if(str !== null) {
if(str.length > 0) {
if (!isNaN(str)) {
retValue = parseInt(str);
return retValue;
}
}
}
return str;
}
function flipBinString(remainderString)
{
let count = remainderString.length;
let remainders = [count];
for(i = 0; i < count; i++)
{
remainders[i] = remainderString[i];
}
let returnVal = remainders.reverse().join('');
return returnVal;
}
function additionTwoBinNumbers(bin1, bin2)
{
let bin1Array = bin1.split("");
let bin2Array = bin2.split("");
let tempResult = "";
if(bin1Array.length < bin2Array.length)
for(i = 0; i < bin2Array.length; i++)
{
}
else
for(i = 0; i < bin1Array.length; i++)
{
}
}
+24 -8
View File
@@ -15,35 +15,51 @@
<div class="col-sm">
<div class="input-group">
<span class="input-group-text">Text</span>
<input type="text" class="form-control" placeholder="Hello World">
<button>Text ändern</button>
<input type="text" id="textValue"class="form-control" placeholder="Hello World">
<button id="textValueBtn" class="btnColor">Text ändern</button>
</div>
</div>
<div class="col-sm">
<div class="input-group">
<span class="input-group-text">Schriftgröße</span>
<input type="text" class="form-control" placeholder="Hello World">
<input type="text" id="textSize" class="form-control" placeholder="12">
<span class="input-group-text">px</span>
<button>Schrift ändern</button>
<button id="textSizeBtn" class="btnColor">Schrift ändern</button>
</div>
</div>
<div class="col-sm">
<div class="input-group">
<span class="input-group-text">Drechung</span>
<input type="text" class="form-control" placeholder="Hello World">
<input type="text" id="textAngle"class="form-control" placeholder="45">
<span class="input-group-text">°</span>
<button>Drehung ändern</button>
<button id="textAngleBtn" class="btnColor">Drehung ändern</button>
</div>
</div>
</div>
<br><br>
<div id="webBoxSel" class="container webBox">
<span class="boxText">Das ist nur ein BeipielText</span>
<span id="boxTextID" class="boxTextClass">Das ist nur ein Beipieltext der geändert wird.</span>
</div>
<br><br><br><br>
<div class="input-group">
<span class="input-group-text">Dezimalzahl1:</span>
<input type="text" id="binValue1" class="form-control" placeholder="150">
<span class="input-group-text">Dezimalzahl2:</span>
<input type="text" id="binValue2" class="form-control" placeholder="150">
<button id="startBinCalc" class="btnColor">Binär addieren.</button>
</div>
<div id="binCalcResult">
asd
</div>
</div>