Navbar done

This commit is contained in:
Franklin 2023-03-13 08:54:08 -04:00
parent c37beea04f
commit a10dff41ed
9 changed files with 270 additions and 84 deletions

View File

@ -1,25 +1,52 @@
body {
margin: 0; /* Remove body margins */
}
.navbar-container {
/* Mobile View */
.navbar-background {
display: flex;
flex-direction: row;
justify-content: flex-start;
justify-content: end;
align-items: center;
align-items: stretch;
background-color: #252631;
padding: 15px;
padding-right: 40px;
margin: 0px;
min-height: 44px;
}
.navbar {
.navbar-container {
display: flex;
flex-direction: row;
justify-content: flex-end;
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
flex-grow: 1;
}
.navbar-hamburger {
font-size: 20pt;
color: white;
display: flex;
align-items: start;
margin-top: 10px;
max-height: 35px;
}
.navbar-closed{
display: flex;
flex-direction: column;
justify-content: flex-start;
margin-top: 10px;
display: none;
}
.navbar-open {
display: flex;
flex-direction: column;
justify-content: flex-start;
margin-top: 10px;
}
.navbar-item {
color: white;
font-size: 14pt;
font-size: 12pt;
padding-left: 20px;
padding-right: 20px;
padding-top: 10px;
@ -28,7 +55,7 @@ body {
}
.navbar-item:hover {
background-color: #ffffff14;
font-size: 15pt;
font-size: 13pt;
font-weight: bold;
border-radius: 3px;
transition-duration: 0.3s;
@ -36,11 +63,71 @@ body {
}
.navbar-title {
color: white;
font-size: 14pt;
font-size: 15pt;
padding-left: 20px;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 10px;
font-family: Source Sans Pro;
}
/* Desktop view */
@media only screen and (min-width: 850px) {
.navbar-container {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: stretch;
}
.navbar {
display: flex;
flex-direction: row;
justify-content: flex-end;
flex-grow: 1;
}
.navbar-closed {
display: flex;
flex-direction: row;
justify-content: flex-end;
flex-grow: 1;
margin-top: 0px;
}
.navbar-open {
display: flex;
flex-direction: row;
justify-content: flex-end;
flex-grow: 1;
margin-top: 0px;
}
.navbar-item {
color: white;
font-size: 14pt;
padding-left: 20px;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 10px;
font-family: Source Sans Pro;
}
.navbar-item:hover {
background-color: #ffffff14;
font-size: 15pt;
font-weight: bold;
border-radius: 3px;
transition-duration: 0.3s;
cursor: pointer;
}
.navbar-title {
color: white;
font-size: 14pt;
padding-left: 20px;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 10px;
font-family: Source Sans Pro;
}
.navbar-hamburger {
display: none;
}
}
/*}*/

9
dist/index.html vendored
View File

@ -1,13 +1,14 @@
<!DOCTYPE html><html><head>
<meta charset="utf-8">
<title>Yew App</title>
<link rel="stylesheet" href="/navbar-b14cff87445aae60.css">
<link rel="stylesheet" href="/navbar-3dafbc875c0918b7.css">
<link rel="stylesheet" href="/landing-c920ca43256fdcb9.css">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
<script src="https://kit.fontawesome.com/fcdfdfe1ad.js" crossorigin="anonymous"></script>
<link rel="preload" href="/remax-template-frontend-abf7cea69d31badc_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="/remax-template-frontend-abf7cea69d31badc.js"></head>
<body><script type="module">import init from '/remax-template-frontend-abf7cea69d31badc.js';init('/remax-template-frontend-abf7cea69d31badc_bg.wasm');</script><script>(function () {
<link rel="preload" href="/remax-template-frontend-139320c0b200f6ae_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="/remax-template-frontend-139320c0b200f6ae.js"></head>
<body><script type="module">import init from '/remax-template-frontend-139320c0b200f6ae.js';init('/remax-template-frontend-139320c0b200f6ae_bg.wasm');</script><script>(function () {
var protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
var url = protocol + '//' + window.location.host + '/_trunk/ws';
var poll_interval = 5000;

133
dist/navbar-3dafbc875c0918b7.css vendored Normal file
View File

@ -0,0 +1,133 @@
body {
margin: 0; /* Remove body margins */
}
/* Mobile View */
.navbar-background {
display: flex;
flex-direction: row;
justify-content: end;
align-items: center;
align-items: stretch;
background-color: #252631;
padding: 15px;
padding-right: 40px;
min-height: 44px;
}
.navbar-container {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
flex-grow: 1;
}
.navbar-hamburger {
font-size: 20pt;
color: white;
display: flex;
align-items: start;
margin-top: 10px;
max-height: 35px;
}
.navbar-closed{
display: flex;
flex-direction: column;
justify-content: flex-start;
margin-top: 10px;
display: none;
}
.navbar-open {
display: flex;
flex-direction: column;
justify-content: flex-start;
margin-top: 10px;
}
.navbar-item {
color: white;
font-size: 12pt;
padding-left: 20px;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 10px;
font-family: Source Sans Pro;
}
.navbar-item:hover {
background-color: #ffffff14;
font-size: 13pt;
font-weight: bold;
border-radius: 3px;
transition-duration: 0.3s;
cursor: pointer;
}
.navbar-title {
color: white;
font-size: 15pt;
padding-left: 20px;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 10px;
font-family: Source Sans Pro;
}
/* Desktop view */
@media only screen and (min-width: 850px) {
.navbar-container {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: stretch;
}
.navbar {
display: flex;
flex-direction: row;
justify-content: flex-end;
flex-grow: 1;
}
.navbar-closed {
display: flex;
flex-direction: row;
justify-content: flex-end;
flex-grow: 1;
margin-top: 0px;
}
.navbar-open {
display: flex;
flex-direction: row;
justify-content: flex-end;
flex-grow: 1;
margin-top: 0px;
}
.navbar-item {
color: white;
font-size: 14pt;
padding-left: 20px;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 10px;
font-family: Source Sans Pro;
}
.navbar-item:hover {
background-color: #ffffff14;
font-size: 15pt;
font-weight: bold;
border-radius: 3px;
transition-duration: 0.3s;
cursor: pointer;
}
.navbar-title {
color: white;
font-size: 14pt;
padding-left: 20px;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 10px;
font-family: Source Sans Pro;
}
.navbar-hamburger {
display: none;
}
}

View File

@ -1,46 +0,0 @@
body {
margin: 0; /* Remove body margins */
}
.navbar-container {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: stretch;
background-color: #252631;
padding: 15px;
padding-right: 40px;
margin: 0px;
}
.navbar {
display: flex;
flex-direction: row;
justify-content: flex-end;
flex-grow: 1;
}
.navbar-item {
color: white;
font-size: 14pt;
padding-left: 20px;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 10px;
font-family: Source Sans Pro;
}
.navbar-item:hover {
background-color: #ffffff14;
font-size: 15pt;
font-weight: bold;
border-radius: 3px;
transition-duration: 0.3s;
cursor: pointer;
}
.navbar-title {
color: white;
font-size: 14pt;
padding-left: 20px;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 10px;
font-family: Source Sans Pro;
}
/*}*/

View File

@ -780,12 +780,12 @@ function getImports() {
const ret = wasm.memory;
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper7108 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 604, __wbg_adapter_36);
imports.wbg.__wbindgen_closure_wrapper7530 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 621, __wbg_adapter_36);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper7412 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 639, __wbg_adapter_39);
imports.wbg.__wbindgen_closure_wrapper7834 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 656, __wbg_adapter_39);
return addHeapObject(ret);
};
@ -824,7 +824,7 @@ function initSync(module) {
async function init(input) {
if (typeof input === 'undefined') {
input = new URL('remax-template-frontend-abf7cea69d31badc_bg.wasm', import.meta.url);
input = new URL('remax-template-frontend-139320c0b200f6ae_bg.wasm', import.meta.url);
}
const imports = getImports();

View File

@ -6,5 +6,6 @@
<link data-trunk type="text/css" href="css/navbar.css" rel="css" />
<link data-trunk type="text/css" href="css/landing.css" rel="css" />
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
<script src="https://kit.fontawesome.com/fcdfdfe1ad.js" crossorigin="anonymous"></script>
</head>
</html>

View File

@ -13,26 +13,36 @@ pub fn navigation_bar() -> Html {
let cloned_navigator_3 = navigator.clone();
let cloned_navigator_4 = navigator.clone();
let navbar_toggle = use_state(|| true);
let on_click_hamburger = {
let navbar_toggle = navbar_toggle.clone();
Callback::from(move |_| navbar_toggle.set(!*navbar_toggle))
};
html! {
<div class={"navbar-container"}>
<div class={"navbar-title"}>{NAVBAR_TITLE}</div>
<div class={"navbar"}>
<div onclick={move |_| cloned_navigator_1.push(&Route::LandingPage)} class={"navbar-item"}>
{NAVBAR_COL_LANDING}
</div>
<div class={"navbar-background"}>
<div class={"navbar-container"}>
<div class={"navbar-title"}>{NAVBAR_TITLE}</div>
<div class={if *navbar_toggle {"navbar-closed"} else {"navbar-open"}}>
<div onclick={move |_| cloned_navigator_1.push(&Route::LandingPage)} class={"navbar-item"}>
{NAVBAR_COL_LANDING}
</div>
<div onclick={move |_| cloned_navigator_2.push(&Route::Search { property_state: PropertyState::Finished })} class={"navbar-item"}>
{NAVBAR_COL_PROYECTOS_ACABADOS}
</div>
<div onclick={move |_| cloned_navigator_3.push(&Route::Search { property_state: PropertyState::InConstruction })} class={"navbar-item"}>
{NAVBAR_COL_PROYECTOS_EN_CONSTRUCCION}
</div>
<div onclick={move |_| cloned_navigator_2.push(&Route::Search { property_state: PropertyState::Finished })} class={"navbar-item"}>
{NAVBAR_COL_PROYECTOS_ACABADOS}
</div>
<div onclick={move |_| cloned_navigator_3.push(&Route::Search { property_state: PropertyState::InConstruction })} class={"navbar-item"}>
{NAVBAR_COL_PROYECTOS_EN_CONSTRUCCION}
</div>
<div onclick={move |_| cloned_navigator_4.push(&Route::Contact)} class={"navbar-item"}>
{NAVBAR_COL_CONTACTO}
<div onclick={move |_| cloned_navigator_4.push(&Route::Contact)} class={"navbar-item"}>
{NAVBAR_COL_CONTACTO}
</div>
</div>
</div>
<div class={"navbar-hamburger"} onclick={on_click_hamburger}>
<i class="fa-solid fa-bars" ></i>
</div>
</div>
}
}

View File

@ -7,10 +7,10 @@ use crate::components::nav_bar::NavigationBar;
pub fn landing_page() -> Html {
html!{
<>
<NavigationBar/>
<div>
{"Landing Page"}
</div>
<NavigationBar/>
<div>
{"Landing Page"}
</div>
</>
}
}