-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
58 lines (47 loc) · 1.54 KB
/
app.js
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
function encriptar(){
let texto = document.getElementById("texto").value;
let title = document.getElementById("mensaje");
let textoCifrado = texto
.replace(/e/gi,"enter")
.replace(/i/gi,"imes")
.replace(/a/gi,"ai")
.replace(/o/gi,"ober")
.replace(/u/gi,"ufat");
if (texto.length !=0){
title.innerHTML = textoCifrado;
title.classList.add("ajustar");
convertir();
}else{
alert("Ingrese el texto que desea encriptar");
}
};
function desencriptar(){
let texto = document.getElementById("texto").value;
let title = document.getElementById("mensaje");
let textoCifrado = texto
.replace(/enter/gi,"e")
.replace(/imes/gi,"i")
.replace(/ai/gi,"a")
.replace(/ober/gi,"o")
.replace(/ufat/gi,"u");
if(texto.length !=0){
title.innerHTML = textoCifrado;
title.classList.add("ajustar");
convertir();
}else{
alert("debes ingresar algun texto!")
}
};
function convertir(){
const contenido = document.getElementById("mensajeDos");
const figure = document.getElementById("picture");
let botonCopy = document.getElementById("btn-copy");
figure.style.display = "none";
contenido.style.display ="none";
botonCopy.style.display = "block";
};
function copiar(){
let title = document.getElementById("mensaje");
navigator.clipboard.writeText(title.value);
//botonCopy.style.display = "block";
};