z
This commit is contained in:
parent
4c07ce14bb
commit
0c3551ecbe
1 changed files with 37 additions and 0 deletions
37
index.html
37
index.html
|
|
@ -56,6 +56,23 @@
|
||||||
<textarea id="outputText" placeholder="Output" rows="5"></textarea>
|
<textarea id="outputText" placeholder="Output" rows="5"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h2>Zero Width</h2>
|
||||||
|
<div class="container">
|
||||||
|
<label for="inputTextZeroWidth">Enter Text:</label>
|
||||||
|
<input type="text" id="inputTextZeroWidth" placeholder="Type something...">
|
||||||
|
<button onclick="insertZeroWidthSpaces()">Insert Zero-Width Spaces</button>
|
||||||
|
<textarea id="outputTextZeroWidth" rows="4" cols="50" placeholder="Output with zero-width spaces..."></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2>Homoglyph</h2>
|
||||||
|
<div class="container">
|
||||||
|
<label for="inputTextHomoglyph">Enter Text:</label>
|
||||||
|
<input type="text" id="inputTextHomoglyph" placeholder="Type something...">
|
||||||
|
<button onclick="substituteHomoglyphs()">Substitute Homoglyphs</button>
|
||||||
|
<textarea id="outputTextHomoglyph" rows="4" cols="50" placeholder="Output with homoglyphs..."></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function replaceSemicolons() {
|
function replaceSemicolons() {
|
||||||
let inputCode = document.getElementById('inputCode').value;
|
let inputCode = document.getElementById('inputCode').value;
|
||||||
|
|
@ -71,6 +88,26 @@
|
||||||
.replace(/1/g, 'l');
|
.replace(/1/g, 'l');
|
||||||
document.getElementById('outputText').value = outputText;
|
document.getElementById('outputText').value = outputText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function insertZeroWidthSpaces() {
|
||||||
|
let inputText = document.getElementById('inputTextZeroWidth').value;
|
||||||
|
// Insert a zero-width space after every character
|
||||||
|
let outputText = inputText.split('').join('\u200B');
|
||||||
|
document.getElementById('outputTextZeroWidth').value = outputText;
|
||||||
|
}
|
||||||
|
|
||||||
|
function substituteHomoglyphs() {
|
||||||
|
let inputText = document.getElementById('inputTextHomoglyph').value;
|
||||||
|
// Substitute specific characters with their homoglyphs
|
||||||
|
let outputText = inputText
|
||||||
|
.replace(/a/g, 'а') // Latin 'a' to Cyrillic 'а'
|
||||||
|
.replace(/e/g, 'е') // Latin 'e' to Cyrillic 'е'
|
||||||
|
.replace(/o/g, 'о') // Latin 'o' to Cyrillic 'о'
|
||||||
|
.replace(/p/g, 'р') // Latin 'p' to Cyrillic 'р'
|
||||||
|
.replace(/c/g, 'с') // Latin 'c' to Cyrillic 'с'
|
||||||
|
.replace(/y/g, 'у'); // Latin 'y' to Cyrillic 'у'
|
||||||
|
document.getElementById('outputTextHomoglyph').value = outputText;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue