Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cipher #35

Open
wants to merge 65 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
ef26e9b
este es el primer commit
Feb 7, 2020
00fc59a
este es un cambio en el index
adriana121 Feb 7, 2020
d35f07a
primera pagina lista
adriana121 Feb 7, 2020
4575762
agregando el segundo cambio
adriana121 Feb 9, 2020
73d1d1b
esqueleto listo
adriana121 Feb 9, 2020
339c67a
agregando la imagen de fondo
adriana121 Feb 9, 2020
ec80081
segunda pagina html
adriana121 Feb 9, 2020
ba8b9d8
de js a html
adriana121 Feb 9, 2020
f48ff1b
agregando imagen de fondo
adriana121 Feb 9, 2020
548cfd0
"nuevos cambios"
adriana121 Feb 9, 2020
3becf59
f
adriana121 Feb 9, 2020
2251473
"imagen fondo"
adriana121 Feb 9, 2020
9d196ca
funcion cifrando lista
adriana121 Feb 13, 2020
9834c37
imagen de fondo
adriana121 Feb 13, 2020
8c2e2ac
datos del usuario
adriana121 Feb 13, 2020
d2d6b2e
prueba
adriana121 Feb 13, 2020
21ae1f7
agregando stilo
adriana121 Feb 13, 2020
2bf3451
primera pagina
adriana121 Feb 13, 2020
327df2a
estilo
adriana121 Feb 13, 2020
2c5bf54
delet
adriana121 Feb 13, 2020
6a01317
mostrar pantalla una por una listo
adriana121 Feb 17, 2020
bde486f
carpeta de imagenes
adriana121 Feb 17, 2020
9059afa
readme casi completo
adriana121 Feb 17, 2020
c3ae21e
funcion lista
adriana121 Feb 17, 2020
a91f50f
pasando a una sola pantalla
adriana121 Feb 17, 2020
e9b288f
solo una panalla html
adriana121 Feb 17, 2020
bd9aae5
solo una pagina de estilo
adriana121 Feb 17, 2020
54c1236
solo un css
adriana121 Feb 17, 2020
be266cc
estilo listo
adriana121 Feb 17, 2020
a2e19fa
img redme
adriana121 Feb 17, 2020
6afbaca
img
adriana121 Feb 17, 2020
49dd4a8
imagenes redme
adriana121 Feb 17, 2020
107e0b8
redme listo
adriana121 Feb 17, 2020
f1733bb
otra img
adriana121 Feb 17, 2020
47b1b67
img
adriana121 Feb 17, 2020
2901836
img
adriana121 Feb 17, 2020
9391291
agregando imagenes al redme
adriana121 Feb 18, 2020
7c2f6df
index listi
adriana121 Feb 18, 2020
8803628
readme en proceso
adriana121 Feb 18, 2020
569a67a
ya todo listo
adriana121 Feb 18, 2020
52f5bce
estilo listo
adriana121 Feb 18, 2020
5f78153
guardando cambios
adriana121 Feb 18, 2020
42354b7
imagen al redme
adriana121 Feb 18, 2020
15d73a6
prueba imagenes
adriana121 Feb 18, 2020
9e83baa
listo
adriana121 Feb 18, 2020
90d7c5b
changes
adriana121 Feb 18, 2020
ca3d753
changes
adriana121 Feb 18, 2020
27e1af1
imagenes ya insertadas
adriana121 Feb 18, 2020
79bd917
listo
adriana121 Feb 18, 2020
786e68a
probando imagenes
adriana121 Feb 18, 2020
cee2100
prueba imagenes
adriana121 Feb 18, 2020
8fbe47e
proyect
adriana121 Feb 18, 2020
af409ac
listo
adriana121 Feb 18, 2020
678d49e
imagen
adriana121 Feb 18, 2020
ddebc72
img
adriana121 Feb 20, 2020
03bd9f4
img
adriana121 Feb 20, 2020
54d259d
import
adriana121 Feb 21, 2020
8b75499
module
adriana121 Feb 21, 2020
e69aed4
dom
adriana121 Feb 21, 2020
53b17c4
funciones listas en el cipher
adriana121 Feb 21, 2020
baa2404
enlazado los eventos del DOM y decifar y cifrar
adriana121 Feb 21, 2020
a3000b3
funciones del dom listas
adriana121 Feb 21, 2020
f9bedf1
docs
May 15, 2020
19c837a
mostrando solo un archivo js
May 15, 2020
e19969b
carpeta docs
May 15, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,673 changes: 5,673 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

