Repository navigation
Expand file tree
/
Copy pathstyle.css
More file actions
121 lines (103 loc) · 2.95 KB
/
Copy pathstyle.css
File metadata and controls
121 lines (103 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/* This makes the sytle of the page boujeee af, styles the whole page background and centres teh calculator */
body {
margin: 0;
padding: 0;
min-height: 100vh; /* full screen height */
display: flex; /* flexbox allows for things to be centred easily */
justify-content: center; /* centre horizontally */
align-items: center; /* centre vertically */
background-color: #e0e0e0; /* light grey background */
font-family: Arial, sans-serif; /* nice font */
}
/* Calculator card */
/* the white box that holds everything */
.calculator {
background-color: #ffffff; /* white background */
padding: 30px 40px; /* space inside the card */
border-radius: 6px; /* slightly rounded corners */
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); /* subtle shadow for depth */
width: 340px; /* fixed width for the calculator */
}
/* heading */
h1 {
text-align: center;
font-size: 1.3rem;
margin-top: 0;
margin-bottom: 20px;
color: #000000;
}
/* Input labels and fields */
label {
display: block; /* puts the label on it's own line */
margin-top: 14px;
margin-bottom: 5px;
font-size: 0.85rem;
font-weight: bold;
color: #000000;
}
/* The number input boxes */
input[type="number"] {
width: 100%;
padding: 8px;
font-size: 1rem;
border: 1px solid #cccccc; /* light grey border */
border-radius: 4px;
box-sizing: border-box; /* ensures padding doesn't affect total width */
}
/* instruction text */
.instruction {
text-align: center;
font-size: 0.85rem;
margin-top: 20px;
margin-bottom: 14px;
color: #000000;
}
/* operating buttons*/
/* 2x2 grid layout for the four buttons */
.buttons {
display:grid;
grid-template-columns: 1fr 1fr; /* two equal columns */
gap: 10px; /* space between buttons */
}
/* Individual button styling */
.buttons button {
padding: 12px;
background-color: #3333cc; /* dark blue background */
color: #ffffff; /* white text */
border: none; /* no border */
border-radius: 4px; /* rounded corners */
font-size: 0.95rem;
cursor: pointer; /* pointer cursor on hover */
transition: background-color 0.3s ease; /* smooth hover effect */
}
/* slightly darker blue when hovering */
.buttons button:hover {
background-color: #2222a6; /* darker blue background */
}
/* results section*/
.result-section {
margin-top: 18px;
padding: 14px;
background-color: #f0f0f0; /* light grey background */
border-radius: 4px;
border: 1px solid #cccccc; /* light grey border */
text-align: center;
}
.result-section p {
margin: 0;
font-size: 0.95rem;
color: #000000;
}
/* the actual number result is shown in red */
#result {
color: #cc0000;
font-weight: bold;
}
/* error message */
.error {
color: #cc0000;
font-size: 0.8rem;
text-align: center;
margin-top: 10px;
min-height: 18px; /* creates space for error message */
}