-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
42 lines (38 loc) · 1.84 KB
/
app.js
File metadata and controls
42 lines (38 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function encriptar(){
var texto = document.getElementById("input-texto").value;
//i es para que afecte tanto mayuscula como minuscula
//m es para que afecte a multiples lineas o parrafos
//g es para toda la linea u oracion
var textocifrado = texto.replace(/e/img,"enter");
var textocifrado = textocifrado.replace(/o/img,"ober");
var textocifrado = textocifrado.replace(/i/img,"imes");
var textocifrado = textocifrado.replace(/a/img,"ai");
var textocifrado = textocifrado.replace(/u/img,"ufat");
document.getElementById("imgder").style.display = "none";
document.getElementById("texto").style.display = "none";
document.getElementById("texto2").innerHTML = textocifrado;
document.getElementById("copiar").display = "show";
document.getElementById("copiar").display = "inherit";
}
function desencriptar(){
var texto = document.getElementById("input-texto").value;
//i es para que afecte tanto mayuscula como minuscula
//m es para que afecte a multiples lineas o parrafos
//g es para toda la linea u oracion
var textocifrado = texto.replace(/enter/img,"e");
var textocifrado = textocifrado.replace(/ober/img,"o");
var textocifrado = textocifrado.replace(/imes/img,"i");
var textocifrado = textocifrado.replace(/ai/img,"a");
var textocifrado = textocifrado.replace(/ufat/img,"u");
document.getElementById("imgder").style.display = "none";
document.getElementById("texto").style.display = "none";
document.getElementById("texto2").innerHTML = textocifrado;
document.getElementById("copiar").display = "show";
document.getElementById("copiar").display = "inherit";
}
function copy1(){
var contenido = document.querySelector("#texto2");
contenido.select();
navigator.clipboard.writeText(contenido.value)
alert("copiado")
}