-
Notifications
You must be signed in to change notification settings - Fork 60
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
Primer code review - Fabiola González #23
base: master
Are you sure you want to change the base?
Changes from 2 commits
7c52cce
1dc1f5e
3335e48
2d7cf20
31542d2
7d00dc7
ceab355
b0591ef
cf39d6a
be999c3
00918c2
8238e81
0b7d021
6406667
2209c32
c5910f0
9f5be3d
a707f8f
79f9c7c
c4aa51b
d1e814f
f99b4a6
7e2f1c9
20dbc85
2d254f8
c2e7616
a14e406
3a0dd86
b273806
b7487b0
1a2d4be
ce9fc61
863e325
a76d34a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
//var inputText= "Este es un texto de prueba."; | ||
var inputText= "FTUF FT VO UFYUP EF QSVFCB"; | ||
var offset = -1; | ||
var outputText = []; | ||
|
||
console.log("texto:"+inputText+" - "+"offset:"+offset); | ||
cipher(inputText, offset, outputText); | ||
//console.log(cipheredLetter); | ||
console.log(outputText.join("")); | ||
|
||
function cipher(){ | ||
|
||
for (i in inputText){ | ||
var letterOriginal= inputText.charAt(i); | ||
var letter = letterOriginal.toUpperCase(); | ||
var letterCode = letter.charCodeAt(); | ||
var letterCodeNumber = parseInt(letterCode); | ||
if(letterCodeNumber == 32){ | ||
codeNumberCiphered = letterCodeNumber; | ||
}else{ | ||
codeNumberCiphered = (letterCodeNumber-65+offset)%26+65; | ||
} | ||
var cipheredLetter = String.fromCharCode(codeNumberCiphered); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let |
||
console.log(letter+" "+letterCode+" "+codeNumberCiphered+" "+cipheredLetter); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. de preferencia crea una variable que almacene todo esto y despues solo le das al console log la variable |
||
//return cipheredLetter; | ||
outputText.push(cipheredLetter); | ||
} | ||
return outputText; | ||
//console.log("texto cifrado:"+outputText.join("")); | ||
/* var outputText = ["Que"]; | ||
var outputText = outputText.push(cipheredLetter); | ||
console.log("texto cifrado:"+outputText);*/ | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
html, body{ | ||
margin:0; | ||
padding:0; | ||
background-color: #c7e6e6; | ||
text-align: center; | ||
display: inline-block; | ||
height: 100%; | ||
vertical-align:middle; | ||
|
||
} | ||
|
||
section{ | ||
border: 1px solid black; | ||
margin: 0 auto; | ||
height: 100%; | ||
} | ||
|
||
.logo{ | ||
width: 15%; | ||
} | ||
|
||
#bluetoothLabel{ | ||
float: left; | ||
} | ||
|
||
.configBox{ | ||
display: inline-block; | ||
} | ||
|
||
/* Estilo para toogle switch que activa el Bluetooth */ | ||
/* The switch - the box around the slider */ | ||
.switch { | ||
position: relative; | ||
display: inline-block; | ||
width: 60px; | ||
height: 34px; | ||
} | ||
|
||
/* Hide default HTML checkbox */ | ||
.switch input { | ||
opacity: 0; | ||
width: 0; | ||
height: 0; | ||
} | ||
|
||
/* The slider */ | ||
.slider { | ||
position: absolute; | ||
cursor: pointer; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
background-color: #ccc; | ||
-webkit-transition: .4s; | ||
transition: .4s; | ||
} | ||
|
||
.slider:before { | ||
position: absolute; | ||
content: ""; | ||
height: 26px; | ||
width: 26px; | ||
left: 4px; | ||
bottom: 4px; | ||
background-color: white; | ||
-webkit-transition: .4s; | ||
transition: .4s; | ||
} | ||
|
||
input:checked + .slider { | ||
background-color: #2196F3; | ||
} | ||
|
||
input:focus + .slider { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Esto es muy específico y está bien, pero puede fallar, mejor usa el selector de descendente (espacio) en vez del + para que sea más seguro |
||
box-shadow: 0 0 1px #2196F3; | ||
} | ||
|
||
input:checked + .slider:before { | ||
-webkit-transform: translateX(26px); | ||
-ms-transform: translateX(26px); | ||
transform: translateX(26px); | ||
} | ||
|
||
/* Rounded sliders */ | ||
.slider.round { | ||
border-radius: 34px; | ||
} | ||
|
||
.slider.round:before { | ||
border-radius: 50%; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Es importante cambiar var por let o const (la mayoría pide const aunque no hay gran diferencia entre let y const es un debate) pero var compromete tu código, ya no lo uses.