Added initial page body and setup

This commit is contained in:
Franklin 2023-05-10 14:28:08 -04:00
commit 69db581948
26 changed files with 2054 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/target
/dist
.env

1828
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

42
Cargo.toml Normal file
View File

@ -0,0 +1,42 @@
[package]
name = "realtor-lp-frontend"
version = "0.1.0"
edition = "2021"
authors = [
"Franklin Blanco <me@franklinblanco.dev>"
]
license = "MIT OR Apache-2.0"
[dependencies]
# yew and core stuff
yew = { version = "0.20.0", features = ["csr"] }
yew-router = "0.17"
stylist = "0.12.0"
# Wasm/js stuff
wasm-logger = "0.2"
wasm-bindgen = "0.2.84"
wasm-bindgen-futures = "0.4.34"
#stdweb = "0.4.19"
js-sys = "0.3"
web-sys = "0.3.61"
# other libs
reqwest = { version = "0.11.11", features = ["rustls-tls", "json", "blocking", "multipart"], default-features = false }
uuid = { version = "1.3.0", features = ["v4", "fast-rng", "macro-diagnostics", "serde", "js"] }
log = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.88"
err = { git = "https://git.franklinblanco.dev/franklinblanco/err.git" }
thousands = "0.2.0"
chrono = "0.4.23"
# Core
#realtor-lp-types = { path = "../realtor-lp-types", features = ["wasm"] }
[profile.release]
lto = true
codegen-units = 1
panic = "abort"
opt-level = "z"

2
assets/text/robots.txt Normal file
View File

@ -0,0 +1,2 @@
User-agent: *
Disallow: /admin/

4
css/body.css Normal file
View File

@ -0,0 +1,4 @@
body {
margin: 0; /* Remove body margins */
background-color: rgb(250, 248, 248);
}

View File

View File

View File

7
css/pages/main_page.css Normal file
View File

@ -0,0 +1,7 @@
.main-page-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: start;
width: 100%;
}

29
index.html Normal file
View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--<link rel="icon" type="image/x-icon" href="images/logo-color.png">-->
<title>RealtorFolio - El mejor amigo de cada agente</title>
<meta name="description" content="La mejor herramienta para posicionarte como agente inmobiliario profesional.">
<link data-trunk type="text/css" href="css/body.css" rel="css" />
<link data-trunk type="text/css" href="css/pages/main_page.css" rel="css" />
<link data-trunk type="text/css" href="css/components/footer.css" rel="css" />
<link data-trunk type="text/css" href="css/components/navbar.css" rel="css" />
<link data-trunk type="text/css" href="css/components/page/hero.css" rel="css" />
<link data-trunk href="assets/text/robots.txt" rel="copy-file"/>
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Space+Grotesk" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Inter" rel="stylesheet">
<script src="https://kit.fontawesome.com/fcdfdfe1ad.js" crossorigin="anonymous"></script>
<base data-trunk-public-url />
<link data-trunk rel="copy-dir" href="assets/images/"/>
</head>
</html>

0
src/api/mod.rs Normal file
View File

8
src/components/footer.rs Normal file
View File

@ -0,0 +1,8 @@
use yew::prelude::*;
#[function_component(Footer)]
pub fn footer() -> Html {
html! {
}
}

3
src/components/mod.rs Normal file
View File

@ -0,0 +1,3 @@
pub mod page;
pub mod footer;
pub mod navbar;

0
src/components/navbar.rs Normal file
View File

View File

@ -0,0 +1,8 @@
use yew::prelude::*;
#[function_component(AgencySection)]
pub fn agency_section() -> Html {
html! {
}
}

View File

@ -0,0 +1,8 @@
use yew::prelude::*;
#[function_component(ContactSection)]
pub fn contact_section() -> Html {
html! {
}
}

View File

@ -0,0 +1,10 @@
use yew::prelude::*;
#[function_component(HeroSection)]
pub fn hero_section() -> Html {
html! {
<div class={"hero-container"}>
</div>
}
}

View File

@ -0,0 +1,5 @@
pub mod hero;
pub mod agency;
pub mod contact;
pub mod results;
pub mod search;

View File

@ -0,0 +1,8 @@
use yew::prelude::*;
#[function_component(ResultsSection)]
pub fn results_section() -> Html {
html! {
}
}

View File

@ -0,0 +1,8 @@
use yew::prelude::*;
#[function_component(SearchSection)]
pub fn search_section() -> Html {
html! {
}
}

44
src/main.rs Normal file
View File

@ -0,0 +1,44 @@
mod api;
mod components;
mod utils;
mod pages;
use pages::{main_page::MainPage, not_found::NotFound, admin_panel::AdminPanel};
use yew::prelude::*;
use yew_router::prelude::*;
#[function_component]
fn App() -> Html {
html! {
<BrowserRouter>
<Switch<Route> render={switch} />
</BrowserRouter>
}
}
fn main() {
wasm_logger::init(wasm_logger::Config::default());
//stdweb::initialize();
yew::Renderer::<App>::new().render();
}
#[derive(Clone, Routable, PartialEq)]
pub enum Route {
#[at("/")]
LandingPage,
#[at("/admin")]
AdminPanel,
#[not_found]
#[at("/404")]
NotFound,
}
pub fn switch(routes: Route) -> Html {
match routes {
Route::LandingPage => html! { <MainPage/> },
Route::AdminPanel => html! { <AdminPanel/> },
Route::NotFound => html! { <NotFound/> },
}
}

8
src/pages/admin_panel.rs Normal file
View File

@ -0,0 +1,8 @@
use yew::prelude::*;
#[function_component(AdminPanel)]
pub fn admin_panel() -> Html {
html! {
}
}

17
src/pages/main_page.rs Normal file
View File

@ -0,0 +1,17 @@
use yew::prelude::*;
use crate::components::{page::{hero::HeroSection, agency::AgencySection, search::SearchSection, results::ResultsSection, contact::ContactSection}, footer::Footer};
#[function_component(MainPage)]
pub fn main_page() -> Html {
html! {
<div class={"main-page-container"}>
<HeroSection/>
<AgencySection/>
<SearchSection/>
<ResultsSection/>
<ContactSection/>
<Footer/>
</div>
}
}

4
src/pages/mod.rs Normal file
View File

@ -0,0 +1,4 @@
pub mod admin_panel;
pub mod main_page;
pub mod not_found;

8
src/pages/not_found.rs Normal file
View File

@ -0,0 +1,8 @@
use yew::prelude::*;
#[function_component(NotFound)]
pub fn not_found_page() -> Html {
html! {
<div>{"NOT FOUND"}</div>
}
}

0
src/utils/mod.rs Normal file
View File