Created
June 22, 2017 09:33
-
-
Save Liferenko/f7f0bae1d8ebccb2a681433966cbd92d to your computer and use it in GitHub Desktop.
Warm and softy contact form (html+css+vue.js) / php script for form action - later
This file contains hidden or 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
<div id="comments" class="comments-area"> | |
<style> | |
@charset "UTF-8"; | |
.container { | |
background-image: linear-gradient(-128deg, rgba(255, 181, 32, 0.93) 3%, rgba(239, 39, 153, 0.93) 88%, rgba(237, 18, 171, 0.93) 100%); | |
display: flex; | |
width: 100%; | |
height: 100%; | |
justify-content: center; | |
align-items: center; | |
} | |
.container .container { | |
background-image: linear-gradient(-128deg, rgba(255, 181, 32, 0.93) 3%, rgba(239, 39, 153, 0.93) 88%, rgba(237, 18, 171, 0.93) 100%); | |
display: flex; | |
width: 100%; | |
height: 100%; | |
justify-content: center; | |
align-items: center; | |
} | |
.container .add-product { | |
transition: all 0.3s ease; | |
background-color: #FFC145; | |
height: 144px; | |
width: 144px; | |
border-radius: 72px; | |
box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.07); | |
cursor: pointer; | |
} | |
.container .add-product.open { | |
background-color: #FAFAFA; | |
padding: 18px 32px; | |
border-radius: 5px; | |
width: 100%; | |
max-width: 420px; | |
height: 398px; | |
cursor: default; | |
} | |
.container .add-product.open form { | |
opacity: 1; | |
transition: opacity 0.1s ease; | |
transition-delay: 0.3s; | |
height: auto; | |
} | |
.container .add-product .button-copy { | |
text-align: center; | |
line-height: 144px; | |
text-transform: uppercase; | |
font-weight: bold; | |
color: #f7f7f7; | |
} | |
.container .add-product form { | |
transition: none; | |
opacity: 0; | |
height: 0; | |
overflow: hidden; | |
} | |
.container .add-product .cancel { | |
font-size: 12px; | |
text-align: center; | |
margin-top: 1em; | |
} | |
.container .add-product .cancel span { | |
cursor: pointer; | |
} | |
.container .add-product .cancel span:hover { | |
text-decoration: underline; | |
} | |
.container .submit-button { | |
display: block; | |
background-color: #3498DB; | |
height: 40px; | |
border-radius: 20px; | |
line-height: 36px; | |
text-align: center; | |
color: #fff; | |
text-transform: uppercase; | |
font-size: 0.875em; | |
border: none; | |
font-weight: 700; | |
padding: 0 34px; | |
margin: 0 auto; | |
} | |
.container .submit-button img { | |
position: relative; | |
top: 3px; | |
right: 6px; | |
} | |
.container .submit-button:hover { | |
background-color: #217dbb; | |
cursor: pointer; | |
} | |
.container .featured-note { | |
color: #949494; | |
font-size: 12px; | |
margin: 4px 0px; | |
line-height: 18px; | |
font-style: italic; | |
} | |
.container form * { | |
outline: none; | |
} | |
.container label { | |
display: block; | |
font-size: 14px; | |
font-weight: bold; | |
user-select: none; | |
} | |
.container label.emoji input { | |
-webkit-appearance: none; | |
-moz-appearance: none; | |
appearance: none; | |
height: 21px; | |
margin: 0; | |
display: none; | |
} | |
.container label.emoji input + span:after { | |
content: "😶"; | |
font-size: 18px; | |
top: 2px; | |
left: 2px; | |
position: relative; | |
height: 18px; | |
display: inline-block; | |
} | |
.container label.emoji input:checked + span:after { | |
content: "😀"; | |
} | |
.container .form--field { | |
/* width: 420px; */ | |
margin: 10px 0; | |
} | |
.container .form--field.-short { | |
width: 120px; | |
} | |
.container .form--price { | |
position: absolute; | |
line-height: 38px; | |
width: 16px; | |
color: #C7C7C7; | |
text-align: center; | |
} | |
.container .form--price + input { | |
padding-left: 14px; | |
} | |
.container .form--container { | |
width: 420px; | |
} | |
.container .form--container.-inline { | |
display: flex; | |
flex-direction: row; | |
justify-content: space-between; | |
margin-bottom: -12px; | |
} | |
.container .form--element { | |
background-color: #fff; | |
border: 1px solid #ECECEC; | |
border-radius: 3px; | |
font-size: 14px; | |
line-height: 28px; | |
padding: 0 4px; | |
color: #3D3D3D; | |
width: 100%; | |
margin: 4px 0; | |
box-sizing: border-box; | |
font-family: 'Open Sans', sans-serif; | |
} | |
.container .form--element:focus { | |
border: 1px solid #FFC145; | |
border-radius: 2px; | |
} | |
.container .form--element:not(.texteare) { | |
height: 30px; | |
} | |
.container .form--element.textarea { | |
height: 80px; | |
resize: none; | |
} | |
.container html, .container body { | |
height: 100%; | |
margin: 0; | |
} | |
.container body { | |
font-family: 'Open Sans', sans-serif; | |
font-size: 16px; | |
background-color: #F3F4F5; | |
cursor: default; | |
} | |
.container a { | |
text-decoration: none; | |
cursor: pointer; | |
} | |
.container ::selection { | |
background-color: #F5617A; | |
color: #fff; | |
} | |
.container ::-moz-selection { | |
background-color: #F5617A; | |
color: #fff; | |
} | |
.add-product { | |
transition: all 0.3s ease; | |
background-color: #FFC145; | |
height: 144px; | |
width: 144px; | |
border-radius: 72px; | |
box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.07); | |
cursor: pointer; | |
} | |
.add-product.open { | |
background-color: #FAFAFA; | |
padding: 18px 32px; | |
border-radius: 5px; | |
width: 100%; | |
max-width: 420px; | |
height: 398px; | |
cursor: default; | |
} | |
.add-product.open form { | |
opacity: 1; | |
transition: opacity 0.1s ease; | |
transition-delay: 0.3s; | |
height: auto; | |
} | |
.add-product .button-copy { | |
text-align: center; | |
line-height: 144px; | |
text-transform: uppercase; | |
font-weight: bold; | |
color: #f7f7f7; | |
} | |
.add-product form { | |
transition: none; | |
opacity: 0; | |
height: 0; | |
overflow: hidden; | |
} | |
.add-product .cancel { | |
font-size: 12px; | |
text-align: center; | |
margin-top: 1em; | |
} | |
.add-product .cancel span { | |
cursor: pointer; | |
} | |
.add-product .cancel span:hover { | |
text-decoration: underline; | |
} | |
.submit-button { | |
display: block; | |
background-color: #3498DB; | |
height: 40px; | |
border-radius: 20px; | |
line-height: 36px; | |
text-align: center; | |
color: #fff; | |
text-transform: uppercase; | |
font-size: 0.875em; | |
border: none; | |
font-weight: 700; | |
padding: 0 34px; | |
margin: 0 auto; | |
} | |
.submit-button img { | |
position: relative; | |
top: 3px; | |
right: 6px; | |
} | |
.submit-button:hover { | |
background-color: #217dbb; | |
cursor: pointer; | |
} | |
.featured-note { | |
color: #949494; | |
font-size: 12px; | |
margin: 4px 0px; | |
line-height: 18px; | |
font-style: italic; | |
} | |
form * { | |
outline: none; | |
} | |
label { | |
display: block; | |
font-size: 14px; | |
font-weight: bold; | |
user-select: none; | |
} | |
label.emoji input { | |
-webkit-appearance: none; | |
-moz-appearance: none; | |
appearance: none; | |
height: 21px; | |
margin: 0; | |
display: none; | |
} | |
label.emoji input + span:after { | |
content: "😶"; | |
font-size: 18px; | |
top: 2px; | |
left: 2px; | |
position: relative; | |
height: 18px; | |
display: inline-block; | |
} | |
label.emoji input:checked + span:after { | |
content: "😀"; | |
} | |
.form--field { | |
/* width: 420px; */ | |
margin: 10px 0; | |
} | |
.form--field.-short { | |
width: 120px; | |
} | |
.form--price { | |
position: absolute; | |
line-height: 38px; | |
width: 16px; | |
color: #C7C7C7; | |
text-align: center; | |
} | |
.form--price + input { | |
padding-left: 14px; | |
} | |
.form--container { | |
width: 420px; | |
} | |
.form--container.-inline { | |
display: flex; | |
flex-direction: row; | |
justify-content: space-between; | |
margin-bottom: -12px; | |
} | |
.form--element { | |
background-color: #fff; | |
border: 1px solid #ECECEC; | |
border-radius: 3px; | |
font-size: 14px; | |
line-height: 28px; | |
padding: 0 4px; | |
color: #3D3D3D; | |
width: 100%; | |
margin: 4px 0; | |
box-sizing: border-box; | |
font-family: 'Open Sans', sans-serif; | |
} | |
.form--element:focus { | |
border: 1px solid #FFC145; | |
border-radius: 2px; | |
} | |
.form--element:not(.texteare) { | |
height: 30px; | |
} | |
.form--element.textarea { | |
height: 80px; | |
resize: none; | |
} | |
html, | |
body { | |
height: 100%; | |
margin: 0; | |
} | |
body { | |
font-family: 'Open Sans', sans-serif; | |
font-size: 16px; | |
background-color: #F3F4F5; | |
cursor: default; | |
} | |
a { | |
text-decoration: none; | |
cursor: pointer; | |
} | |
::selection { | |
background-color: #F5617A; | |
color: #fff; | |
} | |
::-moz-selection { | |
background-color: #F5617A; | |
color: #fff; | |
} | |
</style> | |
<!-- VUE.JS for main 3 tours --> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.3.0/vue.js"></script> | |
<!-- VUE.JS for main 3 tours --> | |
<div id="app"> | |
<div class="add-product" :class="{'open': formOpen}"> | |
<center> | |
<div class="button-copy" v-show="!formOpen" @click="formOpen = true">Хочу этот тур</div> | |
</center> | |
<form action="http://poehali.info/zayavka.php" method="post" > | |
<div class="form--field"> | |
<label>Ваш номер телефона</label> | |
<input type="hidden" name="lead_where" value="<?php the_title( esc_url( get_permalink() ) ) ?>"> | |
<input type="text" class="form--element" name="lead_phone" id="lead_phone" v-model="productData.title" placeholder="+38 0__ ___ __ __" required=""> | |
</div> | |
<!-- <div class="form--container -inline"> --> | |
<div class="form--field"> | |
<label>Сколько человек едет?</label> | |
<input type="number" class="form--element" name="lead_many" id="lead_many" v-model="productData.rating" placeholder="" required="" min="1" max="11" step="1"> | |
</div> | |
<!-- <div class="form--field -short"> | |
<label>Product Price *</label> | |
<span class="form--price">$</span> | |
<input type="text" class="form--element" name="price" v-model="productData.price" placeholder="Price" required="" min="0" max="500" pattern="\d+(\.\d{2})?"> | |
</div> | |
<div class="form--field -short"> | |
<label>List Price *</label> | |
<span class="form--price">$</span> | |
<input type="text" class="form--element" name="list_price" v-model="productData.list_price" placeholder="List Price" required="" min="0" max="500" pattern="\d+(\.\d{2})?"> | |
</div> --> | |
<!-- </div> --> | |
<div class="form--field"> | |
<label>Пожелания по отдыху (если есть)</label> | |
<textarea class="form--element textarea" name="lead_text" id="lead_text" v-model="productData.description" placeholder=""> | |
</textarea> | |
</div> | |
<button type="submit" class="submit-button">Отправить заявку</button> | |
<div class="cancel"><span @click="cancel()">не, передумал(а)</span></div> | |
</form> | |
</div> | |
</div> | |
<script> | |
var vue = new Vue({ | |
el: '#app', | |
data: | |
{ | |
formOpen: false, | |
productData: { | |
title: '', | |
rating: '', | |
price: '', | |
list_price: '', | |
is_featured: false | |
} | |
}, | |
methods: { | |
resetForm: function () { | |
this.productData = { | |
title: '', | |
rating: '', | |
price: '', | |
list_price: '', | |
is_featured: false | |
} | |
}, | |
cancel: function() { | |
this.formOpen = false; | |
this.resetForm(); | |
} | |
} | |
}) | |
</script> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment