main
Ashelyn Dawn 3 years ago
parent ba8f44c4c8
commit 0217b0d310

@ -0,0 +1,5 @@
[build]
target = "index.html"
release = true
dist = "dist"
public_url = "/~ashe/preview/"

@ -2,11 +2,12 @@
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ashe@tilde.club</title>
<script src="https://unpkg.com/ansi_up@5.1.0/ansi_up.js"></script>
</head>
<body>
<div class="container">
<div id="container">
<div id="target"></div>
</div>
<style>
@ -29,10 +30,10 @@
align-items: center;
justify-content: center;
min-height: 100vh;
background: black;
background: #392e41;
}
.container {
#container {
background: var(--background-color);
white-space: pre-wrap;
word-break: break-all;
@ -42,6 +43,7 @@
position: relative;
overflow: hidden;
user-select: none;
box-shadow: 0 5px 5px -3px rgb(0 0 0 / 20%), 0 8px 10px 1px rgb(0 0 0 / 14%), 0 3px 14px 2px rgb(0 0 0 / 12%);
}
#target {
@ -71,5 +73,21 @@
}
}
</style>
<script>
function scale() {
const container = document.getElementById('container');
const height = window.innerHeight;
const width = window.innerWidth;
const scaleX = width / 600;
const scaleY = height / 450;
const scale = 0 || Math.min(scaleX, scaleY);
container.style.transform = `scale(${scale})`;
}
window.addEventListener('resize', scale);
scale();
</script>
</body>
</html>

@ -0,0 +1,14 @@
# Ashe
Hello friend! 💜
My name is Ashe, but in various places around the
internet I also go by Tempest or Dawn.
## Who am I?
A trans mother, wife, and web developer. (she/her)
I make websites and other dreams for computers,
primarily with JS but also occasionally Rust, C#, or
even bash.

@ -0,0 +1,9 @@
# ashe.gay
This is my personal blog - I use this to post my
thoughts, experiences, and occasionally bad poetry.
Built with:
- [React](https://reactjs.org/)
- [NextJS](https://nextjs.org/)
- [Gitlab Pages](https://gitlab.com/pages)

@ -0,0 +1,12 @@
# Contact me
## IRC
I hang out on tilde.chat as <ashe>, and on Libera
as <tempest>
## Email
I check ashe@tilde.club every once in a while, I
also have ashe@tempest.dev that I check much more
regularly.

@ -0,0 +1,10 @@
# tempest.dev
This is my development blog - I haven't updated it in
a while, but intend to come back to it and post
guides, write-ups, experiments, etc.
Built with:
- [React](https://reactjs.org/)
- [NextJS](https://nextjs.org/)
- [Docker](https://www.docker.com/)

@ -0,0 +1,12 @@
# tilde.club/~ashe/
That's this page!
This was built as something of an experiment, just to
see if I _could_. This obviously isn't a real server
environment, but if you thought it was for a moment
then I consider this a success.
Built with:
- [Rust](https://www.rust-lang.org/)
- [wasm-bindgen](https://docs.rs/wasm-bindgen/)

@ -2,8 +2,14 @@ use std::str::FromStr;
use crate::{Directory, State};
static PROJECTS_DIR: &'static str = "stuff";
static HOME_DIR: &'static str = "projects";
static PROJECTS_DIR: &'static str = "~ashe ashe.gay tempest.dev";
static HOME_DIR: &'static str = "about.md contact.md \x1b[0;36mprojects\x1b[0m";
static ABOUT: &'static str = include_str!("../res/about.md");
static CONTACT: &'static str = include_str!("../res/contact.md");
static ASHE_GAY: &'static str = include_str!("../res/ashe.gay.md");
static TEMPEST_DEV: &'static str = include_str!("../res/tempest.dev.md");
static TILDE_ASHE: &'static str = include_str!("../res/~ashe.md");
pub fn handle_command(command_string : String, state : &mut State) {
let mut words = command_string.split(' ');
@ -78,9 +84,54 @@ pub fn handle_command(command_string : String, state : &mut State) {
_ => state.output.push_back(format!("bash: ls: too many arguments"))
}
}
"cat" => match args.len() {
0 => state.output.push_back(format!("bash: cat: too few arguments")),
1 => match state.current_working_directory {
Directory::Home => match args[0] {
"about.md" => output_file(ABOUT, args[0], state),
"contact.md" => output_file(CONTACT, args[0], state),
"projects/ashe.gay" => output_file(ASHE_GAY, args[0], state),
"projects/tempest.dev" => output_file(TEMPEST_DEV, args[0], state),
"projects/~ashe" => output_file(TILDE_ASHE, args[0], state),
_ => state.output.push_back(format!("bash: cat: {}: No such file or directory", args[0]))
},
Directory::Projects => match args[0] {
"../about.md" => output_file(ABOUT, args[0], state),
"../contact.md" => output_file(CONTACT, args[0], state),
"ashe.gay" => output_file(ASHE_GAY, args[0], state),
"tempest.dev" => output_file(TEMPEST_DEV, args[0], state),
"~ashe" => output_file(TILDE_ASHE, args[0], state),
_ => state.output.push_back(format!("bash: cat: {}: No such file or directory", args[0]))
},
},
_ => state.output.push_back(format!("bash: cat: too many arguments"))
},
_ => {
state.output.push_back(format!("bash: {}: command not found", command));
}
}
}
fn output_file(file_string : &str, path : &str, state : &mut State) {
let header = "───────┬───────────────────────────────────────────────────────";
let divider = "───────┼───────────────────────────────────────────────────────";
let footer = "───────┴───────────────────────────────────────────────────────";
state.print(String::from_str(header).unwrap());
state.print(format!(" │ File: {}", path));
state.print(String::from_str(divider).unwrap());
let lines = file_string.split('\n');
for (index, line) in lines.enumerate() {
if index == 0 && line == "" {
state.print(format!(" {:<2} │ {}", index + 1, "\x1b[0;33m<empty>\x1b[0m"));
} else {
state.print(format!(" {:<2} │ {}", index + 1, line));
}
}
state.print(String::from_str(footer).unwrap());
}

@ -77,7 +77,7 @@ pub fn handle_key_event(state : &mut State, key : Key) -> Option<String> {
return None
}
#[wasm_bindgen(inline_js = "const ansi_up = new AnsiUp; export function format_html(text) { return ansi_up.ansi_to_html(text).replace(/(https:[^ ]*)/g, '<a href=\"$1\" target=\"_blank\">$1</a>') }")]
#[wasm_bindgen(inline_js = "const ansi_up = new AnsiUp; export function format_html(text) { return ansi_up.ansi_to_html(text).replace(/(https:[^ )]*)/g, '<a href=\"$1\" target=\"_blank\">$1</a>') }")]
extern "C" {
fn format_html(text : String) -> String;
}

@ -42,6 +42,14 @@ impl State {
current_working_directory: Directory::Home
}
}
pub fn print(&mut self, line : String) {
self.output.push_back(line);
if self.output.len() > self.max_rows {
self.output.pop_front();
}
}
}
fn main() {

Loading…
Cancel
Save