Skip to content

Commit 24b618d

Browse files
authored
Merge pull request #12 from jen67/develop
Merging
2 parents 900c53a + 76ae4c9 commit 24b618d

File tree

7 files changed

+234
-9
lines changed

7 files changed

+234
-9
lines changed

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

Lines changed: 84 additions & 1 deletion
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: 10 additions & 4 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-
<p>145.55</p>
26+
<input type="text" id="billAmount" placeholder="0" pattern="\d*" inputmode="numeric">
2627
</div>
2728

2829
<div class="amounts">
@@ -33,15 +34,18 @@ <h3>Select Tip %</h3>
3334
<div>15%</div>
3435
<div>25%</div>
3536
<div>50%</div>
36-
<div class="custom">Custom</div>
37+
<div class="custom">
38+
<input type="text" id="custom" placeholder="Custom" pattern="\d*" inputmode="numeric">
39+
</div>
3740
</div>
3841
</div>
3942

4043
<div class="No-of-people">
4144
<h4>Number of People</h4>
45+
<p id="checker"></p>
4246
<div class="screen">
4347
<img src="./images/icon-person.svg" alt="person icon">
44-
<p>5</p>
48+
<input type="text" id="people" placeholder="0" pattern="\d*" inputmode="numeric">
4549
</div>
4650
</div>
4751
</div>
@@ -67,7 +71,7 @@ <h5>Total</h5>
6771
<div class="price" id="price">$0.00</div>
6872
</div>
6973

70-
<button>RESET</button>
74+
<button type="button" id="btn">RESET</button>
7175
</div>
7276
</section>
7377
</main>
@@ -78,6 +82,8 @@ <h5>Total</h5>
7882
Coded by <a href="https://www.linkedin.com/in/gift-amachree-8a523623b/">Gift Amachree</a>.
7983
</div>
8084
</footer>
85+
86+
<script src="./src/js/main.js"></script>
8187
</body>
8288

8389
</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/base/_reset.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
margin: 0;
33
padding: 0;
44
box-sizing: border-box;
5+
font-family: 'Space Mono', monospace;
56
}

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

Lines changed: 130 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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 {
7-
font-family: 'Space Mono', monospace;
88
display: flex;
99
flex-direction: column;
1010
justify-content: center;
@@ -58,9 +58,26 @@ section {
5858
padding: 1rem;
5959
margin: 0.4rem 0;
6060
border-radius: 0.3rem;
61+
62+
input{
63+
border: none;
64+
background-color: transparent;
65+
font-size: 1rem;
66+
font-weight: 700;
67+
width: 100%;
68+
text-align: right;
69+
outline: none;
70+
caret-color: $Strong-cyan;
71+
}
72+
73+
::placeholder{
74+
color: $Very-dark-cyan;
75+
}
6176
}
6277

6378

79+
80+
6481
.screen img {
6582
width: 10px;
6683
}
@@ -105,9 +122,29 @@ section {
105122
.custom{
106123
background-color:$Very-light-grayish-cyan;
107124
color:$Dark-grayish-cyan;
125+
126+
input {
127+
border: none;
128+
background-color: transparent;
129+
font-size: 1rem;
130+
font-weight: 700;
131+
color: $Very-dark-cyan;
132+
width: 100%;
133+
text-align: right;
134+
outline: none;
135+
caret-color: $button-hover;
136+
}
137+
138+
::placeholder {
139+
color: $Dark-grayish-cyan;
140+
}
141+
142+
input:hover{
143+
border:transparent;
144+
}
108145
}
109146

110-
.custom:hover{
147+
.custom:hover {
111148
background-color:transparent ;
112149
border: 2px solid $button-hover;
113150
}
@@ -178,6 +215,7 @@ section {
178215
font-weight: 700;
179216
letter-spacing: 0.04rem;
180217
cursor: pointer;
218+
opacity: 0.1;
181219

182220
}
183221
button:hover{
@@ -199,4 +237,94 @@ footer{
199237
.attribution a {
200238
color:$Dark-grayish-cyan;
201239
}
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+
}
202330
}

0 commit comments

Comments
 (0)