|
| 1 | +/* App.css */ |
| 2 | + |
| 3 | +body { |
| 4 | + background: linear-gradient(to right, #e3f2fd, #bbdefb); |
| 5 | + font-family: 'Roboto', sans-serif; |
| 6 | + display: flex; |
| 7 | + justify-content: center; |
| 8 | + align-items: center; |
| 9 | + height: 100vh; |
| 10 | + margin: 0; |
| 11 | + overflow: hidden; /* Prevents scrollbars from appearing */ |
| 12 | +} |
| 13 | + |
| 14 | +.calculator-body { |
| 15 | + max-width: 420px; |
| 16 | + margin: 20px; |
| 17 | + padding: 30px; |
| 18 | + background: linear-gradient(135deg, #ffffff, #f7f9fc); |
| 19 | + border-radius: 20px; |
| 20 | + box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); |
| 21 | + text-align: center; |
| 22 | + transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s; |
| 23 | +} |
| 24 | + |
| 25 | +.calculator-body:hover { |
| 26 | + transform: scale(1.03); |
| 27 | + box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25); |
| 28 | + background-color: #f4f6f8; /* Slightly changes background color on hover */ |
| 29 | +} |
| 30 | + |
| 31 | +h1 { |
| 32 | + color: #1e88e5; |
| 33 | + margin-bottom: 20px; |
| 34 | + font-weight: 700; |
| 35 | + letter-spacing: 2px; |
| 36 | + font-size: 2.5em; |
| 37 | + text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); |
| 38 | +} |
| 39 | + |
1 | 40 | .result {
|
2 |
| - height: 60px; |
3 |
| - background-color: #bbb; |
4 |
| - width: 100%; |
| 41 | + height: 80px; |
| 42 | + background-color: #ffffff; |
| 43 | + border-radius: 12px; |
| 44 | + margin-bottom: 20px; |
| 45 | + display: flex; |
| 46 | + align-items: center; |
| 47 | + justify-content: center; |
| 48 | + box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.1); |
| 49 | + border: 1px solid #e0e0e0; |
5 | 50 | }
|
6 | 51 |
|
7 | 52 | .result p {
|
8 | 53 | font-size: 40px;
|
9 |
| - margin: 5px; |
10 |
| - |
| 54 | + color: #212121; |
| 55 | + margin: 0; |
| 56 | + font-weight: 600; |
| 57 | + letter-spacing: 1px; |
11 | 58 | }
|
12 | 59 |
|
13 |
| -.calculator-body { |
14 |
| - max-width: 400px; |
15 |
| - margin: auto; |
| 60 | +.keypad { |
| 61 | + display: flex; |
| 62 | + flex-wrap: wrap; |
| 63 | + justify-content: center; |
16 | 64 | }
|
17 | 65 |
|
18 | 66 | .button {
|
19 |
| - display: block; |
20 |
| - background-color: #bbb; |
| 67 | + background: linear-gradient(145deg, #66bb6a, #4CAF50); |
| 68 | + border: none; |
| 69 | + color: white; |
| 70 | + padding: 15px 25px; |
| 71 | + margin: 8px; |
| 72 | + text-align: center; |
| 73 | + display: inline-block; |
| 74 | + font-size: 24px; |
| 75 | + border-radius: 12px; |
| 76 | + cursor: pointer; |
| 77 | + box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15); |
| 78 | + transition: background 0.3s, transform 0.1s, box-shadow 0.3s; |
| 79 | +} |
| 80 | + |
| 81 | +.button:hover { |
| 82 | + background: linear-gradient(145deg, #5ebd5b, #45a049); |
| 83 | + transform: translateY(-2px); |
| 84 | + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); |
| 85 | +} |
| 86 | + |
| 87 | +button:focus { |
| 88 | + outline: none; |
| 89 | + box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.6); |
21 | 90 | }
|
22 | 91 |
|
23 |
| -button { |
24 |
| - width: 25%; |
25 |
| - height: 60px; |
26 |
| - font-size: 30px; |
| 92 | +button:active { |
| 93 | + background: linear-gradient(145deg, #4CAF50, #66bb6a); |
| 94 | + transform: translateY(1px); /* Slightly move down on press */ |
27 | 95 | }
|
0 commit comments