Binary file added src/cerdito1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 44 additions & 4 deletions src/cipher.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
const cipher = {
// ...
};

export default cipher;

//1crear una fuction para cifrar//
function code() {
//traer los datos del usuario-nombre//
let name = document.getElementById("nombre").value;
//traer el valor del desplazaamiento//
let offset = document.getElementById("numero").value;
//convertir las letras en mayusculas//
let may = name.toUpperCase();
//crear una variable vacia donde se almacenara la palabra cifrada//
let newPalabra='';
//declra el offset//
offset = offset %26;
//obtener los indices del nombre(dato de usuario)//
for (let i=0; i < may.length; i++){
//obtener codigo ascii de cada letra del nombre//
let palabra = may.charCodeAt(i);
//declara el rango de codigos ascii, solo las mayusculas//
if(palabra >= 65 && palabra<=90){
//convertir el codigo ascii de cada letra obtenido a un nuevo codigo ascii agregando el desplazamiento(formula)//
newPalabra = String.fromCharCode((palabra - 65 + offset)%26 +65);

document.write("<rot>" + newPalabra + "<rot>");

}
}
}

function decifrar(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Procura tener consistencia en tu código, si empleas palabras en inglés continua con ellas, tu indentación debe mejorar, por todo lo demás llevas un excelente trabajo!

let codigo = document.getElementById("codigo").value;
let offset = document.getElementById("numero").value;
let promocion='';
offset = offset %26;
for (let i=0; i < codigo.length; i++){
let neCod = codigo.charCodeAt(i);
if(neCod >= 65 && neCod<=90){
promocion = String.fromCharCode((neCod + 65 - offset - 26)%26 +65);
console.log(promocion);

}
}



23 changes: 23 additions & 0 deletions src/codigo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Caesar Cipher</title>
<link rel="stylesheet" href="style2.css" />
</head>
<script src="cipher.js"></script>
<body>
<div id="root2">
<h1>OBTENIENDO DATOS DEL USUARIO</h1>

<h2>Ingresa el codigo de promocion:</h2>
<input type="text" name="nombre" id="codigo" placeholder="Nombre"><br>



Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu código no es muy legible, cuida la indentación y consistencia

</div>
<input id="button" type="button" value="enviar" onclick="decifrar();">

</body>
</html>
Binary file added src/helado fondo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
</head>
<body>
<div id="root">
<h1>Hello world!</h1>
</div>
<script src="index.js" type="module"></script>
<h1>¿Te gustaría un helado?</h1>
<h2>¡Gratis!</h2>


<h3>¡Genera tu código aquí!</h3>
</div>
<a href="index2.html"><input type="button" value="Click aquí"></a>
</body>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adri! tu avance es muy bueno y me parece perfecto que ya tengas dominado el tema de git, lo que si es que procura que cada cambio que subas sea significativo, es decir, que no sea solo agregar una llave, una imagen o algo asi, que tenga mas sentido. Buen trabajo!

</html>
3 changes: 0 additions & 3 deletions src/index.js

This file was deleted.

20 changes: 20 additions & 0 deletions src/index2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Caesar Cipher</title>
<link rel="stylesheet" href="style2.css" />
</head>
<body>
<div id="root2">
<h1>HELADOS LOS TRES CERDITOS</h1>
<h2>Ingresa tus datos aquí:</h2>

<p>Nombre : <input type="text" name="nombre"></p>
<p>Primer apellido : <input type="text" name="apellido"></p>

<a href="cipher.js"><input type="button" value="Continuar"></a>

</div>
</body>
</html>
3 changes: 3 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background-image: url("../src/helado\ fondo.jpg");
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bien!