diff --git a/Cargo.lock b/Cargo.lock index 9e974ce..9c3f9b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -103,6 +103,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "wasm-logger", + "web-sys", "yew", "yew-router", "yew-utils", diff --git a/Cargo.toml b/Cargo.toml index 03df489..aac364f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ yew-utils = { path = "../../libs/yew-utils" } wasm-logger = "0.2" wasm-bindgen = "0.2.84" wasm-bindgen-futures = "0.4.34" +web-sys = "0.3.61" stdweb = "0.4.20" js-sys = "0.3" diff --git a/css/call_to_action.css b/css/call_to_action.css index e69de29..ce94f10 100644 --- a/css/call_to_action.css +++ b/css/call_to_action.css @@ -0,0 +1,71 @@ +.contact-container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 100vw; + margin-left: calc(-1 * clamp(35px, 10%, 10vw)); + margin-right: calc(-1 * clamp(35px, 10%, 10vw)); + + background-color: #4C40F7; + + padding-top: 40px; + padding-bottom: 20px; +} +.contact-title { + font-family: Poppins; + font-size: 14px; + font-weight: 400; + text-align: center; + + color: white +} + +.contact-subtitle { + margin-top: 20px; + + font-family: Poppins; + font-size: 28px; + font-weight: 600; + text-align: center; + letter-spacing: 1px; + + color: white +} + +.contact-textfield-container { + margin-top: 30px; + + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 20px; + + width: 500px; +} +.contact-form-button { + margin-top: 25px; + + display: flex; + justify-content: center; + align-items: center; + background-color: #00113B; + + color: white; + font-size: 14px; + + width: 150px; + height: 50px; + border-radius: 4px; +} +.contact-form-button { + cursor: pointer; + user-select: none; +} +@media only screen and (min-width: 1000px) { + .contact-container { + margin-left: calc(-1 * clamp(35px, 25%, 10vw)); + margin-right: calc(-1 * clamp(35px, 25%, 10vw)) + } +} \ No newline at end of file diff --git a/css/components/textfield.css b/css/components/textfield.css new file mode 100644 index 0000000..5d68cd0 --- /dev/null +++ b/css/components/textfield.css @@ -0,0 +1,54 @@ +.textfield-container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: start; + gap: 4px; + + width: 100%; +} +.textfield { + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + height: 50px; + background-color: white; + border: solid 0.5px #d8d8d8; + + width: 100%; + text-indent: 10px; + + font-family: Poppins; + font-weight: 200; + font-size: 14px; + line-height: 32px; + + color: #ABAFC7; +} +.textarea { + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + + height: 150px; + background-color: white; + border: solid 0.5px #d8d8d8; + + width: 100%; + padding: 10px; + + font-family: Poppins; + font-weight: 200; + font-size: 13px; + line-height: 20px; + + color: #ABAFC7; +} + +::placeholder { + color: #ABAFC7; + font-family: Poppins; + font-size: 13px; +} \ No newline at end of file diff --git a/index.html b/index.html index c3826ec..5ca3e3d 100644 --- a/index.html +++ b/index.html @@ -15,6 +15,8 @@ + + diff --git a/locales/en.yml b/locales/en.yml index 7cacd07..dea9cde 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -56,4 +56,10 @@ footer: +62 (0) 000 0000 00 copyright-text: © 2023 Blanco Lorenzo - All rights reserved - +contact: + title: Contact Us + subtitle: Leave us a message + contact.form-name-label: Name + contact.form-email-label: Email + contact.form-message-label: Start typing... + contact.form-button-label: Send \ No newline at end of file diff --git a/src/components/mod.rs b/src/components/mod.rs index 7f09b44..a850732 100644 --- a/src/components/mod.rs +++ b/src/components/mod.rs @@ -2,3 +2,4 @@ pub mod footer; pub mod language_picker; pub mod nav_bar; pub mod service_card; +pub mod textfield; \ No newline at end of file diff --git a/src/components/textfield.rs b/src/components/textfield.rs new file mode 100644 index 0000000..ad30d6d --- /dev/null +++ b/src/components/textfield.rs @@ -0,0 +1,86 @@ +// COMPONENTFORLIB +use wasm_bindgen::{JsCast, UnwrapThrowExt}; +use web_sys::{HtmlInputElement, HtmlTextAreaElement}; +use yew::prelude::*; + +/// This component is a text +#[function_component(TextField)] +pub fn textfield(props: &TextFieldProps) -> Html { + let on_input_changed = { + let handle = props.value.clone(); + let fieldtype = props.fieldtype.clone(); + let onchange = props.onchange.clone(); + Callback::from(move |e: InputEvent| match fieldtype { + TextFieldType::Input => { + let value = get_value_from_input_event(e); + match onchange.clone() { + Some(onchange) => { + onchange.emit(value.clone()); + } + None => {} + }; + handle.set(value); + } + TextFieldType::TextArea => { + let value = get_value_from_textarea_event(e); + match onchange.clone() { + Some(onchange) => { + onchange.emit(value.clone()); + } + None => {} + }; + handle.set(value); + } + }) + }; + html! { +
+ { + if props.fieldtype == TextFieldType::Input { + html! { } + } else { + html! {