-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include: - Enhance Landing - Refactor layout - Enhance error layout - Make loader internal
- Loading branch information
1 parent
1aa4fec
commit bf0d67b
Showing
27 changed files
with
675 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use sycamore::prelude::*; | ||
|
||
#[component] | ||
pub fn CoolLink<G: Html>(cx: Scope, CoolLinkProps { to, text }: CoolLinkProps) -> View<G> { | ||
view! {cx, | ||
a(href=(to), class="cool-link", data-text=(text)){span{(text)}} | ||
} | ||
} | ||
|
||
#[derive(Prop)] | ||
pub struct CoolLinkProps { | ||
to: &'static str, | ||
text: &'static str, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use sycamore::prelude::*; | ||
|
||
use crate::components::cool_link::CoolLink; | ||
|
||
#[component] | ||
pub fn Header<G: Html>(cx: Scope) -> View<G> { | ||
view! {cx, | ||
header(class="header") { | ||
div(class="header__container") { | ||
ul(class="header__left") { | ||
li(class="header--xs") { CoolLink(text="Home", to="") } | ||
li(class="header--sm") { CoolLink(text="Reviews", to="#") } | ||
li { CoolLink(text="Projects", to="#") } | ||
li(class="header--sm") { CoolLink(text="Insights", to="#") } | ||
li(class="header--sm") { CoolLink(text="Faq", to="#") } | ||
} | ||
div(class="header__right") { | ||
button(class="cool-button") {span{"Contact"}} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use sycamore::prelude::*; | ||
|
||
#[component] | ||
pub fn Intro<G: Html>(cx: Scope) -> View<G> { | ||
view! {cx, | ||
div(class="intro") { | ||
h4 { "Hi 👋, My name is" } | ||
h1 { "Binh Tran" } | ||
h2 { "Full stack web developer" } | ||
h2 { "Automation tester" } | ||
h2 { "from Vietnam" } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use crate::components::{header::Header, intro::Intro, scroll_down::ScrollDown, social::Social}; | ||
use sycamore::prelude::*; | ||
|
||
#[component] | ||
pub fn Landing<G: Html>(cx: Scope) -> View<G> { | ||
view! {cx, | ||
main(class="landing") { | ||
Header | ||
Social | ||
Intro | ||
ScrollDown | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
pub mod layout; | ||
pub mod cool_link; | ||
pub mod header; | ||
pub mod intro; | ||
pub mod landing; | ||
pub mod loader; | ||
pub mod scroll_down; | ||
pub mod seo; | ||
pub mod social; | ||
pub mod social_link; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use sycamore::prelude::*; | ||
|
||
#[component] | ||
pub fn ScrollDown<G: Html>(cx: Scope) -> View<G> { | ||
view!{cx, | ||
div(class="scroll-down") { | ||
div(class="scroll-down__wheel") { | ||
div(class="scroll-down__wheel--inner") | ||
} | ||
div(class="scroll-down__arrows") { | ||
span(class="scroll-down__arrow") | ||
span(class="scroll-down__arrow") | ||
span(class="scroll-down__arrow") | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::fs; | ||
|
||
use sycamore::prelude::*; | ||
|
||
use crate::components::social_link::{SocialLink, SocialType}; | ||
|
||
#[component] | ||
pub fn Social<G: Html>(cx: Scope) -> View<G> { | ||
view! {cx, | ||
div(class="social") { | ||
style { (fs::read_to_string("static/styles/social-icon.css").expect("Cannot read social-icon.css")) } | ||
SocialLink(to="https://www.linkedin.com/in/binhtran432k", typ=SocialType::LinkedIn) | ||
SocialLink(to="https://github.com/binhtran432k", typ=SocialType::GitHub) | ||
SocialLink(to="#", typ=SocialType::Instagram) | ||
SocialLink(to="https://www.facebook.com/binhtran432k", typ=SocialType::Facebook) | ||
SocialLink(to="https://www.youtube.com/@binhtran432k", typ=SocialType::Youtube) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use std::fmt; | ||
|
||
use sycamore::prelude::*; | ||
|
||
#[component] | ||
pub fn SocialLink<G: Html>(cx: Scope, SocialProps { to, typ }: SocialProps) -> View<G> { | ||
view! {cx, | ||
a(href=to, | ||
target="_blank", | ||
title=format!("Social link of {}", typ.to_string()), | ||
class=format!("icon icon--{} colored-icon", typ.to_string())) | ||
{ | ||
span{} | ||
} | ||
} | ||
} | ||
|
||
#[derive(Clone, Copy)] | ||
pub enum SocialType { | ||
GitHub, | ||
Youtube, | ||
Instagram, | ||
Facebook, | ||
LinkedIn, | ||
} | ||
|
||
impl fmt::Display for SocialType { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
match self { | ||
SocialType::GitHub => write!(f, "github"), | ||
SocialType::Youtube => write!(f, "youtube"), | ||
SocialType::Instagram => write!(f, "instagram"), | ||
SocialType::Facebook => write!(f, "facebook"), | ||
SocialType::LinkedIn => write!(f, "linkedin"), | ||
} | ||
} | ||
} | ||
|
||
#[derive(Prop)] | ||
pub struct SocialProps { | ||
pub to: &'static str, | ||
pub typ: SocialType, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use perseus::prelude::*; | ||
use sycamore::prelude::*; | ||
|
||
use crate::components::{header::Header, loader::Loader, social::Social}; | ||
|
||
#[component] | ||
pub fn Error<'a, G: Html>(cx: Scope<'a>, ErrorProps { children }: ErrorProps<'a, G>) -> View<G> { | ||
let children = children.call(cx); | ||
|
||
view! { cx, | ||
Loader | ||
main(class="error") { | ||
Header | ||
Social | ||
div(class="error__content") { | ||
(children) | ||
} | ||
} | ||
} | ||
} | ||
|
||
#[component] | ||
pub fn ErrorHead(cx: Scope) -> View<SsrNode> { | ||
view! { cx, | ||
link(rel="stylesheet", href=".perseus/static/styles/layout.css") | ||
link(rel="stylesheet", href=".perseus/static/styles/cool-item.css") | ||
} | ||
} | ||
|
||
#[derive(Prop)] | ||
pub struct ErrorProps<'a, G: Html> { | ||
pub children: Children<'a, G>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use perseus::prelude::*; | ||
use sycamore::prelude::*; | ||
|
||
use crate::components::loader::Loader; | ||
|
||
#[component] | ||
pub fn Index<'a, G: Html>(cx: Scope<'a>, IndexProps { children }: IndexProps<'a, G>) -> View<G> { | ||
let children = children.call(cx); | ||
|
||
view! { cx, | ||
Loader() | ||
(children) | ||
} | ||
} | ||
|
||
#[component] | ||
pub fn IndexHead(cx: Scope) -> View<SsrNode> { | ||
view! { cx, | ||
link(rel="stylesheet", href=".perseus/static/styles/layout.css") | ||
link(rel="stylesheet", href=".perseus/static/styles/cool-item.css") | ||
} | ||
} | ||
|
||
#[derive(Prop)] | ||
pub struct IndexProps<'a, G: Html> { | ||
pub children: Children<'a, G>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod index; | ||
pub mod error; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$green: #6cff8d; | ||
$red: #FF5555; | ||
$yellow: #F1FA8C; | ||
$purple: #BD93F9; | ||
$cyan: #8BE9FD; | ||
$orange: #FFB86C; | ||
$pink: #FF79C6; | ||
$blue: mix($cyan, blue, $weight: 50%); | ||
$fg: #F8F8F2; | ||
$bg: #282A36; | ||
$green-50: rgba($green, 0.4); | ||
$fg-50: rgba($fg, 0.4); | ||
$bg-50: rgba($bg, 50%); |
Oops, something went wrong.