diff --git a/.gitignore b/.gitignore index e69de29b..90420288 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,153 @@ + +node_modules/bootstrap/scss/vendor/_rfs.scss +node_modules/bootstrap/scss/utilities/_visibility.scss +node_modules/bootstrap/scss/utilities/_text.scss +node_modules/bootstrap/scss/utilities/_stretched-link.scss +node_modules/bootstrap/scss/utilities/_spacing.scss +node_modules/bootstrap/scss/utilities/_sizing.scss +node_modules/bootstrap/scss/utilities/_shadows.scss +node_modules/bootstrap/scss/utilities/_screenreaders.scss +node_modules/bootstrap/scss/utilities/_position.scss +node_modules/bootstrap/scss/utilities/_overflow.scss +node_modules/bootstrap/scss/utilities/_float.scss +node_modules/bootstrap/scss/utilities/_flex.scss +node_modules/bootstrap/scss/utilities/_embed.scss +node_modules/bootstrap/scss/utilities/_display.scss +node_modules/bootstrap/scss/utilities/_clearfix.scss +node_modules/bootstrap/scss/utilities/_borders.scss +node_modules/bootstrap/scss/utilities/_background.scss +node_modules/bootstrap/scss/utilities/_align.scss +node_modules/bootstrap/scss/mixins/_visibility.scss +node_modules/bootstrap/scss/mixins/_transition.scss +node_modules/bootstrap/scss/mixins/_text-truncate.scss +node_modules/bootstrap/scss/mixins/_text-hide.scss +node_modules/bootstrap/scss/mixins/_text-emphasis.scss +node_modules/bootstrap/scss/mixins/_table-row.scss +node_modules/bootstrap/scss/mixins/_size.scss +node_modules/bootstrap/scss/mixins/_screen-reader.scss +node_modules/bootstrap/scss/mixins/_resize.scss +node_modules/bootstrap/scss/mixins/_reset-text.scss +node_modules/bootstrap/scss/mixins/_pagination.scss +node_modules/bootstrap/scss/mixins/_nav-divider.scss +node_modules/bootstrap/scss/mixins/_lists.scss +node_modules/bootstrap/scss/mixins/_list-group.scss +node_modules/bootstrap/scss/mixins/_image.scss +node_modules/bootstrap/scss/mixins/_hover.scss +node_modules/bootstrap/scss/mixins/_grid.scss +node_modules/bootstrap/scss/mixins/_grid-framework.scss +node_modules/bootstrap/scss/mixins/_gradients.scss +node_modules/bootstrap/scss/mixins/_forms.scss +node_modules/bootstrap/scss/mixins/_float.scss +node_modules/bootstrap/scss/mixins/_deprecate.scss +node_modules/bootstrap/scss/mixins/_clearfix.scss +node_modules/bootstrap/scss/mixins/_caret.scss +node_modules/bootstrap/scss/mixins/_buttons.scss +node_modules/bootstrap/scss/mixins/_breakpoints.scss +node_modules/bootstrap/scss/mixins/_box-shadow.scss +node_modules/bootstrap/scss/mixins/_border-radius.scss +node_modules/bootstrap/scss/mixins/_badge.scss +node_modules/bootstrap/scss/mixins/_background-variant.scss +node_modules/bootstrap/scss/mixins/_alert.scss +node_modules/bootstrap/scss/bootstrap.scss +node_modules/bootstrap/scss/bootstrap-reboot.scss +node_modules/bootstrap/scss/bootstrap-grid.scss +node_modules/bootstrap/scss/_variables.scss +node_modules/bootstrap/scss/_utilities.scss +node_modules/bootstrap/scss/_type.scss +node_modules/bootstrap/scss/_transitions.scss +node_modules/bootstrap/scss/_tooltip.scss +node_modules/bootstrap/scss/_toasts.scss +node_modules/bootstrap/scss/_tables.scss +node_modules/bootstrap/scss/_spinners.scss +node_modules/bootstrap/scss/_root.scss +node_modules/bootstrap/scss/_reboot.scss +node_modules/bootstrap/scss/_progress.scss +node_modules/bootstrap/scss/_print.scss +node_modules/bootstrap/scss/_popover.scss +node_modules/bootstrap/scss/_pagination.scss +node_modules/bootstrap/scss/_navbar.scss +node_modules/bootstrap/scss/_nav.scss +node_modules/bootstrap/scss/_modal.scss +node_modules/bootstrap/scss/_mixins.scss +node_modules/bootstrap/scss/_media.scss +node_modules/bootstrap/scss/_list-group.scss +node_modules/bootstrap/scss/_jumbotron.scss +node_modules/bootstrap/scss/_input-group.scss +node_modules/bootstrap/scss/_images.scss +node_modules/bootstrap/scss/_grid.scss +node_modules/bootstrap/scss/_functions.scss +node_modules/bootstrap/scss/_forms.scss +node_modules/bootstrap/scss/_dropdown.scss +node_modules/bootstrap/scss/_custom-forms.scss +node_modules/bootstrap/scss/_code.scss +node_modules/bootstrap/scss/_close.scss +node_modules/bootstrap/scss/_carousel.scss +node_modules/bootstrap/scss/_card.scss +node_modules/bootstrap/scss/_buttons.scss +node_modules/bootstrap/scss/_button-group.scss +node_modules/bootstrap/scss/_breadcrumb.scss +node_modules/bootstrap/scss/_badge.scss +node_modules/bootstrap/scss/_alert.scss +node_modules/bootstrap/README.md +node_modules/bootstrap/package.json +node_modules/bootstrap/LICENSE +node_modules/bootstrap/js/src/util.js +node_modules/bootstrap/js/src/tooltip.js +node_modules/bootstrap/js/src/tools/sanitizer.js +node_modules/bootstrap/js/src/toast.js +node_modules/bootstrap/js/src/tab.js +node_modules/bootstrap/js/src/scrollspy.js +node_modules/bootstrap/js/src/popover.js +node_modules/bootstrap/js/src/modal.js +node_modules/bootstrap/js/src/index.js +node_modules/bootstrap/js/src/dropdown.js +node_modules/bootstrap/js/src/collapse.js +node_modules/bootstrap/js/src/carousel.js +node_modules/bootstrap/js/src/button.js +node_modules/bootstrap/js/src/alert.js +node_modules/bootstrap/js/dist/util.js.map +node_modules/bootstrap/js/dist/util.js +node_modules/bootstrap/js/dist/tooltip.js.map +node_modules/bootstrap/js/dist/tooltip.js +node_modules/bootstrap/js/dist/toast.js.map +node_modules/bootstrap/js/dist/toast.js +node_modules/bootstrap/js/dist/tab.js.map +node_modules/bootstrap/js/dist/tab.js +node_modules/bootstrap/js/dist/scrollspy.js.map +node_modules/bootstrap/js/dist/scrollspy.js +node_modules/bootstrap/js/dist/popover.js.map +node_modules/bootstrap/js/dist/popover.js +node_modules/bootstrap/js/dist/modal.js.map +node_modules/bootstrap/js/dist/modal.js +node_modules/bootstrap/js/dist/index.js.map +node_modules/bootstrap/js/dist/index.js +node_modules/bootstrap/js/dist/dropdown.js.map +node_modules/bootstrap/js/dist/dropdown.js +node_modules/bootstrap/js/dist/collapse.js.map +node_modules/bootstrap/js/dist/collapse.js +node_modules/bootstrap/js/dist/carousel.js.map +node_modules/bootstrap/js/dist/carousel.js +node_modules/bootstrap/js/dist/button.js.map +node_modules/bootstrap/js/dist/button.js +node_modules/bootstrap/js/dist/alert.js.map +node_modules/bootstrap/js/dist/alert.js +node_modules/bootstrap/dist/js/bootstrap.min.js.map +node_modules/bootstrap/dist/js/bootstrap.min.js +node_modules/bootstrap/dist/js/bootstrap.js.map +node_modules/bootstrap/dist/js/bootstrap.js +node_modules/bootstrap/dist/js/bootstrap.bundle.min.js.map +node_modules/bootstrap/dist/js/bootstrap.bundle.min.js +node_modules/bootstrap/dist/js/bootstrap.bundle.js.map +node_modules/bootstrap/dist/js/bootstrap.bundle.js +node_modules/bootstrap/dist/css/bootstrap.min.css.map +node_modules/bootstrap/dist/css/bootstrap.min.css +node_modules/bootstrap/dist/css/bootstrap.css.map +node_modules/bootstrap/dist/css/bootstrap.css +node_modules/bootstrap/dist/css/bootstrap-reboot.min.css.map +node_modules/bootstrap/dist/css/bootstrap-reboot.min.css +node_modules/bootstrap/dist/css/bootstrap-reboot.css.map +node_modules/bootstrap/dist/css/bootstrap-reboot.css +node_modules/bootstrap/dist/css/bootstrap-grid.min.css.map +node_modules/bootstrap/dist/css/bootstrap-grid.min.css +node_modules/bootstrap/dist/css/bootstrap-grid.css.map +node_modules/bootstrap/dist/css/bootstrap-grid.css diff --git a/tareas/clase-6/tarea-6-sergio.html b/tareas/clase-6/tarea-6-sergio.html new file mode 100644 index 00000000..ab7b5869 --- /dev/null +++ b/tareas/clase-6/tarea-6-sergio.html @@ -0,0 +1,25 @@ + + + + + + + Clase 6 + + + +

