-
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 torobucci/components
Math magicians :Components
- Loading branch information
Showing
18 changed files
with
135 additions
and
171 deletions.
There are no files selected for viewing
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
Binary file not shown.
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
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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,26 @@ | ||
function Buttons() { | ||
return ( | ||
<> | ||
<button type="button" className="button">A/C</button> | ||
<button type="button" className="button">+/-</button> | ||
<button type="button" className="button">%</button> | ||
<button type="button" className="button operator">÷</button> | ||
<button type="button" className="button">7</button> | ||
<button type="button" className="button">8</button> | ||
<button type="button" className="button">9</button> | ||
<button type="button" className="button operator">x</button> | ||
<button type="button" className="button">4</button> | ||
<button type="button" className="button">5</button> | ||
<button type="button" className="button">6</button> | ||
<button type="button" className="button operator">-</button> | ||
<button type="button" className="button">1</button> | ||
<button type="button" className="button">2</button> | ||
<button type="button" className="button">3</button> | ||
<button type="button" className="button operator">+</button> | ||
<button type="button" className="button zero">0</button> | ||
<button type="button" className="button">.</button> | ||
<button type="button" className="button operator">=</button> | ||
</> | ||
); | ||
} | ||
export default Buttons; |
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 Buttons from './Buttons'; | ||
|
||
function DisplayCalculator() { | ||
return ( | ||
<div className="calculator"> | ||
<input type="text" placeholder="0" className="input" /> | ||
<Buttons /> | ||
</div> | ||
); | ||
} | ||
export default DisplayCalculator; |
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 |
---|---|---|
@@ -1,17 +1,11 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import './index.css'; | ||
import './style.css'; | ||
import App from './App'; | ||
import reportWebVitals from './reportWebVitals'; | ||
|
||
const root = ReactDOM.createRoot(document.getElementById('root')); | ||
root.render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
); | ||
|
||
// If you want to start measuring performance in your app, pass a function | ||
// to log results (for example: reportWebVitals(console.log)) | ||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals | ||
reportWebVitals(); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,73 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #928d8d; | ||
} | ||
|
||
.calculator { | ||
width: 35vw; | ||
margin: 12vh auto; | ||
background-color: #d4cfcf; | ||
border-radius: 3px; | ||
padding: 2px 4px; | ||
display: grid; | ||
grid-template-columns: repeat(4, 1fr); | ||
grid-gap: 2px; | ||
} | ||
|
||
.input { | ||
grid-column: 1 / span 4; | ||
background-color: #6b6974; | ||
font-size: 26px; | ||
color: white; | ||
padding: 20px 5px; | ||
border-radius: 2px; | ||
height: 30%; | ||
border: none; | ||
margin-bottom: -14px; | ||
} | ||
|
||
input:focus { | ||
outline: none; | ||
} | ||
|
||
.input::placeholder { | ||
text-align: right; | ||
color: white; | ||
} | ||
|
||
.button { | ||
height: 10vh; | ||
font-size: 1.5rem; | ||
background-color: #e6dfdf; | ||
border-radius: 2px; | ||
cursor: pointer; | ||
border: none; | ||
} | ||
|
||
.button:hover { | ||
background-color: #faf5f5; | ||
} | ||
|
||
.button:active { | ||
background-color: #aaa; | ||
} | ||
|
||
.button.operator { | ||
background-color: #ee9954; | ||
} | ||
|
||
.button.operator:hover { | ||
background-color: #ee7d1b; | ||
} | ||
|
||
.button.operator:active { | ||
background-color: #a34d17; | ||
} | ||
|
||
.button.zero { | ||
grid-column: 1 / span 2; | ||
} | ||
|
||
.button.equals { | ||
grid-row: span 2; | ||
} |