-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from rbd3/add-component
Add component
- Loading branch information
Showing
12 changed files
with
125 additions
and
88 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,4 @@ | ||
.App { | ||
h1 { | ||
margin-left: 20px; | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
|
||
to { | ||
transform: rotate(360deg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
function Button({ label, className }) { | ||
return ( | ||
<button type="button" className={className}> | ||
{label} | ||
</button> | ||
); | ||
} | ||
|
||
Button.propTypes = { | ||
label: PropTypes.isRequired, | ||
className: PropTypes.isRequired, | ||
}; | ||
|
||
export default Button; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
.calculator { | ||
display: grid; | ||
height: 80%; | ||
width: 28rem; | ||
margin: 2% auto 0; | ||
grid-template-columns: repeat(4, 7rem); | ||
grid-template-rows: minmax(6rem, auto) repeat(5, 5rem); | ||
font-family: cursive, sans-serif; | ||
filter: drop-shadow(5px 3px 3px #3f3e3e); | ||
} | ||
|
||
.screen { | ||
grid-column: 1 / -1; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-end; | ||
margin-top: 5%; | ||
margin-bottom: -20%; | ||
} | ||
|
||
button { | ||
width: 100%; | ||
padding: 10px; | ||
background-color: rgb(243, 240, 240); | ||
border: 1px solid rgb(151, 150, 150); | ||
cursor: pointer; | ||
font-size: 25px; | ||
} | ||
|
||
input[type='text'] { | ||
width: 95%; | ||
height: 30%; | ||
color: white; | ||
background-color: rgb(185, 182, 182); | ||
padding: 0.7rem; | ||
text-align: right; | ||
font-size: 50px; | ||
border: none; | ||
border-bottom: 2px solid black; | ||
} | ||
|
||
input[type='text']::placeholder { | ||
color: white; | ||
} | ||
|
||
.span-box { | ||
grid-column: span 2; | ||
} | ||
|
||
.box-color { | ||
background: #fa5b2f; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react'; | ||
import './Calculator.css'; | ||
import Screen from './Screen'; | ||
import Button from './Button'; | ||
|
||
function Calculator() { | ||
return ( | ||
<div className="calculator"> | ||
<Screen /> | ||
<Button label="AC" /> | ||
<Button label="+/-" /> | ||
<Button label="%" /> | ||
<Button label="÷" className="box-color" /> | ||
|
||
<Button label="1" /> | ||
<Button label="2" /> | ||
<Button label="3" /> | ||
<Button label="+" className="box-color" /> | ||
|
||
<Button label="4" /> | ||
<Button label="5" /> | ||
<Button label="6" /> | ||
<Button label="*" className="box-color" /> | ||
|
||
<Button label="7" /> | ||
<Button label="8" /> | ||
<Button label="9" /> | ||
<Button label="-" className="box-color" /> | ||
|
||
<Button label="0" className="span-box" /> | ||
|
||
<Button label="." /> | ||
<Button label="=" className="box-color" /> | ||
</div> | ||
); | ||
} | ||
|
||
export default Calculator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
|
||
function Screen() { | ||
return ( | ||
<div className="screen"> | ||
<input type="text" placeholder="0" /> | ||
</div> | ||
); | ||
} | ||
|
||
export default Screen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,5 @@ | ||
body { | ||
margin: 0; | ||
font-family: | ||
-apple-system, | ||
BlinkMacSystemFont, | ||
'Segoe UI', | ||
'Roboto', | ||
'Oxygen', | ||
'Ubuntu', | ||
'Cantarell', | ||
'Fira Sans', | ||
'Droid Sans', | ||
'Helvetica Neue', | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: | ||
source-code-pro, | ||
Menlo, | ||
Monaco, | ||
Consolas, | ||
'Courier New', | ||
monospace; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.