Implement handbook sidebar

only works on desktops atm, mobile support is non-existant
This commit is contained in:
KingRainbow44 2023-04-04 21:42:24 -04:00
parent 1d03100dcc
commit 30c8d01c9e
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE
4 changed files with 102 additions and 1 deletions

View File

@ -1,9 +1,31 @@
.SideBar { .SideBar {
display: flex; display: flex;
flex-direction: column;
height: 100%; height: 100%;
width: 100%; width: 100%;
max-width: 300px; max-width: 300px;
background-color: var(--secondary-color); background-color: var(--secondary-color);
gap: 40px;
}
.SideBar_Title {
margin-top: 42px;
line-height: 41px;
font-size: 34px;
max-width: 256px;
max-height: 128px;
text-align: center;
align-self: center;
}
.SideBar_Buttons {
display: flex;
flex-direction: column;
padding-left: 27px;
gap: 15px;
} }

View File

@ -0,0 +1,26 @@
.SideBarButton {
display: flex;
flex-direction: row;
gap: 15px;
width: 100%;
height: 64px;
max-width: 300px;
max-height: 64px;
align-items: center;
}
.SideBarButton_Icon {
max-width: 64px;
max-height: 64px;
}
.SideBarButton_Label {
font-size: 22px;
line-height: 29px;
font-style: normal;
max-width: 220px;
}

View File

@ -1,6 +1,7 @@
import React from "react"; import React from "react";
import "@css/views/SideBar.scss"; import "@css/views/SideBar.scss";
import SideBarButton from "@app/ui/widgets/SideBarButton";
class SideBar extends React.Component<any, any> { class SideBar extends React.Component<any, any> {
constructor(props: any) { constructor(props: any) {
@ -10,7 +11,17 @@ class SideBar extends React.Component<any, any> {
render() { render() {
return ( return (
<div className={"SideBar"}> <div className={"SideBar"}>
<p>hi!</p> <h1 className={"SideBar_Title"}>The Ultimate Anime Game Handbook</h1>
<div className={"SideBar_Buttons"}>
<SideBarButton name={"Commands"} anchor={"commands"} />
<SideBarButton name={"Characters"} anchor={"avatars"} />
<SideBarButton name={"Items"} anchor={"items"} />
<SideBarButton name={"Entities"} anchor={"monsters"} />
<SideBarButton name={"Scenes"} anchor={"scenes"} />
<SideBarButton name={"Quests"} anchor={"quests"} />
<SideBarButton name={"Achievements"} anchor={"achievements"} />
</div>
</div> </div>
); );
} }

View File

@ -0,0 +1,42 @@
import React from "react";
import "@css/widgets/SideBarButton.scss";
interface IProps {
name: string;
anchor: string;
}
class SideBarButton extends React.PureComponent<IProps> {
constructor(props: IProps) {
super(props);
}
/**
* Redirects the user to the specified anchor.
* @private
*/
private redirect(): void {
// TODO: Implement navigator system.
window.location.href = `/${this.props.anchor}`;
}
render() {
return (
<div
className={"SideBarButton"}
onClick={() => this.redirect()}
>
<img
className={"SideBarButton_Icon"}
src={"https://dummyimage.com/128x128"}
alt={this.props.name}
/>
<p className={"SideBarButton_Label"}>{this.props.name}</p>
</div>
);
}
}
export default SideBarButton;