Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mrp500 committed Mar 2, 2024
0 parents commit de5013d
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 0 deletions.
37 changes: 37 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>

<html lang="es">

<head>
<link rel="stylesheet" href="reset.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Encriptador/Desencriptador</title>
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap" rel="stylesheet">
<script src="script.js" defer></script>
<script>
function copyText() {
var copyText = document.getElementById('result');
copyText.select();
document.execCommand('copy');
alert('Texto copiado: ' + copyText.value);
}
</script>
</head>
<body>
<h1>Encriptador/Desencriptador</h1>
<label for="inputTextArea"></label>
<div>
<textarea id="inputTextArea" rows="4" cols="50" placeholder="Ingrese texto aquí"></textarea>
<p>Solo letras minusculas y sin acentos</p>
<button onclick="encryptText()">Encriptar!</button>
<button onclick="decryptText()">Desencriptar!</button>
</div>
<div><textarea id="result" rows="4" cols="50"></textarea><br>
<button onclick="copyText()">Copiar</button>
</div>
</body>
</html>
48 changes: 48 additions & 0 deletions reset.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
23 changes: 23 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function encryptText() {
var inputText = document.getElementById('inputTextArea').value;
var resultTextArea = document.getElementById('result');
var encryptedText = inputText
.replace(/e/g, 'enter')
.replace(/i/g, 'imes')
.replace(/a/g, 'ai')
.replace(/o/g, 'ober')
.replace(/u/g, 'ufat');
resultTextArea.value = encryptedText;
}

function decryptText() {
var inputText = document.getElementById('inputTextArea').value;
var resultTextArea = document.getElementById('result');
var decryptedText = inputText
.replace(/ufat/g, 'u')
.replace(/ober/g, 'o')
.replace(/ai/g, 'a')
.replace(/imes/g, 'i')
.replace(/enter/g, 'e');
resultTextArea.value = decryptedText;
}
Empty file added styles.css
Empty file.

0 comments on commit de5013d

Please sign in to comment.