Calculadora de la familia

+ +
+

+ + +
+ +

+
+ +
+ + + diff --git a/tareas/clase-6/tarea-6-sergio.js b/tareas/clase-6/tarea-6-sergio.js new file mode 100644 index 00000000..655dcdb6 --- /dev/null +++ b/tareas/clase-6/tarea-6-sergio.js @@ -0,0 +1,99 @@ +/* +TAREA: Empezar preguntando cuánta gente hay en el grupo familiar. +Crear tantos inputs+labels como gente haya para completar la edad de cada integrante. +Al hacer click en "calcular", mostrar en un elemento pre-existente la mayor edad, +la menor edad y el promedio del grupo familiar. + +Punto bonus: Crear un botón para "empezar de nuevo" que empiece el proceso nuevamente, + borrando los inputs ya creados (investigar cómo en MDN). +*/ + +function calcularMayor(array){ + let contenedor = array[0]; + for (i = 0; i < array.length; i++){ + if (contenedor < array[i]){ + contenedor = array[i]; + } + } + return contenedor; +} + +function calcularMenor(array){ + let contenedor = array[0]; + for (i = 0; i < array.length; i++){ + if (contenedor > array[i]){ + contenedor = array[i]; + } + } + return contenedor +} + +function calcularPromedio(array){ + let contenedor = 0; + for (i = 0; i < array.length; i++){ + contenedor = contenedor + array[i]; + + } + let prom = (contenedor / array.length); + return prom; +} + +let $botonOk = document.querySelector('#boton-ok'); +let divFamilia = document.querySelector('#div-familia'); +$botonOk.onclick = function(){ + + let cantidadIntegrantes = Number(document.querySelector('#cantidad-integrantes').value); + + + for (i= 0; i < cantidadIntegrantes; i++){ + let div = document.createElement('div'); + let label = document.createElement('label'); + let input = document.createElement('input'); + label.textContent = 'Edad del integrante nro ' + (i+1); + + div.appendChild(label); + div.appendChild(input); + divFamilia.appendChild(div); + } + + let $botonCalcular = document.createElement('button'); + $botonCalcular.innerHTML = 'Calcular'; + $botonCalcular.id = 'boton-calcular'; + divFamilia.appendChild($botonCalcular); + + let $botonReiniciar = document.createElement('button'); + $botonReiniciar.innerHTML = 'Reiniciar'; + $botonReiniciar.id = 'boton-reiniciar'; + divFamilia.appendChild($botonReiniciar); + + $botonReiniciar.onclick = function(){ + location.reload(); + } + + + + $botonCalcular.onclick = function(){ + edadesFamilia = document.querySelectorAll('div > input'); + let arrayEdadesFamilia = []; + + for (let i = 0; i < edadesFamilia.length; i++){ + arrayEdadesFamilia.push(Number(edadesFamilia[i].value)); + } + + let menor = calcularMenor(arrayEdadesFamilia); + let mayor = calcularMayor(arrayEdadesFamilia); + let promedio = calcularPromedio(arrayEdadesFamilia); + console.log(promedio); + + let pResultados = document.createElement('p'); + + pResultados.textContent = `El mayor es ${mayor}, el menor es ${menor} y el promedio es ${promedio}`; + divFamilia.appendChild(pResultados); + + + + + } + + return false +} diff --git a/tareas/clase-6/tarea-clase-6.js b/tareas/clase-6/tarea-clase-6.js index dc058824..e86646af 100644 --- a/tareas/clase-6/tarea-clase-6.js +++ b/tareas/clase-6/tarea-clase-6.js @@ -1,16 +1,33 @@ /* TAREA: Empezar preguntando cuánta gente hay en el grupo familiar. Crear tantos inputs+labels como gente haya para completar la edad de cada integrante. -Al hacer click en "calcular", mostrar en un elemento pre-existente la mayor edad, la menor edad y el promedio del grupo familiar. +Al hacer click en "calcular", mostrar en un elemento pre-existente la mayor edad, +la menor edad y el promedio del grupo familiar. -Punto bonus: Crear un botón para "empezar de nuevo" que empiece el proceso nuevamente, borrando los inputs ya creados (investigar cómo en MDN). +Punto bonus: Crear un botón para "empezar de nuevo" que empiece el proceso nuevamente, + borrando los inputs ya creados (investigar cómo en MDN). */ -/* -TAREA: -Crear una interfaz que permita agregar ó quitar (botones agregar y quitar) inputs+labels para completar el salario anual de cada integrante de la familia que trabaje. -Al hacer click en "calcular", mostrar en un elemento pre-existente el mayor salario anual, menor salario anual, salario anual promedio y salario mensual promedio. +let $botonOk = document.querySelector('#boton-ok'); +let divFamilia = document.querySelector('#div-familia'); +$botonOk.onclick = function(){ -Punto bonus: si hay inputs vacíos, ignorarlos en el cálculo (no contarlos como 0). -*/ + let cantidadIntegrantes = Number(document.querySelector('#cantidad-integrantes').value); + console.log(cantidadIntegrantes); + + for (i= 0; i < cantidadIntegrantes.length; i++){ + let div = document.createElement('div'); + let label = document.createElement('label'); + label.textContent = 'Edad del integrante nro'; + + div.appendChild(label); + divFamilia.appendChild(div); + } + + + + + + return false +}