Eliminar
60 | 61 |¿Deseas continuar?
62 | 68 |├── .gitignore ├── assets ├── css │ ├── editar_cliente.css │ ├── register_client.css │ ├── register_product.css │ ├── lista_cliente.css │ ├── componentes │ │ ├── card.css │ │ ├── header.css │ │ ├── button.css │ │ ├── modal.css │ │ ├── table.css │ │ └── inputs.css │ ├── error_general.css │ ├── register_complete.css │ ├── edicion_concluida.css │ └── base │ │ ├── _variables.css │ │ ├── base.css │ │ └── _reset.css └── img │ ├── checkmark.svg │ ├── denied.svg │ └── doguitoadm.svg ├── db.json ├── README.md ├── package.json ├── service └── client-service.js └── screens ├── error.html ├── registro_completado.html ├── edicion_concluida.html ├── lista_cliente.html ├── registrar_cliente.html ├── editar_cliente.html └── registrar_producto.html /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /assets/css/editar_cliente.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/css/register_client.css: -------------------------------------------------------------------------------- 1 | .cadastro { 2 | display: flex; 3 | flex-direction: column; 4 | margin-top: 2rem; 5 | } -------------------------------------------------------------------------------- /db.json: -------------------------------------------------------------------------------- 1 | { 2 | "perfil": [ 3 | { 4 | "nombre": "Christian", 5 | "email": "Christian@alura.com", 6 | "id": 1 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ```js 2 | json-server --watch db.json 3 | ``` 4 | 5 | Browser sync: browser-sync start --server --file . --host --port 5000 --startPath screens/lista_cliente.html 6 | -------------------------------------------------------------------------------- /assets/css/register_product.css: -------------------------------------------------------------------------------- 1 | .register_description { 2 | height: 15.75rem; 3 | } 4 | 5 | .register__price-container, 6 | .register_description-container { 7 | width: 50%; 8 | } 9 | -------------------------------------------------------------------------------- /assets/css/lista_cliente.css: -------------------------------------------------------------------------------- 1 | .clientes-container { 2 | padding-right: 1rem; 3 | padding-left: 1rem; 4 | } 5 | 6 | @media(min-width: 1200px) { 7 | .clientes-container { 8 | padding-left: calc((100vw - 900px)/2); 9 | padding-right: calc((100vw - 900px)/2); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /assets/css/componentes/card.css: -------------------------------------------------------------------------------- 1 | .card { 2 | background-color: var(--contrast-ligth-color); 3 | border-radius: 10px; 4 | box-shadow: var(--shadow); 5 | width: 100%; 6 | max-width: 45rem; 7 | padding: 1.75rem; 8 | box-sizing: border-box; 9 | margin-bottom: 1rem; 10 | } 11 | 12 | .card__title { 13 | font-size: var(--font-size-card-title); 14 | margin-bottom: 1rem; 15 | } 16 | -------------------------------------------------------------------------------- /assets/img/checkmark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/css/componentes/header.css: -------------------------------------------------------------------------------- 1 | .header { 2 | background-color: var(--contrast-ligth-color); 3 | border-radius: 0 0 10px 10px; 4 | box-shadow: var(--shadow); 5 | display: flex; 6 | justify-content: space-between; 7 | align-items: center; 8 | height: 4.75rem; 9 | margin-bottom: 2rem; 10 | } 11 | 12 | .header__logo { 13 | width: 3rem; 14 | } 15 | 16 | .header__list-nav { 17 | display: flex; 18 | } 19 | 20 | .header__link { 21 | margin-left: 2rem; 22 | } 23 | -------------------------------------------------------------------------------- /assets/css/error_general.css: -------------------------------------------------------------------------------- 1 | .register-card { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | text-align: center; 6 | } 7 | 8 | .register-card__icon-complete { 9 | display: block; 10 | width: 3.5rem; 11 | height: 3.5rem; 12 | margin-bottom: 1rem; 13 | background-image: url(../img/denied.svg); 14 | background-size: cover; 15 | background-repeat: no-repeat; 16 | } 17 | 18 | .register-card__title { 19 | max-width: 20rem; 20 | } 21 | -------------------------------------------------------------------------------- /assets/css/register_complete.css: -------------------------------------------------------------------------------- 1 | .register-card { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | text-align: center; 6 | } 7 | 8 | .register-card__icon-complete { 9 | display: block; 10 | width: 3.5rem; 11 | height: 3.5rem; 12 | margin-bottom: 1rem; 13 | background-image: url(../img/checkmark.svg); 14 | background-size: cover; 15 | background-repeat: no-repeat; 16 | } 17 | 18 | .register-card__title { 19 | max-width: 20rem; 20 | } 21 | -------------------------------------------------------------------------------- /assets/css/edicion_concluida.css: -------------------------------------------------------------------------------- 1 | .register-card { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | text-align: center; 6 | } 7 | 8 | .register-card__icon-complete { 9 | display: block; 10 | width: 3.5rem; 11 | height: 3.5rem; 12 | 13 | margin-bottom: 1rem; 14 | 15 | background-image: url(../img/checkmark.svg); 16 | background-size: cover; 17 | background-repeat: no-repeat; 18 | } 19 | 20 | .register-card__title { 21 | max-width: 20rem; 22 | } 23 | -------------------------------------------------------------------------------- /assets/img/denied.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "admin", 3 | "version": "1.0.0", 4 | "description": "1836-crud_js_async project", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/HarlandLohora/1836-CRUD_JS_Async.git" 12 | }, 13 | "keywords": [ 14 | "Alura" 15 | ], 16 | "author": "Harland Lohora", 17 | "license": "ISC", 18 | "bugs": { 19 | "url": "https://github.com/HarlandLohora/1836-CRUD_JS_Async/issues" 20 | }, 21 | "homepage": "https://github.com/HarlandLohora/1836-CRUD_JS_Async#readme" 22 | } 23 | -------------------------------------------------------------------------------- /assets/css/componentes/button.css: -------------------------------------------------------------------------------- 1 | .button { 2 | display: block; 3 | background-color: var(--primary-color); 4 | border-radius: 7px; 5 | width: 100%; 6 | margin-top: 1rem; 7 | max-width: 20rem; 8 | padding: 1.125rem; 9 | box-sizing: border-box; 10 | color: var(--contrast-ligth-color); 11 | font-size: var(--font-size-button); 12 | align-self: center; 13 | text-align: center; 14 | } 15 | 16 | .simple-button { 17 | border: none; 18 | background-color: unset; 19 | } 20 | 21 | .simple-button--add { 22 | color: var(--primary-color); 23 | } 24 | 25 | .simple-button--delete { 26 | color: var(--info-color); 27 | } 28 | 29 | .simple-button--edit { 30 | color: var(--sucess-color); 31 | } 32 | -------------------------------------------------------------------------------- /assets/css/base/_variables.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --font-family: "Montserrat", sans-serif; 3 | --font-family-logo: "Pacifico", cursive; 4 | 5 | --font-input: 300; 6 | 7 | --font-size-logo: 28px; 8 | --font-size-card-title: 28px; 9 | --font-size-input-label: 20px; 10 | --font-size-button: 22px; 11 | --font-size-form-fieldset: 22px; 12 | --font-size-table-header: 22px; 13 | --font-size-modal-title: 28px; 14 | --font-size-modal-button: 28px; 15 | 16 | --primary-color: #0071ea; 17 | --secundary-color: #d6eaff; 18 | --contrast-dark-color: #4d4d4d; 19 | --contrast-ligth-color: #fff; 20 | --info-color: #df2525; 21 | --sucess-color: #047900; 22 | --transparency-color: #4d4d4d33; 23 | 24 | --shadow: 0 5px 10px #55a6ff38; 25 | } 26 | 27 | @media (min-width: 800px) { 28 | :root { 29 | --font-size-logo: 56px; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /assets/css/base/base.css: -------------------------------------------------------------------------------- 1 | @import url(_reset.css); 2 | @import url(_variables.css); 3 | 4 | body { 5 | background-color: var(--secundary-color); 6 | color: var(--contrast-dark-color); 7 | font-family: var(--font-family); 8 | overflow-x: hidden; 9 | } 10 | 11 | .container { 12 | padding-right: 1rem; 13 | padding-left: 1rem; 14 | } 15 | 16 | .flex { 17 | display: flex; 18 | } 19 | 20 | .flex--center { 21 | align-items: center; 22 | justify-content: center; 23 | } 24 | 25 | .flex--column { 26 | flex-direction: column; 27 | } 28 | 29 | @media (min-width: 800px) { 30 | .container { 31 | padding-right: 2.5rem; 32 | padding-left: 2.5rem; 33 | } 34 | } 35 | 36 | @media (min-width: 1200px) { 37 | .container { 38 | padding-left: calc((100vw - 900px) / 2); 39 | padding-right: calc((100vw - 900px) / 2); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /assets/css/componentes/modal.css: -------------------------------------------------------------------------------- 1 | .modal { 2 | background-color: var(--contrast-ligth-color); 3 | border-radius: 10px; 4 | padding: 1.75rem; 5 | box-sizing: border-box; 6 | max-width: 22.5rem; 7 | position: relative; 8 | } 9 | 10 | .modal-container { 11 | background-color: var(--transparency-color); 12 | display: flex; 13 | justify-content: center; 14 | align-items: center; 15 | width: 100vw; 16 | height: 100vh; 17 | position: fixed; 18 | top: 0; 19 | left: 0; 20 | transition: 0.25s; 21 | } 22 | 23 | .modal__title { 24 | font-size: var(--font-size-modal-title); 25 | color: var(--info-color); 26 | margin-bottom: 1rem; 27 | } 28 | 29 | .modal__button { 30 | font-size: var(--font-size-modal-button); 31 | } 32 | 33 | .modal__text { 34 | margin-bottom: 3.875rem; 35 | } 36 | 37 | .modal__button--confirm { 38 | color: var(--info-color); 39 | margin-right: 2.25rem; 40 | } 41 | 42 | .modal__button-container { 43 | display: flex; 44 | } 45 | 46 | .modal__close { 47 | position: absolute; 48 | display: block; 49 | height: 1rem; 50 | width: 1rem; 51 | top: 1.75rem; 52 | right: 1.75rem; 53 | } 54 | 55 | .modal--close { 56 | left: -100vw; 57 | transition: 0.25s; 58 | } 59 | -------------------------------------------------------------------------------- /assets/css/componentes/table.css: -------------------------------------------------------------------------------- 1 | .table { 2 | margin-top: 2.25rem; 3 | width: 100%; 4 | background-color: var(--contrast-ligth-color); 5 | border-radius: 10px; 6 | box-shadow: var(--shadow); 7 | border-collapse: initial; 8 | text-align: left; 9 | } 10 | 11 | .table td:first-of-type, 12 | .table th:first-of-type { 13 | padding-left: 1.75rem; 14 | } 15 | 16 | .table td:last-of-type, 17 | .table th:last-of-type { 18 | padding-right: 1.75rem; 19 | } 20 | 21 | .table thead { 22 | font-size: var(--font-size-table-header); 23 | } 24 | 25 | .table th { 26 | padding-top: 1.75rem; 27 | padding-bottom: 1.75rem; 28 | border-bottom: 1px solid var(--secundary-color); 29 | } 30 | 31 | .table td { 32 | padding-top: 1rem; 33 | padding-bottom: 1rem; 34 | } 35 | 36 | .table__align--right { 37 | text-align: right; 38 | } 39 | 40 | .table__column--p { 41 | width: 20%; 42 | } 43 | 44 | .table__column--m { 45 | width: 25%; 46 | } 47 | 48 | .table__column--g { 49 | width: 50%; 50 | } 51 | 52 | .table tr:last-of-type td { 53 | padding-bottom: 1.75rem; 54 | } 55 | 56 | .table__button-control { 57 | display: flex; 58 | align-items: center; 59 | justify-content: flex-end; 60 | } 61 | 62 | .table__button-control li:first-of-type { 63 | margin-right: 2.25rem; 64 | } 65 | 66 | .td { 67 | padding: 1rem; 68 | } 69 | -------------------------------------------------------------------------------- /service/client-service.js: -------------------------------------------------------------------------------- 1 | //backticks 2 | const crearNuevaLinea = (nombre, email) => { 3 | const linea = document.createElement("tr"); 4 | const contenido = ` 5 |
| Nombre | 45 |47 | Nuevo Cliente 52 | | 53 |
|---|
¿Deseas continuar?
62 | 68 |