first commit
This commit is contained in:
35
index.html
Normal file
35
index.html
Normal 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
27
index.js
Normal 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
64
style.css
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user