This commit is contained in:
Alexander Popov 2021-01-28 22:51:26 +03:00
parent c8f0e79504
commit 17686bef88
4 changed files with 103 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.sublime-*

56
html/css/app.css Normal file
View File

@ -0,0 +1,56 @@
@import url('https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic');
* {
padding: 0; margin: 0; outline: 0;
font-family: "Roboto";
font-size: 1.1rem;
}
*::selection {
color: #fb4b4b;
}
body {
background-color: #ffffff;
}
div.wrap {
max-width: 800px;
margin: 0 auto;
}
div.header {
background-color: #fb4b4b;
color: #ffffff;
padding: 16px;
}
div.content {
margin: 16px 0;
}
button, textarea {
display: block;
box-sizing: border-box;
border: 1px solid #fb4b4b;
width: 100%;
padding: 8px;
}
button {
color: #000000;
background-color: #fb4b4b;
border-top: 0;
border-bottom: 0;
}
button:hover {
color: #ffffff;
}
textarea {
resize: none;
}
textarea:disabled {
background-color: #ffffff;
}

23
html/index.html Normal file
View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>chola</title>
<link rel="stylesheet" href="css/app.css">
</head>
<body>
<div class="header">
<div class="wrap">Change of Layout</div>
</div>
<div class="content">
<div class="wrap">
<textarea id="one" rows="3" placeholder="Paste fail layout text" onchange="layoutReplace()"></textarea>
<button>q > й</button>
<textarea id="two" rows="3" disabled="disabled"></textarea>
</div>
</div>
<script src="js/app.js"></script>
</body>
</html>

23
html/js/app.js Normal file
View File

@ -0,0 +1,23 @@
function layoutReplace()
{
keys = {
"q":"й", "w":"ц", "e":"у", "r":"к", "t":"е", "y":"н", "u":"г",
"i":"ш", "o":"щ", "p":"з", "[":"х", "]":"ъ", "a":"ф", "s":"ы",
"d":"в", "f":"а", "g":"п", "h":"р", "j":"о", "k":"л", "l":"д",
";":"ж", "'":"э", "z":"я", "x":"ч", "c":"с", "v":"м", "b":"и",
"n":"т", "m":"ь", ",":"б", ".":"ю", "/":"."
};
var dat = document.getElementById("one").value
var res = document.getElementById("two")
let text = null
console.log(dat)
text = dat.replace(/[A-z/,.;\'\]\[]/g, function(x) {
return x == x.toLowerCase() ? keys[ x ] : keys[ x.toLowerCase() ].toUpperCase();
});
res.value = text
}