-
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 Micky373/react_components
Finalize the component branch
- Loading branch information
Showing
11 changed files
with
99 additions
and
136 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": ["stylelint-config-standard"], | ||
"plugins": ["stylelint-scss", "stylelint-csstree-validator"], | ||
"rules": { | ||
"at-rule-no-unknown": null, | ||
"scss/at-rule-no-unknown": true, | ||
"csstree/validator": true | ||
}, | ||
"ignoreFiles": ["build/**", "dist/**", "**/reset*.css", "**/bootstrap*.css", "**/*.js", "**/*.jsx"] | ||
} |
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,46 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
body { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
} | ||
button { | ||
border: 1px solid #dadada; | ||
font-size: 2rem; | ||
padding: 1rem; | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
.calculator_container { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
align-items: center; | ||
margin-top: 25%; | ||
} | ||
|
||
.display { | ||
align-self: flex-end; | ||
background-color: #6b705c; | ||
width: 100%; | ||
height: 4rem; | ||
} | ||
|
||
h1 { | ||
margin: 0 0 0 80%; | ||
padding: 1rem; | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
.button_container { | ||
display: grid; | ||
grid-template-columns: repeat(4, 1fr); | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
.item0 { | ||
grid-column-start: 1; | ||
grid-column-end: 3; | ||
} | ||
|
||
to { | ||
transform: rotate(360deg); | ||
} | ||
.operator { | ||
background-color: #e85d04; | ||
} |
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,29 +1,20 @@ | ||
import logo from './logo.svg'; | ||
import React from 'react'; | ||
import Calculator from './components/calculator'; | ||
import './App.css'; | ||
|
||
function App() { | ||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<img src={logo} className="App-logo" alt="logo" /> | ||
<p> | ||
Edit | ||
{' '} | ||
<code>src/App.js</code> | ||
{' '} | ||
and save to reload. | ||
</p> | ||
<a | ||
className="App-link" | ||
href="https://reactjs.org" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn React | ||
</a> | ||
</header> | ||
</div> | ||
); | ||
class App extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = {}; | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className="App"> | ||
<Calculator /> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default App; |
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,41 @@ | ||
import React from 'react'; | ||
|
||
class Calculator extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = {}; | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className="calculator_container"> | ||
<div className="display"> | ||
<h1>0</h1> | ||
</div> | ||
<div className="button_container"> | ||
<button type="button" className="button">AC</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 item0">0</button> | ||
<button type="button" className="button">.</button> | ||
<button type="button" className="button operator">=</button> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Calculator; |
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,10 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './index.css'; | ||
import App from './App'; | ||
import reportWebVitals from './reportWebVitals'; | ||
|
||
ReactDOM.render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
document.getElementById('root'), | ||
); | ||
|
||
// 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.