Skip to content

Commit

Permalink
Adicionado título e icone e console log de boas vindas
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafaeldasilvaperes committed Apr 30, 2022
1 parent ba7acd4 commit 915ea4c
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 10 deletions.
1 change: 1 addition & 0 deletions img/encrypted_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Simples encriptador de textos">
<title>Encrypter/Decrypter Oracle ONE</title>

<!--INCONE AO LADO DO TÍTULO DA PAGINA-->
<link rel="icon" href="/img/encrypted_icon.svg" type="image/icon type">
<!--LINK CSS-->
<link rel="stylesheet" href="styles/styles.css">

Expand All @@ -29,7 +32,7 @@

<!--1° ITEM COM LOGO E TEXTO TÍTULO-->
<li class="logo">
<a href="https://pt.wikipedia.org/wiki/Encripta%C3%A7%C3%A3o" class="nav-link-logo">
<a href="https://pt.wikipedia.org/wiki/Encripta%C3%A7%C3%A3o" target="_blank" class="nav-link-logo">
<svg class="spacer1 layer2 layer4"></svg>
<span class="link-text text-logo">Encrypter / Decrypter</span>
</a>
Expand Down
52 changes: 44 additions & 8 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,25 @@ function pegaTexto(){

function mostrarTextEncriptado(){
var originaltext = fraseOriginal;
Encriptar(originaltext);
var text = fraseEncriptada;
document.getElementById("textareaDiv").innerHTML = text;
if(checagemTextoColado(originaltext) == false){
avisoCharIncorreto();
}else{
Encriptar(originaltext);
var text = fraseEncriptada;
document.getElementById("textareaDiv").innerHTML = text;
};

}

function mostrarTextDescriptado(){
var originaltext = fraseOriginal;
Desencriptar(originaltext);
var text = fraseDesencriptada;
document.getElementById("textareaDiv").innerHTML = text;
var originaltext = fraseOriginal
if(checagemTextoColado(originaltext) == false){
avisoCharIncorreto();
}else{
Desencriptar(originaltext);
var text = fraseDesencriptada;
document.getElementById("textareaDiv").innerHTML = text;
}
}

function contadorLetras(){
Expand Down Expand Up @@ -108,6 +117,31 @@ function copiarTexto(){

}

function checagemTextoColado(texto){
const padrao = '[a-z !,?]';
for (i = 0; i < texto.length; i++) {
if(!texto[i].match(padrao)){
return false
}
}
}
function bemVindoConsoleLog(){
console.log(
"%cBem vindo ao Challenge One da Oracle ONE!",
`background-color: #fc6a03;
text-shadow: 3px 4px rgb(217,31,38);
background:linear-gradient(90deg, #fc6a03, #f29450);
font-weight: bold;
padding: 1rem;
color: white;
border-radius: 0.5em;
`
)

}

//background:linear-gradient(90deg, #fc6a03, #0a72e9, #fc6a03);

var fraseOriginal;
var fraseEncriptada;
var fraseDesencriptada;
Expand All @@ -126,4 +160,6 @@ var descrypt = document.getElementById("btn-exec-des");
descrypt.addEventListener("click", mostrarTextDescriptado, false);

var copy = document.getElementById('btn-copy1');
copy.addEventListener("click", copiarTexto, false);
copy.addEventListener("click", copiarTexto, false);

bemVindoConsoleLog();
2 changes: 1 addition & 1 deletion styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -741,4 +741,4 @@ textarea::-webkit-scrollbar-thumb{
main{
padding-top: 1.5rem;
}
}
}

0 comments on commit 915ea4c

Please sign in to comment.