Skip to content

Commit

Permalink
Modifique la identacion de index analyzer y style
Browse files Browse the repository at this point in the history
corregi la identacion en index analyzer y style
borre algunos comentarios que tenia
y en el README corregi la descripcion de las imagenes del prototipo
  • Loading branch information
AGonzalesHuamani committed Jan 6, 2024
1 parent ffefbe5 commit 00ae386
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 25 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ obtener una comprensión más profunda de los textos.

## 3. Prototipo

a. primero hice un prototipo a mano alzada
b. luego hice otro usando Figma
Primero hice un prototipo a mano alzada
y luego hice otro usando Figma

![prototipo1](proto1.jpeg)
![prototipo2](proto2.png)
Expand Down
9 changes: 1 addition & 8 deletions src/analyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,16 @@ const analyzer = {
}
return numberSum;
},

getAverageWordLength: (text) => {
//TODO: esta función debe retornar la longitud media de palabras que se encuentran en el parámetro `text` de tipo `string`.
// const word = text.split("").length;
// const word2 = analyzer.getWordCount(text);
// const promedio = word / word2;
// return promedio;

const word = text.trim().split(/\s+/g)
let suma = 0
for (let i = 0; i < word.length; i++) {
suma += word[i].length;
}
const getAverageWordLength = suma / word.length;
return Math.round(getAverageWordLength*100)/100;



},

};
Expand Down
14 changes: 7 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ const characterCount = document.querySelector("li[data-testid='character-count']
const characterNoSpaces = document.querySelector("li[data-testid='character-no-spaces-count']");
const numberCount = document.querySelector("li[data-testid='number-count']");
const numberSum = document.querySelector("li[data-testid='number-sum']");
const wordLengthAverage = document.querySelector("li[data-testid='word-length-average']");
const wordLengthAverage = document.querySelector("li[data-testid='word-length-average']";

const resetButton = document.getElementById("reset-button");
resetButton.addEventListener("click", function limpiar() {
//limpiar todo el contenido del textarea
textArea.value = '';
// limpiar las Metricas a 0
wordCount.innerHTML = "palabras 0"
characterCount.innerHTML = "caracteres 0"
characterNoSpaces.innerHTML = "caracteres sin espacios 0"
numberCount.innerHTML = "números 0"
numberSum.innerHTML = "suma total de números 0"
wordLengthAverage.innerHTML = "promedio longitud 0"
wordCount.innerHTML = "palabras 0";
characterCount.innerHTML = "caracteres 0";
characterNoSpaces.innerHTML = "caracteres sin espacios 0";
numberCount.innerHTML = "números 0";
numberSum.innerHTML = "suma total de números 0";
wordLengthAverage.innerHTML = "promedio longitud 0";
})

textArea.addEventListener("input", function actualizarMetricas() {
Expand Down
9 changes: 1 addition & 8 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ header {
font-family: cursive, sans-serif;
color: #34045A;
text-align: center;

}

main {
Expand All @@ -23,18 +22,13 @@ main {
justify-content: center;
text-align: center;
align-items: center;


}

textarea[name="user-input"] {
border: none;
border-radius: 15px;
text-align: justify;
padding: 20px;



}


Expand All @@ -50,8 +44,7 @@ textarea[name="user-input"] {
margin: 10px;
list-style: none;
padding: 10px;
text-align: justify;

text-align: justify;
}

#reset-button {
Expand Down

0 comments on commit 00ae386

Please sign in to comment.