Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 174 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
html{
background: hsl(185, 41%, 84%);
font-family: 'Space Mono', monospace;
}

.container{
display: flex;
justify-content: space-between;
flex-direction: row;
background: white;
border-radius: 20px;
padding: 30px;
width: 700px;
margin: 0 auto;
margin-top: 10%;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
color: hsl(186, 14%, 43%);
margin-bottom: 10%;
font-weight: 700;

}


.input-container p {
font-size: 16px;
text-align: left;
font-weight: bold;
}



.dollar-icon {
position: absolute;
left: 26.5%; /* Adjust based on your design */
top: 36.6%;
transform: translateY(-50%);
pointer-events: none; /* Prevent interaction with the symbol */
color: #aaa; /* Adjust color to match your design */
}

.person-icon {
position: absolute;
left: 26.5%; /* Adjust based on your design */
top: 75.7%;
transform: translateY(-50%);
pointer-events: none; /* Prevent interaction with the symbol */
color: #aaa; /* Adjust color to match your design */
}


input {
font-family: 'Space-Mono' ,monospace;
font-weight: bold;
font-display: right;
color: hsl(183, 100%, 15%);
direction: rtl; /* Right to left */
width: 100%;
padding: 10px 10px 10px 30px; /* Padding to leave space for the dollar sign */
font-size: 21px;
border: none;
border-radius: 10px;
box-sizing: border-box;
background-color: hsl(189, 41%, 97%);
}

input::placeholder {
color: hsl(186, 14%, 43%);
}


.selection-container {
text-align: center;
max-width: 300px;
}

.selection-container p {
font-size: 16px;
text-align: left;
margin-bottom: 10px;
font-weight: bold;
}

.tip-buttons {
display: grid;
grid-template-columns: repeat(3, 1fr); /* 3 columns */
gap: 10px; /* Space between items */
}

.tipButton, .customTip {
font-family: 'Space Mono', monospace;
font-weight: bold;
padding: 10px;
font-size: 20px;
border: 1px solid #ccc;
border-radius: 5px;
text-align: center;
box-sizing: border-box;
cursor: pointer;
}

.tipButton {
background-color: hsl(183, 100%, 15%);
color: white;
transition: background-color 0.3s;
}

.tipButton:hover {
background-color: hsl(172, 67%, 45%);
color: hsl(183, 100%, 15%);
}

.customTip {
background-color: hsl(189, 41%, 97%);
font-size: 16px;
width: 100%;
border: 1px solid #ccc;
}

.tip-amount {
display: flex;
justify-content: space-between;

padding: 20px;
background-color: hsl(183, 100%, 15%);
color: white;
}

.total-amount{
display: flex;
justify-content: space-between;
padding: 20px;
background-color: hsl(183, 100%, 15%);
color: white;
}
output {
margin-top: 20px;
font-size: 30px;
font-weight: bold;
color: hsl(172, 67%, 45%);
}


.output-container {
margin-top: 5px;
padding: 20px;
width: 45%;
background-color: hsl(183, 100%, 15%);
border-radius: 10px;
color: white;
}

.tip-amount-value{
margin-top: 0;
font-size: 10px;

}

.total-amount-value{
margin-top: 0;
font-size: 10px;
}

.reset-button{
margin-top: 50px;
width: 100%;
padding: 10px;
font-size: 15px;
border-radius: 10px;
border: none;
text-align: center;
cursor: pointer;
background-color: hsl(172, 67%, 45%);
color: hsl(183, 100%, 15%);
}
72 changes: 52 additions & 20 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,67 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- displays site properly based on user's device -->

<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
<link rel="stylesheet" href="index.css">

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=New+Amsterdam&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap" rel="stylesheet">

<title>Frontend Mentor | Tip calculator app</title>
<title>Tip calculator app</title>

<!-- Feel free to remove these styles or customise in your own stylesheet 👍 -->
<style>
.attribution { font-size: 11px; text-align: center; }
.attribution a { color: hsl(228, 45%, 44%); }
</style>
</head>
<body>

Bill
<div class="container">
<div class="input-container">
<div class="bill-container">
<p>Bill</p>
<img src="images/icon-dollar.svg" alt="Dollar Icon" class="dollar-icon">
<input type="text" id="amountOfBill" class="amountInput">
</div>


<div class="selection-container">
<p>Select Tip %</p>
<div class="tip-buttons">
<button class="tipButton">5%</button>
<button class="tipButton">10%</button>
<button class="tipButton">15%</button>
<button class="tipButton">25%</button>
<button class="tipButton">50%</button>
<input type="text" class="customTip" placeholder="Custom">
</div>
</div>

<div class="people-container">
<p>Number of People</p>
<img src="images/icon-person.svg" alt="Dollar Icon" class="person-icon">
<input type="number" id="numOfPeople" class="peopleInput" placeholder="0">
</div>
</div>


<div class="output-container">

Select Tip %
5%
10%
15%
25%
50%
Custom
<div class="tip-amount">
<div class="output">
<p>Tip Amount</p>
<p class="tip-amount-value">/ person</p>
</div>
<output class="tip-amount-output">$0.0</output>
</div>

Number of People
<div class="total-amount">
<div class="output">
<p>Total</p>
<p class="total-amount-value">/ person</p>
</div>
<output class="total-amount-output">$0.0</output>
</div>

Tip Amount
/ person
<button class="reset-button">RESET</button>
</div>

Total
/ person

Reset
</body>
</html>
Empty file added index.js
Empty file.