From 8f468ed0c98c8fb99af84c4e6fc4f82948780aad Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Mon, 3 Apr 2023 23:39:45 -0400 Subject: [PATCH] Add basis of the content panel - Home buttons - Implement sidebar - Add home title --- src/handbook/src/css/App.scss | 41 +++++++++++++++++++ src/handbook/src/css/Text.scss | 28 +++++++++++++ src/handbook/src/css/views/Content.scss | 32 +++++++++++++++ src/handbook/src/css/views/SideBar.scss | 9 +++++ src/handbook/src/css/widgets/HomeButton.scss | 27 +++++++++++++ src/handbook/src/ui/App.tsx | 14 ++++++- src/handbook/src/ui/views/Content.tsx | 30 ++++++++++++++ src/handbook/src/ui/views/SideBar.tsx | 19 +++++++++ src/handbook/src/ui/widgets/HomeButton.tsx | 42 ++++++++++++++++++++ src/handbook/tsconfig.json | 4 +- 10 files changed, 243 insertions(+), 3 deletions(-) create mode 100644 src/handbook/src/css/App.scss create mode 100644 src/handbook/src/css/Text.scss create mode 100644 src/handbook/src/css/views/Content.scss create mode 100644 src/handbook/src/css/views/SideBar.scss create mode 100644 src/handbook/src/css/widgets/HomeButton.scss create mode 100644 src/handbook/src/ui/views/Content.tsx create mode 100644 src/handbook/src/ui/views/SideBar.tsx create mode 100644 src/handbook/src/ui/widgets/HomeButton.tsx diff --git a/src/handbook/src/css/App.scss b/src/handbook/src/css/App.scss new file mode 100644 index 000000000..360e8b86d --- /dev/null +++ b/src/handbook/src/css/App.scss @@ -0,0 +1,41 @@ +html { + --background-color: #346b77; + --secondary-color: #418493; + + --text-primary-color: #FFFFFF; + + overflow: hidden; +} + +body { + margin: 0; + padding: 0; + height: 100vh; + width: 100%; + overflow: hidden; + + #root { + height: 100%; + width: 100%; + } + + * { + font-family: 'SDK_SC_Web', 'SDK_JP_Web', 'Poppins', sans-serif; + } + + svg:focus { + outline: none; + } +} + +.App { + display: flex; + flex-direction: row; + + width: 100%; + height: 100%; + + div { + display: flex; + } +} diff --git a/src/handbook/src/css/Text.scss b/src/handbook/src/css/Text.scss new file mode 100644 index 000000000..5eae1e523 --- /dev/null +++ b/src/handbook/src/css/Text.scss @@ -0,0 +1,28 @@ +p { + color: var(--text-primary-color); + margin: 0; +} + +h1 { + color: var(--text-primary-color); + font-style: normal; + font-weight: normal; + font-size: 48px; + margin: 0; +} + +h2 { + color: var(--text-primary-color); + font-style: normal; + font-weight: 600; + font-size: 24px; + margin: 0; +} + +h3 { + color: var(--text-primary-color); + font-style: normal; + font-weight: 600; + font-size: 18px; + margin: 0; +} diff --git a/src/handbook/src/css/views/Content.scss b/src/handbook/src/css/views/Content.scss new file mode 100644 index 000000000..d70dd25e3 --- /dev/null +++ b/src/handbook/src/css/views/Content.scss @@ -0,0 +1,32 @@ +.Content { + display: flex; + height: 100%; + width: 100%; + + background-color: var(--background-color); +} + +.Content_Top { + display: flex; + width: 100%; + + flex-direction: column; + align-items: center; +} + +.Content_Title { + margin-top: 31px; + margin-bottom: 39px; +} + +.Content_Buttons { + width: 100%; + height: 40%; + + max-width: 1376px; + max-height: 256px; +} + +.Content_Bottom { + +} diff --git a/src/handbook/src/css/views/SideBar.scss b/src/handbook/src/css/views/SideBar.scss new file mode 100644 index 000000000..6143c2117 --- /dev/null +++ b/src/handbook/src/css/views/SideBar.scss @@ -0,0 +1,9 @@ +.SideBar { + display: flex; + + height: 100%; + width: 100%; + max-width: 300px; + + background-color: var(--secondary-color); +} diff --git a/src/handbook/src/css/widgets/HomeButton.scss b/src/handbook/src/css/widgets/HomeButton.scss new file mode 100644 index 000000000..ec4c04f69 --- /dev/null +++ b/src/handbook/src/css/widgets/HomeButton.scss @@ -0,0 +1,27 @@ +.HomeButton { + display: flex; + flex-direction: column; + + width: 100%; + height: 100%; + max-width: 256px; + max-height: 256px; + + background-color: var(--secondary-color); + + align-items: center; + justify-content: center; + gap: 20px; +} + +.HomeButton_Icon { + max-width: 128px; + max-height: 128px; +} + +.HomeButton_Label { + font-size: 34px; + line-height: 44px; + text-align: center; + font-style: normal; +} diff --git a/src/handbook/src/ui/App.tsx b/src/handbook/src/ui/App.tsx index 8160b631d..d6bb266e5 100644 --- a/src/handbook/src/ui/App.tsx +++ b/src/handbook/src/ui/App.tsx @@ -1,5 +1,14 @@ import React from "react"; +import SideBar from "@views/SideBar"; +import Content from "@views/Content"; + +import "@css/App.scss"; +import "@css/Text.scss"; + +// Based on the design at: https://www.figma.com/file/PDeAVDkTDF5vvUGGdaIZ39/GM-Handbook. +// Currently designed by: Magix. + class App extends React.Component { constructor(props: any) { super(props); @@ -7,8 +16,9 @@ class App extends React.Component { render() { return ( -
-

Hello World!

+
+ +
); } diff --git a/src/handbook/src/ui/views/Content.tsx b/src/handbook/src/ui/views/Content.tsx new file mode 100644 index 000000000..a1b76e28f --- /dev/null +++ b/src/handbook/src/ui/views/Content.tsx @@ -0,0 +1,30 @@ +import React from "react"; + +import "@css/views/Content.scss"; +import HomeButton from "@app/ui/widgets/HomeButton"; + +class Content extends React.Component { + constructor(props: any) { + super(props); + } + + render() { + return ( +
+
+

Welcome Back Traveler!

+ +
+ +
+
+ +
+ +
+
+ ); + } +} + +export default Content; diff --git a/src/handbook/src/ui/views/SideBar.tsx b/src/handbook/src/ui/views/SideBar.tsx new file mode 100644 index 000000000..ae3ef5f3d --- /dev/null +++ b/src/handbook/src/ui/views/SideBar.tsx @@ -0,0 +1,19 @@ +import React from "react"; + +import "@css/views/SideBar.scss"; + +class SideBar extends React.Component { + constructor(props: any) { + super(props); + } + + render() { + return ( +
+

hi!

+
+ ); + } +} + +export default SideBar; diff --git a/src/handbook/src/ui/widgets/HomeButton.tsx b/src/handbook/src/ui/widgets/HomeButton.tsx new file mode 100644 index 000000000..3d6286598 --- /dev/null +++ b/src/handbook/src/ui/widgets/HomeButton.tsx @@ -0,0 +1,42 @@ +import React from "react"; + +import "@css/widgets/HomeButton.scss"; + +interface IProps { + name: string; + anchor: string; +} + +class HomeButton extends React.PureComponent { + 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 ( +
this.redirect()} + > + {this.props.name} + +

{this.props.name}

+
+ ); + } +} + +export default HomeButton; diff --git a/src/handbook/tsconfig.json b/src/handbook/tsconfig.json index ded2a1810..644d7615b 100644 --- a/src/handbook/tsconfig.json +++ b/src/handbook/tsconfig.json @@ -21,7 +21,9 @@ "@app/*": ["src/*"], "@backend/*": ["src/backend/*"], "@css/*": ["src/css/*"], - "@components/*": ["src/ui/*"] + "@components/*": ["src/ui/*"], + "@icons/*": ["src/icons/*"], + "@views/*": ["src/ui/views/*"] } }, "include": ["src"],