first commit

This commit is contained in:
adrian
2026-02-10 21:53:25 +01:00
commit 338ee03515
3 changed files with 126 additions and 0 deletions

35
index.html Normal file
View File

@ -0,0 +1,35 @@
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="style.css" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TSB Helper</title>
</head>
<body>
<div class="replaceTitle">Whitespaces aus Modellcode entfernen</div>
<div class="inputField">
<input
type="text"
id="removeWhiteSpaceInput"
class="removeWhiteSpaceInput"
/>
<button onclick="removeWhiteSpace()">Los!</button>
</div>
<div class="responseField">
<div class="responseText" id="responseText"></div>
<div>
<button onclick="copyToClipboard()">📋</button>
</div>
</div>
<div class="prodDateTitle">Produktionsdatum Auslesen</div>
<div class="prodDateField">
<input type="text" id="prodDateInput" class="prodDateInput" />
<button onclick="getProdDate()">Los!</button>
<div class="ProdDate" id="ProdDate"></div>
</div>
<script src="index.js"></script>
</body>
</html>

27
index.js Normal file
View File

@ -0,0 +1,27 @@
const unstrippedInput = document.getElementById("removeWhiteSpaceInput");
const responseText = document.getElementById("responseText");
unstrippedInput.addEventListener("keydown", function (event) {
if (event.key === "Enter") {
removeWhiteSpace();
}
});
function removeWhiteSpace() {
const userinput = unstrippedInput.value;
if (userinput != "") {
const strippedInput = userinput.replace(/ /g, "");
strippedInput.trim();
responseText.textContent = strippedInput;
unstrippedInput.value = "";
copyToClipboard();
}
}
function copyToClipboard() {
const text_to_copy = responseText.textContent;
navigator.clipboard.writeText(text_to_copy);
}

64
style.css Normal file
View File

@ -0,0 +1,64 @@
body {
background-color: #2b2a34;
}
.replaceTitle {
display: flex;
justify-content: center;
color: white;
}
.inputField {
display: flex;
justify-content: center;
}
.removeWhiteSpaceInput {
border: 2px solid black;
border-radius: 5px;
}
.responseField {
display: flex;
justify-content: center;
align-items: center;
max-width: fit-content;
margin: 5px auto;
}
.responseText {
display: flex;
justify-content: center;
border: 2px solid black;
border-radius: 5px;
max-width: 300px;
margin: 5px auto;
background-color: white;
width: 200px;
height: 20px;
}
.responseButton {
display: flex;
justify-content: center;
}
.prodDateTitle {
display: flex;
justify-content: center;
color: white;
}
.prodDateField {
display: flex;
justify-content: center;
align-items: center;
max-width: fit-content;
margin: 5px auto;
}
.prodDateInput {
display: flex;
justify-content: center;
border: 2px solid black;
border-radius: 5px;
max-width: 300px;
margin: 5px auto;
background-color: white;
width: 200px;
height: 20px;
}