Skip to content

Commit cf0b233

Browse files
committed
Encriptador concluido por el momento D:
1 parent 07c94bc commit cf0b233

File tree

3 files changed

+58
-24
lines changed

3 files changed

+58
-24
lines changed

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h1><img class="candado" src="imagenes/candado.svg" draggable="false" oncontextm
2727
</h1>
2828
<label for="inputTextArea"></label>
2929
<div class="input">
30-
<textarea id="inputTextArea" rows="18" cols="40" placeholder="Ingrese texto aquí" class="campotransparente-uno"></textarea>
30+
<textarea id="inputTextArea" rows="19" cols="32" placeholder="Ingrese texto aquí" class="campotransparente-uno"></textarea>
3131
<p>
3232
<img class="circulo-exclamacion" src="imagenes/circulo-exclamacion-cierre.svg" alt="Circulo-Exclamacion">
3333
Solo letras minusculas y sin acentos
@@ -39,10 +39,10 @@ <h1><img class="candado" src="imagenes/candado.svg" draggable="false" oncontextm
3939
</div>
4040
<div class="output">
4141
<div class="detective">
42-
<img id="hideable-image" src="imagenes/detective.svg" draggable="false" oncontextmenu="return false" alt="Detective" onclick="hideImageAndFocusTextarea();">
42+
<img id="clickable-image" src="imagenes/detective.svg" draggable="false" oncontextmenu="return false" alt="Detective" onclick="convertToTextArea();">
4343
</div>
44-
<textarea id="result" rows="18" cols="32" class="campotransparente-dos" onclick="hideImageAndFocusTextarea();"></textarea><br>
45-
<div style="text-align: center;">
44+
<textarea id="result" rows="20" cols="32" class="campotransparente-dos" onclick="convertToTextArea();"></textarea><br>
45+
<div class="divbutton-tres">
4646
<button class="button-tres" onclick="copyText();">Copiar</button>
4747
</div>
4848
</div>

script.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function encryptText() {
1212
resultTextArea.value = encryptedText;
1313
var inputElement = document.getElementById('inputTextArea');
1414
inputElement.value = '';
15-
document.getElementById('hideable-image').style.display = 'none';
15+
document.getElementById('clickable-image').style.display = 'none';
1616
} else {
1717
var inputElement = document.getElementById('inputTextArea');
1818
inputElement.focus();
@@ -32,31 +32,39 @@ function decryptText() {
3232
resultTextArea.value = decryptedText;
3333
var inputElement = document.getElementById('inputTextArea');
3434
inputElement.value = '';
35-
document.getElementById('hideable-image').style.display = 'none';
35+
document.getElementById('clickable-image').style.display = 'none';
3636
} else {
3737
var inputElement = document.getElementById('inputTextArea');
3838
inputElement.focus();
3939
}
4040
}
4141

4242
document.querySelector('.button-tres').addEventListener('click', function() {
43-
var image = document.getElementById('hideable-image');
43+
var image = document.getElementById('clickable-image');
4444
image.style.display = 'none';
4545
});
4646

47+
function convertToTextArea() {
48+
var image = document.getElementById('clickable-image');
49+
var textArea = document.getElementById('result');
50+
image.style.display = 'none';
51+
textArea.style.display = 'block';
52+
textArea.focus();
53+
}
54+
4755

4856
function hideImageAndFocusTextarea(event) {
49-
var image = document.getElementById('hideable-image');
57+
var image = document.getElementById('clickable-image');
5058
var textarea = document.getElementById('result');
5159
image.style.display = 'none';
5260
textarea.focus();
5361
}
5462

55-
document.getElementById('hideable-image').onclick = hideImageAndFocusTextarea;
63+
document.getElementById('clickable-image').onclick = hideImageAndFocusTextarea;
5664

