Skip to content

Commit 76ae4c9

Browse files
committed
done
1 parent 97cf671 commit 76ae4c9

File tree

6 files changed

+165
-5
lines changed

6 files changed

+165
-5
lines changed

tip-calculator-app-main/dist/css/main.css

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tip-calculator-app-main/dist/css/main.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tip-calculator-app-main/index.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<meta name="author" content="Gift Amachree">
88
<meta name="description" content="frontend-mentor.io Tip calculator app">
99
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
10+
1011
<link rel="stylesheet" href="dist/css/main.css">
1112
<title>Frontend Mentor | Tip calculator app</title>
1213
</head>
@@ -22,7 +23,7 @@ <h1>SPLI <br> TTER</h1>
2223
<h2>Bill</h2>
2324
<div class="screen">
2425
<img src="./images/icon-dollar.svg" alt="dollar Icon">
25-
<input type="text" id="billAmount" placeholder="142.55" pattern="\d*" inputmode="numeric">
26+
<input type="text" id="billAmount" placeholder="0" pattern="\d*" inputmode="numeric">
2627
</div>
2728

2829
<div class="amounts">
@@ -41,9 +42,10 @@ <h3>Select Tip %</h3>
4142

4243
<div class="No-of-people">
4344
<h4>Number of People</h4>
45+
<p id="checker"></p>
4446
<div class="screen">
4547
<img src="./images/icon-person.svg" alt="person icon">
46-
<input type="text" id="people" placeholder="5" pattern="\d*" inputmode="numeric">
48+
<input type="text" id="people" placeholder="0" pattern="\d*" inputmode="numeric">
4749
</div>
4850
</div>
4951
</div>
@@ -69,7 +71,7 @@ <h5>Total</h5>
6971
<div class="price" id="price">$0.00</div>
7072
</div>
7173

72-
<button>RESET</button>
74+
<button type="button" id="btn">RESET</button>
7375
</div>
7476
</section>
7577
</main>
@@ -80,6 +82,8 @@ <h5>Total</h5>
8082
Coded by <a href="https://www.linkedin.com/in/gift-amachree-8a523623b/">Gift Amachree</a>.
8183
</div>
8284
</footer>
85+
86+
<script src="./src/js/main.js"></script>
8387
</body>
8488

8589
</html>

tip-calculator-app-main/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "tip-calculator-app-main",
33
"version": "1.0.0",
44
"description": "![Design preview for the Tip calculator app coding challenge](./design/desktop-preview.jpg)",
5-
"main": "index.js",
5+
"main": "main.js",
66
"scripts": {
77
"compile:sass": "sass src/scss:dist/css",
88
"watch:sass": "sass --watch src/scss:dist/css",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const getTip = document.querySelector('#custom');
2+
const Bill = document.querySelector('#billAmount');
3+
const nOfPeople = document.querySelector('#people');
4+
const btn = document.querySelector('#btn');
5+
const Validation = document.querySelector('#checker');
6+
7+

tip-calculator-app-main/src/scss/main.scss

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@import './base/reset';
22
@import './utils/variables';
33

4+
45
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@700&display=swap');
56

67
body {
@@ -66,6 +67,7 @@ section {
6667
width: 100%;
6768
text-align: right;
6869
outline: none;
70+
caret-color: $Strong-cyan;
6971
}
7072

7173
::placeholder{
@@ -130,6 +132,7 @@ section {
130132
width: 100%;
131133
text-align: right;
132134
outline: none;
135+
caret-color: $button-hover;
133136
}
134137

135138
::placeholder {
@@ -212,6 +215,7 @@ section {
212215
font-weight: 700;
213216
letter-spacing: 0.04rem;
214217
cursor: pointer;
218+
opacity: 0.1;
215219

216220
}
217221
button:hover{
@@ -233,4 +237,94 @@ footer{
233237
.attribution a {
234238
color:$Dark-grayish-cyan;
235239
}
240+
}
241+
242+
@media (min-width: 768px) {
243+
body {
244+
padding: 0 2rem;
245+
}
246+
247+
header {
248+
h1{
249+
margin: 2rem 0;
250+
font-size: 1.3rem;
251+
}
252+
}
253+
254+
section {
255+
display: flex;
256+
flex-direction: row;
257+
justify-content: space-between;
258+
padding: 3rem;
259+
max-width: 1000px;
260+
margin: auto;
261+
gap: 3rem;
262+
263+
264+
.white-background {
265+
width: 100%;
266+
267+
.screen {
268+
input
269+
{
270+
font-size: 1.5rem;
271+
}
272+
273+
img{
274+
width: 16px;
275+
}
276+
277+
}
278+
279+
280+
.amounts{
281+
282+
.discounts{
283+
.custom{
284+
input{
285+
font-size: 1.5rem;
286+
}
287+
288+
}
289+
}
290+
291+
}
292+
}
293+
294+
.green-background {
295+
width: 100%;
296+
padding: 2.5rem 2rem 0 2rem;
297+
298+
button{
299+
margin: 8rem 0 0 0;
300+
padding: 1rem 0;
301+
}
302+
303+
.Tip:nth-of-type(2){
304+
margin-top: 3.3rem;
305+
}
306+
307+
.Tip{
308+
.Tip-total, .Tip-amount
309+
{
310+
311+
h5{
312+
font-size: 1.2rem;
313+
}
314+
}
315+
316+
.price{
317+
font-size: 2rem;
318+
319+
}
320+
}
321+
}
322+
}
323+
324+
footer {
325+
.attribution {
326+
font-size: 1.2rem;
327+
margin-top: 2rem;
328+
}
329+
}
236330
}

0 commit comments

Comments
 (0)