diff --git a/configs/config.json b/configs/config.json index 74b40a5..cc2e366 100644 --- a/configs/config.json +++ b/configs/config.json @@ -26,6 +26,7 @@ }, "links": { + "github": "shettysach", "email": "ShettySachith47@gmail.com", "linkedin": "in/sachith-shetty-3a165724b", "twitter": null diff --git a/src/base.rs b/src/base.rs index b775a9d..4a4f45a 100644 --- a/src/base.rs +++ b/src/base.rs @@ -12,7 +12,7 @@ pub fn Base() -> impl IntoView { let (prompts, set_prompts) = create_signal(1); let (history, set_history) = create_signal(VecDeque::new()); - let prompt_list = move || (0..prompts.get()).collect::>(); + let prompt_list = move || (0..prompts.get()).collect::>(); view! {
diff --git a/src/base/banner.rs b/src/base/banner.rs index f814e5f..231eadb 100644 --- a/src/base/banner.rs +++ b/src/base/banner.rs @@ -6,7 +6,6 @@ pub const HELP: &str = r#" ________________ __ ___ / / / /___/ _, _/ / / / __/ / /_/ / /____/ // /_/ / /_/ /_____/_/ |_/_/ /_/_/ \____/_____/___/\____/ - Hello, welcome to Termfolio. Type one of these commands - about - View about me diff --git a/src/base/prompt.rs b/src/base/prompt.rs index 9dd4c95..6eef93c 100644 --- a/src/base/prompt.rs +++ b/src/base/prompt.rs @@ -12,7 +12,7 @@ use std::collections::VecDeque; #[component] pub fn Prompt( - submitter: WriteSignal, + submitter: WriteSignal, updater: WriteSignal>, history: ReadSignal>, ) -> impl IntoView { @@ -87,7 +87,9 @@ pub fn Prompt( }); submitter.update(|prompts| { - *prompts += 1; + if *prompts < u8::MAX { + *prompts += 1; + } }); }); diff --git a/src/fetch.rs b/src/fetch.rs index 623a553..323bea9 100644 --- a/src/fetch.rs +++ b/src/fetch.rs @@ -51,6 +51,7 @@ pub struct Education { #[derive(Deserialize, Serialize, Clone)] pub struct Links { + pub github: String, pub email: Option, pub linkedin: Option, pub twitter: Option, @@ -60,18 +61,18 @@ pub struct Links { pub struct UserInfo { pub name: Option, pub bio: Option, - pub public_repos: u32, + pub public_repos: u16, pub company: Option, pub location: Option, - pub followers: u32, - pub following: u32, + pub followers: u16, + pub following: u16, pub created_at: String, } #[derive(Deserialize, Serialize, Clone)] pub struct UserStats { - pub stars: u32, - pub forks: u32, + pub stars: u16, + pub forks: u16, } #[derive(Deserialize, Serialize)] @@ -85,8 +86,8 @@ pub struct Repository { pub repo: String, pub description: String, pub language: Language, - pub stars: u32, - pub forks: u32, + pub stars: u16, + pub forks: u16, } #[derive(Deserialize, Serialize, Clone)] @@ -133,7 +134,7 @@ pub async fn get_repos() -> String { pub fn get_contacts() -> &'static String { CONTACTS.get_or_init(|| match read_config() { - Some(config) => format_contacts(config), + Some(config) => format_contacts(&config.links), _ => String::from(READ_JSON_ERROR), }) } diff --git a/src/fetch/formats.rs b/src/fetch/formats.rs index 6d0988f..4aabfb7 100644 --- a/src/fetch/formats.rs +++ b/src/fetch/formats.rs @@ -1,4 +1,4 @@ -use crate::fetch::{About, Config, Repository, UserInfo, UserStats}; +use crate::fetch::{About, Links, Repository, UserInfo, UserStats}; use std::collections::HashMap; const IMG_G: &str = include_str!("../../configs/img_g.txt"); @@ -195,43 +195,43 @@ pub fn format_repos(username: String, repos: Vec) -> String { format!("{}\n{}", res.join("\n"), all) } -pub fn format_contacts(config: Config) -> String { - let github = format!( - r#" Github: github.com/{}"#, - config.github, config.github +pub fn format_contacts(links: &Links) -> String { + let mut result = String::new(); + + result += &format!( + r#" Github: github.com/{} +"#, + links.github, links.github ); - let email = config.links.email.map(|email| { - format!( + if let Some(email) = &links.email { + result += &format!( r#" - Email: {}"#, + Email: {} + "#, email, email - ) - }); + ); + } - let linkedin = config.links.linkedin.map(|linkedin| { - format!( + if let Some(linkedin) = &links.linkedin { + result += &format!( r#" - LinkedIn: linkedin.com/{}"#, + LinkedIn: linkedin.com/{} + "#, linkedin, linkedin - ) - }); + ); + } - let twitter = config.links.twitter.map(|twitter| { - format!( + if let Some(twitter) = &links.twitter { + result += &format!( r#" - Twitter/X: @{}"#, + Twitter/X: @{} + "#, twitter, twitter - ) - }); + ); + } - format!( - "{}\n{}\n{}\n{}", - github, - email.unwrap_or_default(), - linkedin.unwrap_or_default(), - twitter.unwrap_or_default() - ) + result } pub fn format_langs(langs: Vec) -> String { diff --git a/src/texts.rs b/src/texts.rs index d6e4161..2bd361b 100644 --- a/src/texts.rs +++ b/src/texts.rs @@ -22,7 +22,6 @@ pub const CREDITS: &str = r#" _____ ______________ _________ | | | |___| |\ \| | | || | \ \_/ / |_____| |_\ \_/ / \_/ \____/\_| \_\_| |_/\_| \___/\_____/\___/ \___/ - Terminal style portfolio website, made using Rust. Made by Sachith C Shetty diff --git a/styles/styles.css b/styles/styles.css index ba63d16..7cc54dd 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -3,12 +3,12 @@ --black: #17171e; --green: #4fd6be; --red: #c53b53; - --blue: #7dcfff; + --blue: #7aa2f7; --yellow: #ffc777; --orange: #ff757f; --purple: #bb9af7; --dgreen: #c3e88d; - --dblue: #7aa2f7; + --dblue: #7dcfff; } * { diff --git a/styles/themes.css b/styles/themes.css index 3252f7a..690b281 100644 --- a/styles/themes.css +++ b/styles/themes.css @@ -3,12 +3,12 @@ --black: #181825; --green: #cba6f7; --red: #e78284; - --blue: #74c7ec; + --blue: #89b4fa; --yellow: #f9e2af; --orange: #fab387; --purple: #b4befe; --dgreen: #94e2d5; - --dblue: #89b4fa; + --dblue: #74c7ec; } .nord { @@ -29,10 +29,10 @@ --black: Black; --green: LimeGreen; --red: Crimson; - --blue: DeepSkyBlue; + --blue: DodgerBlue; --yellow: Gold; --orange: OrangeRed; --purple: MediumSlateBlue; --dgreen: MediumSeaGreen; - --dblue: DodgerBlue; + --dblue: DeepSkyBlue; }