Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto:350" rel="stylesheet">
<link rel = "stylesheet" href = "styles/index.css" type = "text/css" />
<meta charset="utf-8">
</head>
<body>
<div class="calculator">
<button class="calculator-prompt">0</button>
<button class="calculator-button">AC</button>
<button class="calculator-button">±</button>
<button class="calculator-button">%</button>
<button class="calculator-button">÷</button>
<button class="calculator-button">7</button>
<button class="calculator-button">8</button>
<button class="calculator-button">9</button>
<button class="calculator-button">X</button>
<button class="calculator-button">4</button>
<button class="calculator-button">5</button>
<button class="calculator-button">6</button>
<button class="calculator-button">-</button>
<button class="calculator-button">1</button>
<button class="calculator-button">2</button>
<button class="calculator-button">3</button>
<button class="calculator-button">+</button>
<button class="calculator-button">0</button>
<button class="calculator-button">.</button>
<button class="calculator-button">=</button>
</div>
</body>
</html>
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "mac-calculator-clone",
"version": "1.0.0",
"description": "Replicate the builtin Mac calculator as a web app.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/AdamB37/mac-calculator-clone.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/AdamB37/mac-calculator-clone/issues"
},
"homepage": "https://github.com/AdamB37/mac-calculator-clone#readme",
"dependencies": {
"normalize.css": "^6.0.0"
}
}
77 changes: 77 additions & 0 deletions styles/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
.calculator {
display: flex;
height: 321px;
width: 233.5px;
flex-wrap: wrap;
}
.calculator-row {
display: flex;
flex-direction: row;
height: 15%;
}
.calculator-prompt {
height: 25%;
width: 100%;
background-color: rgb(153, 153, 153);
border: 0;
outline: 0;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
text-align: right;
padding-right: 6%;
padding-top: 8%;
color: white;
font-size: 35.5pt;
font-weight: 100;
}
.calculator-prompt:active {
background-color: rgb(153, 153, 153);
border: 0;
}
.calculator-button {
height: 15%;
width: 25%;
background-color: rgb(225,225,225);
outline: 0;
border-top: 0;
border-right: 0;
border-bottom: 1px;
border-left: 1px;
border-color: rgb(153, 153, 153);
border-style: solid;
font-size: 17pt;
font-family: 'Roboto', sans-serif;
}

.calculator-button:active {
background-color: rgb(178,178,178);
}

.calculator-button:nth-child(18) {
height: 15%;
width: 50%;
border-bottom-left-radius: 5px;
text-align: left;
padding-left: 11%;
}

.calculator-button:nth-child(5),
.calculator-button:nth-child(9),
.calculator-button:nth-child(13),
.calculator-button:nth-child(17),
.calculator-button:nth-child(20) {
background-color: rgb(223,145,60);
color: white;
}

.calculator-button:nth-child(5):active,
.calculator-button:nth-child(9):active,
.calculator-button:nth-child(13):active,
.calculator-button:nth-child(17):active,
.calculator-button:nth-child(20):active {
background-color: rgb(186, 119, 56);
}

.calculator-button:nth-child(20) {
border-bottom-right-radius: 5px;
}