Compare commits
3 Commits
0645c7f572
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82bd8786cc | ||
|
|
9148676625 | ||
| eda5b94d6c |
42
calculator/index.html
Normal file
42
calculator/index.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<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=Roboto+Mono&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<title>Calculator</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="calculator">
|
||||
<input type="text" id="display" disabled />
|
||||
|
||||
<button class="clear">C</button>
|
||||
<button>←</button>
|
||||
<button class="operator">÷</button>
|
||||
|
||||
<button>7</button>
|
||||
<button>8</button>
|
||||
<button>9</button>
|
||||
<button class="operator">×</button>
|
||||
|
||||
<button>4</button>
|
||||
<button>5</button>
|
||||
<button>6</button>
|
||||
<button class="operator">-</button>
|
||||
|
||||
<button>1</button>
|
||||
<button>2</button>
|
||||
<button>3</button>
|
||||
<button class="operator">+</button>
|
||||
|
||||
<button class="zero">0</button>
|
||||
<button class="operator">=</button>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
59
calculator/style.css
Normal file
59
calculator/style.css
Normal file
@@ -0,0 +1,59 @@
|
||||
body {
|
||||
font-family: "Roboto Mono", monospace;
|
||||
font-optical-sizing: auto;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.calculator {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||
border-collapse: collapse;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
#display {
|
||||
grid-column: 1 / 5;
|
||||
height: 100px;
|
||||
width: 400px;
|
||||
background-color: black;
|
||||
color: white;
|
||||
text-align: right;
|
||||
font-size: 75px;
|
||||
}
|
||||
|
||||
button {
|
||||
height: 100px;
|
||||
font-size: 50px;
|
||||
background-color: #d8d9db;
|
||||
border: 1px solid black;
|
||||
padding: 0;
|
||||
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #ebebeb;
|
||||
}
|
||||
|
||||
.operator {
|
||||
background-color: #df974c;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.operator:hover {
|
||||
background-color: #dfb07e;
|
||||
}
|
||||
|
||||
.clear {
|
||||
grid-column: 1 / 3;
|
||||
}
|
||||
|
||||
.zero {
|
||||
grid-column: 1 / 4;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user