forked from omiras/ironhack-uf1842
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
75 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
# Extender funcionalidad del contador | ||
# Calcular propina | ||
|
||
1. Añade un input de tipo [number](https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_type_number) para que el usuario pueda introducir un número arbitrario entre -5 y 5. Añade también un botón para añadir la cantidad al contador. | ||
## Qué debemos hacer | ||
|
||
2. Implementa la lógica necesaria para que, al hacer clic en el botón asociado al input, se sume (o reste) el valor del input al contador. | ||
0. Asociar un evento click al botón "Calculate" | ||
1. Obtener el valor que pone el usuario en el campo Bill Amount | ||
2. Obtener el valor que pone el usuario en el campo Percentage Tip | ||
3. Calcular el total de la propina en Tip Amount. | ||
4. Calcular el total de la cuenta en el campo Total | ||
|
||
Recuerda, una cosa cada vez. Realiza varios console.log para ver que vas obteniendo toda la información que esperas | ||
|
||
Colocar el símbolo de la moneda es opcional. | ||
|
||
## Recuerda | ||
|
||
- ¿Cómo obtener el valor de un campo input o establecerlo? Ten en cuenta que TODOS elementos son de tipo _input_ [enlace](https://simpledev.io/lesson/get-input-value-js/) | ||
- Normalmente, el tipo de dato que se obtiene de un control de tipo _input_ es de tipo *string* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// ¿En tu páis de origen es normal dejar propina? |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
h1 { | ||
color: darkcyan; | ||
font-size: 50px; | ||
text-align:center; | ||
|
||
} | ||
|
||
span#tip-word { | ||
color:palevioletred; | ||
} | ||
|
||
div#calculator{ | ||
color: white; | ||
font-size: 35px; | ||
width: 600px; | ||
background-color: rgb(48, 48, 168); | ||
border-radius: 25px; | ||
padding: 50px; | ||
margin: auto; | ||
} | ||
label{ | ||
display:inline-block; | ||
width: 300px; | ||
margin-right: 25px; | ||
padding: 15px; | ||
} | ||
|
||
input{ | ||
margin-right: 50px; | ||
width: 100px; | ||
height: 25px; | ||
padding: 2.5px 40px; | ||
text-align: center; | ||
} | ||
|
||
#calculate{ | ||
background-color: rgb(236, 46, 46); | ||
color: white; | ||
border: none; | ||
border-radius: 15px; | ||
width: 150px; | ||
height: 35px; | ||
font-size: 25px; | ||
margin: 25px 200px 15px 200px; | ||
} |