From f85674dd25fbf9286ebe774dfc38fd4216d82e16 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Sun, 8 May 2022 18:10:30 -0700 Subject: [PATCH] button component --- src/ui/App.css | 11 ++++++++ src/ui/App.tsx | 8 +++++- src/ui/components/TopBar.tsx | 2 +- src/ui/components/common/BigButton.css | 33 +++++++++++++++++++++++ src/ui/components/common/BigButton.tsx | 37 ++++++++++++++++++++++++++ 5 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 src/ui/components/common/BigButton.css create mode 100644 src/ui/components/common/BigButton.tsx diff --git a/src/ui/App.css b/src/ui/App.css index 776442a..d187aa2 100644 --- a/src/ui/App.css +++ b/src/ui/App.css @@ -1,5 +1,16 @@ body { user-select: none; + height: 100vh; +} + +#root, .App { + height: 100%; +} + +.App { + background-image: url("https://webstatic.hoyoverse.com/upload/event/2020/11/04/7fd661b5184e1734f91f628b6f89a31f_7367318474207189623.png"); + background-repeat: no-repeat; + background-size: cover; } .TopButton { diff --git a/src/ui/App.tsx b/src/ui/App.tsx index 4dd5590..0fdfc75 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -1,15 +1,21 @@ import React from 'react' import logo from './logo.svg' import './App.css' +import './custom.css' // Major Components import Topbar from './components/TopBar' +import BigButton from './components/common/BigButton' + +function playGame() { + alert('cum') +} function App() { return (
- +
) } diff --git a/src/ui/components/TopBar.tsx b/src/ui/components/TopBar.tsx index 9c28cb4..e8b130d 100644 --- a/src/ui/components/TopBar.tsx +++ b/src/ui/components/TopBar.tsx @@ -22,7 +22,7 @@ export default class TopBar extends React.Component {
Cultivation - v0.0.1 + v0.1.0
diff --git a/src/ui/components/common/BigButton.css b/src/ui/components/common/BigButton.css new file mode 100644 index 0000000..c62146f --- /dev/null +++ b/src/ui/components/common/BigButton.css @@ -0,0 +1,33 @@ +.BigButton { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + + padding: 0 30px; + border-radius: 5px; + border: none; + background: linear-gradient(#ffd326, #ffc61e); + color: #704a1d; + font-weight: bold; + + height: 60px; + max-width: 20%; + + font-size: 20px; +} + +.BigButton:hover { + cursor: pointer; + background: linear-gradient(#ffc61e, #ffd326); +} + +.BigButton.disabled { + background: linear-gradient(#9c9c9c, #949494); + color: rgb(226, 226, 226); + cursor: default; +} + +.BigButton.disabled:hover { + background: linear-gradient(#949494, #9c9c9c); +} \ No newline at end of file diff --git a/src/ui/components/common/BigButton.tsx b/src/ui/components/common/BigButton.tsx new file mode 100644 index 0000000..e89f09f --- /dev/null +++ b/src/ui/components/common/BigButton.tsx @@ -0,0 +1,37 @@ +import React from 'react' +import './BigButton.css' + +interface IProps { + text: string; + onClick: () => any; + id: string; +} + +interface IState { + text: string; +} + +export default class BigButton extends React.Component { + + constructor(props: { text: string, onClick: () => any, id: string }) { + super(props) + + this.state = { + text: props.text + } + + this.handleClick = this.handleClick.bind(this) + } + + handleClick() { + this.props.onClick() + } + + render() { + return ( +
+
{this.state.text}
+
+ ) + } +} \ No newline at end of file