-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
39 lines (34 loc) · 1.2 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function App() {
const [dTest, setdTest] = React.useState(false);
const [cTest, setcTest] = React.useState(false);
const [pcTest, setpcTest] = React.useState(false);
const drum = () => {
setcTest(false);
setpcTest(false);
setdTest(true);
};
const clo = () => {
setdTest(false);
setcTest(false);
setpcTest(true);
};
const calcu = () => {
setpcTest(false);
setdTest(false);
setcTest(true);
};
return(
<div className="main-wrap">
<header className="main-header">
<div className="x-button" onClick={drum} style={{filter: dTest ? 'brightness(150%)' : ''}}>Drum Machine</div>
<div className="x-button" onClick={clo} style={{filter: pcTest ? 'brightness(150%)' : ''}}>25+5 Clock</div>
<div className="x-button" onClick={calcu} style={{filter: cTest ? 'brightness(150%)' : ''}}>Calculator</div>
</header>
<div className="showcase">
{ dTest ? <AppDrum /> : cTest ? <AppCalculator /> : pcTest ? <AppClock /> : 'loading...'}
<p style={{color: 'white', textAlign: 'center'}}>{ (dTest || cTest || pcTest) && 'by: swanktos'}</p>
</div>
</div>
)
}
ReactDOM.render(<App/>, document.getElementById("root"))