Skip to content

Commit

Permalink
Add dedicated home page
Browse files Browse the repository at this point in the history
  • Loading branch information
RedstoneWizard08 committed Mar 21, 2023
1 parent 150ab99 commit 6e03bbb
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 90 deletions.
9 changes: 9 additions & 0 deletions app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ export const App = () => {
}
/>

<AsyncRoute
path="/spacewarp"
getComponent={() =>
import("./routes/SpaceWarp").then(
(m) => m.SpaceWarp
)
}
/>

<AsyncRoute
path="/instances"
getComponent={() =>
Expand Down
16 changes: 9 additions & 7 deletions app/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ export const Header = () => {
setMods(/\/mods?(\/\d+)?/i.test(router.path!));

setManage(router.path == "/manage");
setSpacewarp(router.path == "/" || router.path == "/install");
setSpacewarp(router.path == "/spacewarp" || router.path == "/install");
}, [router.path]);

return (
<div className="header">
<img
className="logo"
src={logo}
alt="insert space warp logo here"
/>
<Link className="logo-link" href="/">
<img
className="logo"
src={logo}
alt="insert space warp logo here"
/>
</Link>

<Link className={`link ${spacewarp ? "active" : ""}`} href="/">
<Link className={`link ${spacewarp ? "active" : ""}`} href="/spacewarp">
<i className="icon fa-solid fa-rocket" />
SpaceWarp
</Link>
Expand Down
67 changes: 0 additions & 67 deletions app/src/routes/Home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,78 +5,11 @@
padding: 0;

user-select: none;

background-color: #1f2120;

.container {
display: flex;
justify-content: center;
align-items: center;
height: 55vh;
}

.logo {
width: 65%;
border-radius: 8px;
user-select: none;
}

.title {
width: 100%;
user-select: none;
text-align: center;
}

.actions {
width: 80%;
padding: 2% 10%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-evenly;
}

.action {
border: 2px solid #3c3c3e;
border-radius: 4px;
background-color: transparent;
user-select: none;
color: #dddfdc;
font-family: "manteka", serif;

width: 30%;
padding: 1.5% 0;

margin-top: 2%;
margin-left: 35%;

cursor: pointer;
outline: none;
transition: color 0.5s ease, background-color 0.5s ease;

&:hover {
background-color: #3c3c3e;
}

&#uninstall {
background-color: #c04040;
color: #dddfdc;

&:hover {
background-color: #803030;
}
}

&#launch {
background-color: #409040;
color: #dddfdc;

width: 15%;
margin-left: 42.5%;

&:hover {
background-color: #107010;
}
}
}
}
16 changes: 0 additions & 16 deletions app/src/routes/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
import "./Home.scss";
import banner from "../assets/background_banner.png";
import { route } from "preact-router";

export const Home = () => {
const doInstall = () => {
route("/install", true);
};

return (
<div className="home-container">
<div class="container">
<img src={banner} alt="Space Warp Logo" className="logo" />
</div>

<br />

<h1 className="title">Welcome to Wormhole</h1>

<button type="button" className="action" onClick={doInstall}>
Install SpaceWarp
</button>
</div>
);
};
82 changes: 82 additions & 0 deletions app/src/routes/SpaceWarp.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
.spacewarp-container {
width: 100%;
height: 100%;
margin: 0;
padding: 0;

user-select: none;

background-color: #1f2120;

.container {
display: flex;
justify-content: center;
align-items: center;
height: 55vh;
}

.logo {
width: 65%;
border-radius: 8px;
user-select: none;
}

.title {
width: 100%;
user-select: none;
text-align: center;
}

.actions {
width: 80%;
padding: 2% 10%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-evenly;
}

.action {
border: 2px solid #3c3c3e;
border-radius: 4px;
background-color: transparent;
user-select: none;
color: #dddfdc;
font-family: "manteka", serif;

width: 30%;
padding: 1.5% 0;

margin-top: 2%;
margin-left: 35%;

cursor: pointer;
outline: none;
transition: color 0.5s ease, background-color 0.5s ease;

&:hover {
background-color: #3c3c3e;
}

&#uninstall {
background-color: #c04040;
color: #dddfdc;

&:hover {
background-color: #803030;
}
}

&#launch {
background-color: #409040;
color: #dddfdc;

width: 15%;
margin-left: 42.5%;

&:hover {
background-color: #107010;
}
}
}
}
21 changes: 21 additions & 0 deletions app/src/routes/SpaceWarp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import "./SpaceWarp.scss";
import banner from "../assets/background_banner.png";
import { route } from "preact-router";

export const SpaceWarp = () => {
const doInstall = () => {
route("/install", true);
};

return (
<div className="spacewarp-container">
<div class="container">
<img src={banner} alt="Space Warp Logo" className="logo" />
</div>

<button type="button" className="action" onClick={doInstall}>
Install SpaceWarp
</button>
</div>
);
};

0 comments on commit 6e03bbb

Please sign in to comment.