2024-03-21 20:15:54 -05:00
//! # Rust Info Site
2024-03-17 15:41:48 -05:00
//!
//! Rendering functions for the site using [Dioxus](https://dioxuslabs.com/).
#![ allow(non_snake_case) ]
pub mod components ;
pub mod utils ;
// Urls are relative to your Cargo.toml file
const _TAILWIND_URL : & str = manganis ::mg! ( file ( " public/tailwind.css " ) ) ;
/// A module that handles the functions needed
/// to render the site.
pub mod info_app {
// import the prelude to get access to the `rsx!` macro and the `Scope` and `Element` types
pub use dioxus ::prelude ::* ;
use crate ::components ::basic_page ::* ;
use crate ::components ::home_page ::* ;
use crate ::components ::identity_button ::* ;
use crate ::components ::introduction_card ::* ;
use crate ::components ::page_button ::* ;
use crate ::components ::project_card ::* ;
use crate ::components ::werefox_card ::* ;
2024-03-21 20:15:54 -05:00
use crate ::components ::project_foldable ::* ;
2024-03-17 15:41:48 -05:00
use crate ::utils ::prop_structs ::* ;
use dioxus_router ::prelude ::* ;
#[ derive(Routable, PartialEq, Clone) ]
pub enum Route {
#[ route( " / " ) ]
#[ redirect( " /:..segments " , |segments: Vec<String>| Route::Home {}) ]
Home { } ,
#[ route( " /projects " ) ]
Projects { } ,
#[ route( " /testimonials " ) ]
Testimonials { } ,
#[ route( " /hrt " ) ]
Hrt { } ,
#[ route( " /faq " ) ]
Faq { } ,
#[ route( " /support " ) ]
Support { } ,
}
pub fn DioxusApp ( ) -> Element {
rsx! { Router ::< Route > { } }
}
#[ component ]
/// Renders the app and returns the rendered Element.
pub fn Home ( ) -> Element {
let identity_list = [
(
" 29 " ,
ImageProps {
src : " /emoji/18_plus.svg " . to_string ( ) ,
alt : " Over 18 emoji " . to_string ( ) ,
} ,
) ,
(
" Transfemme " ,
ImageProps {
src : " /emoji/female_symbol.svg " . to_string ( ) ,
alt : " Female symbol emoji " . to_string ( ) ,
} ,
) ,
(
" She/It " ,
ImageProps {
src : " /emoji/speech_bubble_left.svg " . to_string ( ) ,
alt : " A speech bubble emoji " . to_string ( ) ,
} ,
) ,
(
" Pansexual " ,
ImageProps {
src : " /emoji/pansexual_flag.svg " . to_string ( ) ,
alt : " Pansexual flag emoji " . to_string ( ) ,
} ,
) ,
(
" Lesbian " ,
ImageProps {
src : " /emoji/lesbian_flag.svg " . to_string ( ) ,
alt : " Lesbian flag emoji " . to_string ( ) ,
} ,
) ,
(
" Dragon " ,
ImageProps {
src : " /emoji/:alicehappy:.png " . to_string ( ) ,
alt : " Alice happy emoji " . to_string ( ) ,
} ,
) ,
] ;
let project_list = [
(
" Stuff I Do! " ,
Route ::Projects { } ,
ImageProps {
src : " /emoji/crt_prompt.svg " . to_string ( ) ,
alt : " CRT prompt emoji " . to_string ( ) ,
} ,
) ,
(
" See Testimonials! " ,
Route ::Testimonials { } ,
ImageProps {
src : " /emoji/awoo.svg " . to_string ( ) ,
alt : " Awoo emoji " . to_string ( ) ,
} ,
) ,
(
" HRT Tracker! " ,
Route ::Hrt { } ,
ImageProps {
src : " /emoji/trans_heart.png " . to_string ( ) ,
alt : " Transgender heart emoji " . to_string ( ) ,
} ,
) ,
(
" FAQ " ,
Route ::Faq { } ,
ImageProps {
src : " /emoji/red_question_mark.svg " . to_string ( ) ,
alt : " Red question mark emoji " . to_string ( ) ,
} ,
) ,
(
" Support Me? " ,
Route ::Support { } ,
ImageProps {
src : " /emoji/green_money.svg " . to_string ( ) ,
alt : " Green money emoji " . to_string ( ) ,
} ,
) ,
] ;
rsx! {
HomePage { page_title : " About a Werefox " , card_title : " Hi! I'm Alice Werefox! " ,
WerefoxCard { card_title : " Basic Info " . to_string ( ) , title_emoji : None ,
div { class : " grid xl:grid-rows-1 xl:grid-cols-6 sm:grid-rows-2 sm:grid-cols-3 grid-rows-9 grid-cols-1 sm:gap-2 gap-0 " ,
for e in identity_list {
IdentityButton { button_text : e . 0 , image_props : e . 1 }
}
}
}
WerefoxCard { card_title : " Welcome to my little info site! " , title_emoji : None , IntroductionCard { } }
WerefoxCard { card_title : " Neat Pages! " , title_emoji : None ,
div { class : " flex flex-col space-y-4 " ,
for e in project_list {
PageButton { button_text : e . 0 , button_route : e . 1 , image_props : e . 2 }
}
}
}
}
}
}
#[ component ]
pub fn Projects ( ) -> Element {
let project_list = [
(
" Streaming " ,
" I stream regularly! Sometimes randomizers, sometimes just a chill time with a fun game. " ,
" https://twitch.tv/alice_werefox " ,
ImageProps {
src : " /emoji/twitch-logo.png " . to_string ( ) ,
alt : " Twitch logo " . to_string ( ) ,
} ,
) ,
(
" Poetry " ,
" Sometimes, I write poetry. It's not always the happiest, but I am proud of it. It would mean a lot to me if you took a look! " ,
" https://void.werefox.cafe " ,
ImageProps {
src : " /emoji/pen.svg " . to_string ( ) ,
alt : " Pen emoji " . to_string ( ) ,
} ,
) ,
2024-03-21 20:15:54 -05:00
(
" Valentine's Day Letter " ,
" Here's a little treat I put together for Valentine's Day one year, and I decided to just keep it up all year. Feel free to take a look if you ever need a little pick-me-up. " ,
" https://letter.werefox.cafe " ,
ImageProps {
src : " /emoji/red_heart.svg " . to_string ( ) ,
alt : " Red heart emoji " . to_string ( ) ,
} ,
) ,
2024-03-17 15:41:48 -05:00
(
" Programming " ,
" Much like this site, sometimes I program things! Gotta at least try and put that Comp. Sci. degree to good use! " ,
" https://gitea.werefox.cafe/ada " ,
ImageProps {
src : " /emoji/laptop.svg " . to_string ( ) ,
alt : " Laptop emoji " . to_string ( ) ,
} ,
) ,
2024-03-21 20:15:54 -05:00
] ;
let service_list = [
2024-03-17 15:41:48 -05:00
(
2024-03-21 20:15:54 -05:00
" Nextcloud " ,
None ,
" https://cloud.werefox.cafe " ,
2024-03-17 15:41:48 -05:00
ImageProps {
2024-03-21 20:15:54 -05:00
src : " /emoji/twitch-logo.png " . to_string ( ) ,
alt : " Twitch logo " . to_string ( ) ,
} ,
) ,
(
" Gitea " ,
None ,
" https://gitea.werefox.cafe " ,
ImageProps {
src : " /emoji/twitch-logo.png " . to_string ( ) ,
alt : " Twitch logo " . to_string ( ) ,
} ,
) ,
(
" GoToSocial " ,
None ,
" https://gts.werefox.cafe " ,
ImageProps {
src : " /emoji/twitch-logo.png " . to_string ( ) ,
alt : " Twitch logo " . to_string ( ) ,
} ,
) ,
(
" Headscale " ,
Some ( " (A self-hosted tailscale server) " . to_string ( ) ) ,
" https://headscale.net/ " ,
ImageProps {
src : " /emoji/twitch-logo.png " . to_string ( ) ,
alt : " Twitch logo " . to_string ( ) ,
} ,
) ,
(
" Jellyfin " ,
None ,
" https://watch.werefox.cafe " ,
ImageProps {
src : " /emoji/twitch-logo.png " . to_string ( ) ,
alt : " Twitch logo " . to_string ( ) ,
} ,
) ,
(
" Matrix " ,
None ,
" https://matrix.werefox.cafe " ,
ImageProps {
src : " /emoji/twitch-logo.png " . to_string ( ) ,
alt : " Twitch logo " . to_string ( ) ,
} ,
) ,
(
" Navidrome " ,
None ,
" https://music.werefox.cafe " ,
ImageProps {
src : " /emoji/twitch-logo.png " . to_string ( ) ,
alt : " Twitch logo " . to_string ( ) ,
} ,
) ,
(
" Tunic Transition Tracker " ,
Some ( " (A tracker I made for a game I love) " . to_string ( ) ) ,
" https://tunic.werefox.cafe " ,
ImageProps {
src : " /emoji/twitch-logo.png " . to_string ( ) ,
alt : " Twitch logo " . to_string ( ) ,
} ,
) ,
] ;
let personal_list = [
(
" Cockpit " ,
None ,
" https://cockpit-project.org/ " ,
ImageProps {
src : " /emoji/twitch-logo.png " . to_string ( ) ,
alt : " Twitch logo " . to_string ( ) ,
} ,
) ,
(
" Dockge " ,
None ,
" https://dockge.kuma.pet/ " ,
ImageProps {
src : " /emoji/twitch-logo.png " . to_string ( ) ,
alt : " Twitch logo " . to_string ( ) ,
} ,
) ,
(
" Home Assistant " ,
None ,
" https://www.home-assistant.io/ " ,
ImageProps {
src : " /emoji/twitch-logo.png " . to_string ( ) ,
alt : " Twitch logo " . to_string ( ) ,
} ,
) ,
(
" Pi-Hole " ,
None ,
" https://pi-hole.net/ " ,
ImageProps {
src : " /emoji/twitch-logo.png " . to_string ( ) ,
alt : " Twitch logo " . to_string ( ) ,
2024-03-17 15:41:48 -05:00
} ,
) ,
] ;
rsx! {
BasicPage { page_title : " Some stuff I do! " ,
div { class : " rounded-lg ring-2 ring-alice-werefox-grey dark:ring-alice-werefox-grey-darker bg-alice-werefox-grey-light dark:bg-alice-werefox-grey " ,
WerefoxCard { card_title : " Personal Projects " ,
for project in project_list {
ProjectCard { project_title : project . 0 , project_description : project . 1 , project_link : project . 2 , image_props : project . 3 }
}
2024-03-21 20:15:54 -05:00
ProjectFoldable { project_title : " Services " ,
project_description : " Click here for a list of the services I host. " ,
image_props : ImageProps {
src : " /emoji/crt_blue_screen.svg " . to_string ( ) ,
alt : " A CRT blue screen emoji. " . to_string ( ) ,
}
for service in service_list {
ProjectCard { project_title : service . 0 , project_description : service . 1 , project_link : service . 2 , image_props : service . 3 }
}
}
ProjectFoldable { project_title : " Personal Use " ,
project_description : " Click here for a list of services I have set up for just me. " ,
image_props : ImageProps {
src : " /emoji/crt_blue_screen.svg " . to_string ( ) ,
alt : " A CRT blue screen emoji. " . to_string ( ) ,
}
for personal in personal_list {
ProjectCard { project_title : personal . 0 , project_description : personal . 1 , project_link : personal . 2 , image_props : personal . 3 }
}
}
2024-03-17 15:41:48 -05:00
}
}
}
}
}
#[ component ]
pub fn Testimonials ( ) -> Element {
rsx! { div { } }
}
#[ component ]
pub fn Hrt ( ) -> Element {
rsx! { div { } }
}
#[ component ]
pub fn Faq ( ) -> Element {
rsx! { div { } }
}
#[ component ]
pub fn Support ( ) -> Element {
rsx! { div { } }
}
}