add react

This commit is contained in:
2025-02-02 00:58:28 -05:00
parent ead9309e30
commit f5f335ff33
16 changed files with 258 additions and 31 deletions

View File

@ -0,0 +1,21 @@
---
interface Props {
href: string,
display: string,
color?: string
}
const {href, display, color = "transparent"} = Astro.props
---
<button style={`background-color: ${color}`}>
<a href={href}>{display}</a>
</button>
<style lang="scss">
button {
height: 100%;
padding: 0 20px 0 20px;
&:hover { background-color: var(--hf-button-hover-color) }
}
</style>

View File

@ -0,0 +1,46 @@
---
---
<footer>
<p class="raw-text" id="time">00:00:00</p>
<section>
<p class="raw-text" id="column-line">0, 0</p>
<button id="toggle-monospace">Monospace</button>
<button id="toggle-term-mode">UNIX</button>
</section>
<noscript>
<style>
#toggle-monospace, .raw-text { display: none }
</style>
</noscript>
</footer>
<style lang="scss">
@use "../scss/variables";
footer {
display: flex;
justify-content: space-between;
align-items: center;
width: 100vw;
height: variables.$footer-Y;
background-color: var(--body-background-color)
}
p {
padding: 0 20px 0 20px;
}
section {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
button {
height: 100%;
padding: 0 20px 0 20px;
&:hover { background-color: var(--hf-button-hover-color) }
}
}
#toggle-term-mode { background-color: rgb(0,50,90) }
</style>

View File

@ -0,0 +1,28 @@
---
import Button from './button.astro'
import { Links } from '../ts/links';
---
<header>
<Button href={Links.Self} display="[rhpidfyre.io]" color="black"/>
<section>
<Button href={Links.Git} display="REPOS"/>
<Button href={Links.Cloud} display="CLOUD"/>
<Button href={Links.Gsm} display="GSM"/>
</section>
</header>
<style lang="scss">
@use "../scss/variables";
header {
display: flex;
justify-content: space-between;
width: 100vw;
height: variables.$header-Y;
background-color: rgb(10,10,10);
p { margin-left: 10px; }
}
section { height: 100%; }
</style>

View File

@ -0,0 +1,3 @@
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width"/>
<meta name="generator" content={Astro.generator}/>

View File

View File

@ -1,22 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>Astro Basics</title>
</head>
<body>
<slot />
</body>
</html>
<style>
html,
body {
margin: 0;
width: 100%;
height: 100%;
}
</style>

63
src/layouts/Webpage.astro Normal file
View File

@ -0,0 +1,63 @@
---
import Metas from "../components/metas.astro"
import Header from "../components/header.astro"
import Footer from "../components/footer.astro"
interface Props {
title: string,
}
const {title} = Astro.props
---
<!doctype html>
<html lang="en">
<head>
<Metas/>
<link rel="icon" type="image/png" href="/logo.png"/>
<title>{`rhpidfyre.io | ${title}`}</title>
</head>
<body>
<Header title={title}/>
<slot/>
<Footer/>
</body>
</html>
<style is:global lang="scss">
@forward "../scss/fonts";
@forward "../scss/terminal";
* {
font-family: 'Terminus', monospace;
font-size: 15px;
letter-spacing: 2px;
cursor: text;
}
:root {
color-scheme: dark;
--body-background-color: rgb(0,0,0);
--hf-button-hover-color: rgb(50,50,50);
}
::selection {
background-color: rgb(255,255,255);
color: rgb(0,0,0);
}
body {
box-sizing: border-box;
margin: 0;
overflow: hidden;
background-color: var(--body-background-color);
}
button {
background-color: transparent;
border: 0;
}
a {
color: white;
cursor: unset;
&:hover, &:active, &:link { text-decoration: none; }
}
</style>

View File

@ -1,7 +1,57 @@
---
import Layout from '../layouts/Layout.astro';
import Webpage from '../layouts/Webpage.astro';
import { Links } from '../ts/links';
---
<Layout>
<Webpage title="Home">
<main>
<p>Welcome to rhpidfyre.io!</p>
<div class="return"></div>
<p>This is a personal website by rhpidfyre / Brandon.</p>
<p>You can find my services here or learn about me.</p>
<div class="return"></div>
<p>You can also contribute or view the source code of my website via the links:</p>
<p>{"<"}<a href={Links.RepoGitea} target="_blank">{Links.RepoGitea}</a>{">."}</p>
<p>{"<"}<a href={Links.RepoGithub} target="_blank">{Links.RepoGithub}</a>{">."}</p>
<div class="return"></div>
<p>You can get started with the command: help</p>
<div class="return"></div>
<noscript>
<p><span class="red">=================================================</span></p>
<p><span class="red">JavaScript is disabled, functionality will be limited. :(</span></p>
<p><span class="red">But, you will not be limited at exploring my services which you can find by navigating towards the top-right.</span></p>
<p><span class="red">=================================================</span></p>
</noscript>
</main>
</Webpage>
</Layout>
<style lang="scss">
@use "../scss/variables";
@mixin text-styles {
.red { color: rgb(200,0,0); }
.green { color: rgb(0,200,0); }
.blue { color: rgb(0,0,200); }
}
:global(main) {
width: 100vw;
height: calc(99.3vh - variables.$header-Y - variables.$footer-Y);
padding: 5px;
overflow-y: auto;
p {
@include text-styles;
font-size: 1.2rem;
margin: 5px;
a {
font-size: inherit;
&:hover { text-decoration: underline; }
}
}
.return {
margin-top: 25px;
}
}
</style>

7
src/scss/fonts.scss Normal file
View File

@ -0,0 +1,7 @@
@font-face {
font-display: swap;
font-family: 'Terminus';
font-style: normal;
font-weight: 500;
src: url('/Terminus.woff2') format('woff2');
}

0
src/scss/terminal.scss Normal file
View File

3
src/scss/variables.scss Normal file
View File

@ -0,0 +1,3 @@
$header-Y: 30px;
$footer-Y: 30px;
$component-padding: 20px;

10
src/ts/links.ts Normal file
View File

@ -0,0 +1,10 @@
const enum Links {
Self = "https://rhpidfyre.io/",
Cloud = "https://files.rhpidfyre.io/",
Gsm = "https://gsm.rhpidfyre.io/",
Git = "https://git.rhpidfyre.io/",
RepoGitea = "https://git.rhpidfyre.io/rhpidfyre/rhpidfyre.io/",
RepoGithub = "https://github.com/unixtensor/rhpidfyre.io/"
}
export { Links }