5765
document.getElementById('result').addEventListener('blur', function() {
5866
var resultTextArea = document.getElementById('result');
59-
var image = document.getElementById('hideable-image');
67+
var image = document.getElementById('clickable-image');
6068
if (resultTextArea.value.trim() === '') {
6169
image.style.display = 'block';
6270
}

styles.css

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ h1 {
33
text-align: block;
44
color: rgb(139, 180, 255);
55
font-family: 'Montserrat', sans-serif;
6-
margin-top: 0;
7-
margin-bottom: 15px;
6+
margin-top: 10px;
7+
margin-bottom: 20px;
88
font-weight: bold;
99
}
1010

@@ -25,13 +25,15 @@ h1 {
2525

2626
body {
2727
width: 1080px;
28-
height: 720px;
28+
height: 750px;
2929
margin: 0 auto;
3030
background-image: linear-gradient(to bottom, rgb(10, 0, 95) 10%, rgb(82, 142, 255) 70% );
3131
background-repeat: no-repeat;
3232
}
3333

3434
.input {
35+
height: 500px;
36+
width: 400px;
3537
float: left;
3638
padding-top: 50px;
3739
color: rgb(10, 0, 95, 0.75);
@@ -46,6 +48,8 @@ body {
4648
}
4749

4850
.output {
51+
height:500px;
52+
width: 400px;
4953
float: right;
5054
padding-top: 50px;
5155
padding-left: 20px;
@@ -75,7 +79,8 @@ body {
7579
}
7680

7781
.campotransparente-dos {
78-
margin: 10px;
82+
display: block;
83+
margin: 0px;
7984
padding: 10px;
8085
background:transparent;
8186
border: none;
@@ -86,7 +91,7 @@ body {
8691
font-family: 'Montserrat', sans-serif;
8792
text-align: center;
8893
color: rgb(255, 255, 255);
89-
line-height: 1.07;
94+
line-height: 1;
9095
}
9196

9297
::-webkit-scrollbar {
@@ -100,8 +105,8 @@ body {
100105
height: 240px;
101106
filter: invert(12%) sepia(92%) saturate(2487%) hue-rotate(242deg) brightness(84%) contrast(138%);
102107
position: absolute;
103-
margin-left: 7% ;
104-
margin-top: 5%;
108+
margin-left: 6%;
109+
margin-top: 6%;
105110
-webkit-user-select: none;
106111
-moz-user-select: none;
107112
-ms-user-select: none;
@@ -111,7 +116,8 @@ body {
111116
p {
112117
font-size: 16px;
113118
font-family: 'Montserrat', sans-serif;
114-
margin: 10px;
119+
margin-top: 15px;
120+
margin-bottom: 10px;
115121
text-align: center;
116122
}
117123

@@ -134,7 +140,7 @@ p {
134140
text-decoration: none;
135141
display: inline-block;
136142
font-size: 16px;
137-
margin: 20px;
143+
margin: 15px;
138144
cursor: pointer;
139145
border: none;
140146
box-shadow: 2px 5px 10px 2px rgba(0, 0, 0, 0.5);
@@ -156,7 +162,7 @@ p {
156162
text-decoration: none;
157163
display: inline-block;
158164
font-size: 16px;
159-
margin: 20px;
165+
margin: 15px;
160166
cursor: pointer;
161167
border: none;
162168
box-shadow: 2px 5px 10px 2px rgba(0, 0, 0, 0.5);
@@ -167,6 +173,14 @@ p {
167173
background-color: rgb(207, 66, 0);
168174
}
169175

176+
.divbutton-tres {
177+
margin-top: 2.5%;
178+
height: 200;
179+
width: auto;
180+
text-align: center;
181+
182+
}
183+
170184
.button-tres {
171185
width: 120px;
172186
height: 40px;
@@ -178,7 +192,7 @@ p {
178192
text-decoration: none;
179193
display: inline-block;
180194
font-size: 16px;
181-
margin: 20px;
195+
margin: 10px;
182196
cursor: pointer;
183197
border: none;
184198
box-shadow: 2px 5px 10px 2px rgba(0, 0, 0, 0.5);
@@ -209,14 +223,15 @@ p {
209223
}
210224

211225
body {
212-
margin: 0 auto;
213226
width: 100%;
214227
height: 100%;
215228
}
216229

217230
.input {
218231
float: none;
219-
padding: 20px;
232+
width: auto;
233+
padding: 0px;
234+
margin: 0;
220235
}
221236

222237
.campotransparente-uno {
@@ -237,8 +252,19 @@ p {
237252
.button-dos {
238253
margin-bottom: 0;
239254
}
255+
256+
.intput {
257+
width: 0;
258+
float: none;
259+
margin: 5%
260+
}
261+
262+
.divbutton-tres {
263+
margin: 0;
264+
}
240265

241266
.output {
267+
width: auto;
242268
float: none;
243269
margin: 5%
244270
}
@@ -255,7 +281,7 @@ p {
255281

256282
.detective {
257283
opacity: 30%;
258-
margin: 10% 12%;
284+
margin: 15% 11%;
259285
}
260286

261287
}

0 commit comments

Comments
 (0)