diff --git a/index.css b/index.css new file mode 100644 index 0000000..1b64a1f --- /dev/null +++ b/index.css @@ -0,0 +1,169 @@ +body { + color: hsl(186, 14%, 43%); + background-color: hsl(185, 41%, 84%); + font-family: "Space Mono", monospace; + font-weight: 400; + font-style: normal; + margin: 0; + padding: 0; +} + +.firstContainer { + display: flex; + flex-direction: column; + align-items: center; + margin: auto; /*center the elements in the container*/ + text-align: center; + padding: 2rem; + width: 90%; + max-width: 50rem; +} + +.calculator { + margin-top: 2rem; + background-color: white; + display: flex; + flex-wrap: wrap; /*responsive*/ + align-items: center; + justify-content: space-between; + padding: 1rem; + border-radius: 0.625rem; +} + +.input-bill { + flex: 1; + min-width: 15rem; /* adjust to smaller screens */ + display: flex; + flex-direction: column; + gap: 1rem; + text-align: left; + padding: 1rem; +} + +.output-bill{ + flex: 1; + min-width: 15rem; /*adjust to smaller screens*/ +} + + +.input-icon { + position: relative; + width: 100%; +} + +.input-icon input { + background-color: hsl(189, 41%, 97%); + width: 70%; + padding-left: 2.5rem; + padding-right: 1rem; + height: 2rem; + font-size: 1rem; + border: 0.063rem solid #ccc; + border-radius: 0.5rem; +} + +.input-icon img { + position: absolute; + top: 50%; + left: 0.625rem; + height: 1rem; + transform: translateY(-50%); + width: auto; + pointer-events: none; +} + +.tip-btn { + display: inline-flex; + gap: 0.5rem; + margin-top: 0.5rem; + width: 6rem; + height: 2.5rem; + cursor: pointer; + background-color: hsl(183, 100%, 15%); + color: white; + border: none; + font-family: "Space Mono", monospace; + font-weight: 400; + font-style: normal; + border-radius: 0.5rem; + justify-content: center; + padding: 0.5rem; +} + +.tip-btn:hover { + background-color: hsl(172, 67%, 45%); +} + +#custom-btn:hover { + background-color: hsl(172, 67%, 45%); +} + +#custom-btn { + background-color: hsl(189, 41%, 97%); + color: hsl(186, 14%, 43%); + font-family: "Space Mono", monospace; + font-weight: 400; + font-style: normal; +} + +.output-bill{ + text-align: left; + background-color: hsl(183, 100%, 15%); + border-radius: 0.5rem; + padding: 1rem; +} + +#reset-btn { + text-align: center; + width: 90%; + height: 2.5rem; + border: none; + cursor: pointer; + background-color: hsl(172, 67%, 45%); + color: hsl(183, 100%, 15%); + font-family: "Space Mono", monospace; + font-weight: 400; + font-style: normal; + display: block; + margin: 1rem auto; /* center the button*/ + border-radius: 0.5rem; +} + +div h2 { + color: hsl(172, 67%, 45%); +} + +div p span { + color: hsl(186, 14%, 43%); +} + +.results { + display: flex; + justify-content: space-between; +} + +.reset { + margin-top: 5rem; +} + + +@media (max-width: 375px) { + .container { + padding: 1rem; + width: 100%; /* full size in smaller screens */ + } + + .calculator { + flex-direction: column; + gap: 1rem; + } + + .output-bill, + .input-section { + min-width: 100%; /* maximize the space*/ + } + + .tip-btn { + width: 100%; + } +} diff --git a/index.html b/index.html index 5c09e8d..4d14b7c 100644 --- a/index.html +++ b/index.html @@ -5,35 +5,64 @@ - +
Tip Amount
/ person
Total
/ person