7 changed files with 116 additions and 131 deletions
@ -1,98 +1,97 @@
|
||||
/** Search form */ |
||||
// TODO: .search-form {} |
||||
// TODO: .search-form label {} |
||||
// TODO: .search-form .search-field {} |
||||
// TODO: .search-form .search-submit {} |
||||
|
||||
::placeholder { |
||||
color: $black; |
||||
} |
||||
|
||||
.contact { |
||||
background: #f6f6f6; |
||||
padding: rem(65) 0 rem(120); |
||||
.form { |
||||
width: rem(354); |
||||
|
||||
h3 { |
||||
color: var(--primary, $brand-primary); |
||||
|
||||
&::before { |
||||
content: ''; |
||||
display: block; |
||||
margin: 0 auto 1rem; |
||||
width: rem(46); |
||||
height: rem(5); |
||||
background: var(--accent, $brand-accent); |
||||
} |
||||
::placeholder { |
||||
color: $black; |
||||
} |
||||
|
||||
p { |
||||
&__notice { |
||||
margin-bottom: 2rem; |
||||
font-size: 0.875rem; |
||||
font-weight: 600; |
||||
font-family: $font-family-sans-serif; |
||||
|
||||
&:last-child { |
||||
margin-top: rem(47); |
||||
&--error { |
||||
color: $dark-red; |
||||
} |
||||
} |
||||
|
||||
.success { |
||||
color: $dark-green; |
||||
} |
||||
|
||||
.error { |
||||
color: $dark-red; |
||||
&--success { |
||||
color: $dark-green; |
||||
} |
||||
} |
||||
|
||||
form { |
||||
width: 22.125rem; |
||||
&__row { |
||||
display: flex; |
||||
flex-direction: row; |
||||
align-items: center; |
||||
justify-content: center; |
||||
width: 100%; |
||||
|
||||
.error > input[type="text"], |
||||
.error > input[type="email"], |
||||
.error > textarea { |
||||
&--error > input[type="text"], |
||||
&--error > input[type="email"], |
||||
&--error > textarea { |
||||
border-bottom: solid 2px $dark-red; |
||||
} |
||||
|
||||
.error > ::placeholder { |
||||
&--error > ::placeholder { |
||||
color: $dark-red; |
||||
} |
||||
} |
||||
|
||||
label { |
||||
margin-bottom: 1rem; |
||||
&:last-child { |
||||
margin-top: rem(48); |
||||
} |
||||
} |
||||
} |
||||
|
||||
label, |
||||
input[type="text"], |
||||
input[type="email"], |
||||
textarea { |
||||
font-size: 0.875rem; |
||||
font-weight: 600; |
||||
font-family: $font-family-sans-serif; |
||||
background: transparent; |
||||
} |
||||
label { |
||||
margin-bottom: 1rem; |
||||
} |
||||
|
||||
.button { |
||||
background: transparent; |
||||
input[type="text"], |
||||
input[type="email"], |
||||
input[type="tel"], |
||||
textarea { |
||||
flex-grow: 1; |
||||
border-top: 0; |
||||
border-right: 0; |
||||
border-left: 0; |
||||
border-bottom: solid 2px $black; |
||||
padding: 0 0 1em; |
||||
font-size: 0.875rem; |
||||
font-weight: 600; |
||||
font-family: $font-family-sans-serif; |
||||
background: transparent; |
||||
-webkit-appearance: none; |
||||
-moz-appearance: none; |
||||
|
||||
&:focus { |
||||
outline: none; |
||||
border-bottom: solid 2px var(--accent, $brand-accent); |
||||
} |
||||
} |
||||
|
||||
textarea { |
||||
height: 7.5em; // TODO |
||||
resize: none; |
||||
} |
||||
textarea { |
||||
height: 7.5em; |
||||
resize: none; |
||||
} |
||||
|
||||
input[type="text"], |
||||
input[type="email"], |
||||
textarea { |
||||
flex-grow: 1; |
||||
border-top: 0; |
||||
border-right: 0; |
||||
border-left: 0; |
||||
border-bottom: solid 2px $black; |
||||
padding: 0 0 1em; |
||||
|
||||
&:focus { |
||||
outline: none; |
||||
border-bottom: solid 2px var(--accent, $brand-accent); |
||||
} |
||||
input[type="submit"] { |
||||
cursor: pointer; |
||||
} |
||||
|
||||
// Contact form |
||||
|
||||
.contact { |
||||
display: flex; |
||||
flex-direction: column; |
||||
justify-content: center; |
||||
align-items: center; |
||||
width: 100%; |
||||
padding: rem(65) 0 rem(120); |
||||
background: #f6f6f6; |
||||
|
||||
h2 { |
||||
font-size: rem(24); |
||||
margin-bottom: rem(40); |
||||
} |
||||
} |
||||
|
||||
@ -1,22 +1,22 @@
|
||||
<section class="contact flex flex-column justify-center items-center w-100" id="contact"> |
||||
<h3 class="tc ttu">{{ $contact_form_title }}</h3> |
||||
<form action="{{ network_home_url('/#contact') }}" method="post"> |
||||
<section class="contact" id="contact"> |
||||
<h2>{{ $contact_form_title }}</h2> |
||||
<form class="form" action="{{ network_home_url('/#contact') }}" method="post"> |
||||
@if($contact_form_response) |
||||
<p class="tl mb4 w-100 {{ $contact_form_response['status'] }}">{{ $contact_form_response['message'] }}</p> |
||||
<p class="form__notice form__notice--{{ $contact_form_response['status'] }}">{{ $contact_form_response['message'] }}</p> |
||||
@endif |
||||
<input type="hidden" name="submitted" value="1"> |
||||
<p class="flex flex-row items-center @if(@$contact_form_response['field'] === 'visitor_name'){{ 'error' }}@endif"> |
||||
<p class="form__row @if(@$contact_form_response['field'] === 'visitor_name'){{ 'form__row--error' }}@endif"> |
||||
<label class="clip" for="visitor_name">{{ __('Your name*', 'aldine' ) }}</label> |
||||
<input class="input-reset" type="text" placeholder="{{ __('Your name*', 'aldine' ) }}" name="visitor_name" value="@if($contact_form_response['status'] === 'error'){{ @esc_attr($_POST['visitor_name']) }}@endif"></p> |
||||
<p class="flex flex-row items-center @if(@$contact_form_response['field'] === 'visitor_email'){{ 'error' }}@endif"> |
||||
<input type="text" placeholder="{{ __('Your name*', 'aldine' ) }}" name="visitor_name" value="@if($contact_form_response['status'] === 'error'){{ @esc_attr($_POST['visitor_name']) }}@endif"></p> |
||||
<p class="form__row @if(@$contact_form_response['field'] === 'visitor_email'){{ 'form__row--error' }}@endif"> |
||||
<label class="clip" for="visitor_email">{{ __('Your email*', 'aldine' ) }}</label> |
||||
<input class="input-reset" type="email" placeholder="{{ __('Your email*', 'aldine' ) }}" name="visitor_email" value="@if($contact_form_response['status'] === 'error'){{ @esc_attr($_POST['visitor_email']) }}@endif"></p> |
||||
<p class="flex flex-row items-center @if(@$contact_form_response['field'] === 'visitor_institution'){{ 'error' }}@endif"> |
||||
<input type="email" placeholder="{{ __('Your email*', 'aldine' ) }}" name="visitor_email" value="@if($contact_form_response['status'] === 'error'){{ @esc_attr($_POST['visitor_email']) }}@endif"></p> |
||||
<p class="form__row @if(@$contact_form_response['field'] === 'visitor_institution'){{ 'form__row--error' }}@endif"> |
||||
<label class="clip" for="visitor_institution">{{ __('Your institution*', 'aldine' ) }}</label> |
||||
<input class="input-reset" type="text" placeholder="{{ __('Your institution*', 'aldine' ) }}" name="visitor_institution" value="@if($contact_form_response['status'] === 'error'){{ @esc_attr($_POST['visitor_institution']) }}@endif"></p> |
||||
<p class="flex flex-row items-center @if(@$contact_form_response['field'] === 'message'){{ 'error' }}@endif"> |
||||
<input type="text" placeholder="{{ __('Your institution*', 'aldine' ) }}" name="visitor_institution" value="@if($contact_form_response['status'] === 'error'){{ @esc_attr($_POST['visitor_institution']) }}@endif"></p> |
||||
<p class="form__row @if(@$contact_form_response['field'] === 'message'){{ 'form__row--error' }}@endif"> |
||||
<label class="clip" for="message">{{ __('Your message here', 'aldine' ) }}</label> |
||||
<textarea class="input-reset" type="text" placeholder="{{ __('Your message here', 'aldine' ) }}" name="message">@if($contact_form_response['status'] === 'error'){{ @esc_textarea($_POST['message']) }}@endif</textarea></p> |
||||
<p class="tc"><input class="button-reset button button--small button--outline input-reset pointer" type="submit" value="{{ __('Send', 'aldine' ) }}" /></p> |
||||
<textarea type="text" placeholder="{{ __('Your message here', 'aldine' ) }}" name="message">@if($contact_form_response['status'] === 'error'){{ @esc_textarea($_POST['message']) }}@endif</textarea></p> |
||||
<p class="form__row"><input class="button button--small button--outline" type="submit" value="{{ __('Send', 'aldine' ) }}" /></p> |
||||
</form> |
||||
</section> |
||||
|
||||
Loading…
Reference in new issue