-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
60 lines (52 loc) · 2.15 KB
/
Copy pathscript.js
File metadata and controls
60 lines (52 loc) · 2.15 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//a - ai
//e - enter
//i - imes
//o - ober
//u - ufat
function encriptar() {
var texto = document.getElementById('inputTexto').value.toLowerCase();
//i es para afecte mayusculas como minusculas -- e else{
//g es para toda la linea u oracion
//m es para que afecte a multiples lineas o parrafo
var txtCifrado = texto.replace(/e/igm, "enter");
var txtCifrado = txtCifrado.replace(/o/igm, "ober");
var txtCifrado = txtCifrado.replace(/i/igm, "imes");
var txtCifrado = txtCifrado.replace(/a/igm, "ais");
var txtCifrado = txtCifrado.replace(/u/igm, "ufat");
document.getElementById("imgDer").style.display = "none";
document.getElementById("texto").style.display = "none";
document.getElementById("texto2").innerHTML = txtCifrado;
document.getElementById("copiar").style.display = "show";
document.getElementById("copiar").style.display = "inherit";
}
function desencriptar() {
var texto = document.getElementById('inputTexto').value.toLowerCase();
//i es para afecte mayusculas como minusculas -- e else{
//g es para toda la linea u oracion
//m es para que afecte a multiples lineas o parrafo
var txtCifrado = texto.replace(/enter/igm, "e");
var txtCifrado = txtCifrado.replace(/ober/igm, "o");
var txtCifrado = txtCifrado.replace(/imes/igm, "i");
var txtCifrado = txtCifrado.replace(/ais/igm, "a");
var txtCifrado = txtCifrado.replace(/ufat/igm, "u");
document.getElementById("imgDer").style.display = "none";
document.getElementById("texto").style.display = "none";
document.getElementById("texto2").innerHTML = txtCifrado;
document.getElementById("copiar").style.display = "show";
document.getElementById("copiar").style.display = "inherit";
}
function copy() {
var contenido = document.querySelector("#texto2");
contenido.select();
document.execCommand("copy");
alert("!Se copió correctamente!");
}
function subir() {
scrollToTopBtn.onclick = () => {
windows.scrollTo({
top: 0,
behavior: 'smooth'
})
}
}
subir.onclick = document.querySelector("#scrollToTopBtn");