<section class="parallax-feature">
<div class="starfield"></div>
<i class="fa fa-paper-plane"></i>
<div class="feature-title">
SUBSCRIBE TO OUR NEWSLETTER
</div>
<div class="feature-input">
<div id="subscribe">
<input type="text" class="enteremail error" name="EMAIL" id="subscribe-email" placeholder="Enter your email address" spellcheck="false">
<button type="submit" id="signup-button" class="signup-button">Submit</button>
<label for="subscribe-email" class="subscribe-message error" style="">
<i class="fa fa-warning"></i>
<span class="message-content"></span>
</label>
</div>
</div>
</section>
html, body {
height: 100%;
width: 100%;
}
.starfield { height:100%; left:0; position:absolute; top:0; width:100%; z-index:0;}
*, *:before, *:after {
box-sizing: border-box;
margin:0; padding:0;
}
body{
padding: 0;
margin: 0;
font-family: 'Open Sans', sans-serif;
}
.parallax-feature{
/* z-index: -2; */
padding: 80px;
text-align: center;
min-height: 100vh;
background: url("https://download.unsplash.com/photo-1422640805998-18a4dd89bec2") center center no-repeat;
background-size: cover;
i.fa.fa-paper-plane {
font-size: 29px;
color: white;
padding: 15px;
}
.feature-title{
font-family: "Iceberg", sans-serif;
font-size: 20px;
font-weight: 300;
color: #FFFFFF;
margin: 0px;
letter-spacing: 1px;
text-transform: uppercase;
padding: 0 0 40px 0;
font-family: "Iceberg", sans-serif;
}
}
.enteremail {
font-family: 'Open Sans', sans-serif;
height: 55px;
word-spacing: 1px;
padding-left: 20px;
padding-right: 20px;
padding-top: 1px;
width: 70%;
outline: none;
background-color: rgba(255, 255, 255, 0.1);
border: solid 1px rgba(255, 255, 255, 0.17);
color: #FFFFFF;
font-size: 13px;
font-weight: 400;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.signup-button {
width: 20%;
font-family: 'Open Sans', sans-serif;
height: 55px;
/* background-color: rgba(22, 182, 234, 0.52); */
background-color: #131313;
/* background-color: #303e49; */
border: none;
outline: none;
position: relative;
float: none;
font-size: 14px;
border-radius: 0px;
font-weight: 700;
color: rgba(255, 255, 255, 1);
border: none;
cursor: pointer;
z-index: 100;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-appearance: none;
-webkit-background-clip: padding-box;
-webkit-transition: all 0.3s ease-in-out !important;
-moz-transition: all 0.3s ease-in-out !important;
-ms-transition: all 0.3s ease-in-out !important;
-o-transition: all 0.3s ease-in-out !important;
transition: all 0.3s ease-in-out !important;
}
label.subscribe-message {
height: 2.5em;
padding: 10px 20px;
color: #fff;
font-size: 13px;
float: none;
top: 0;
display: block;
}
label.subscribe-message{
display: none;
}
label.error i {
color: #16b6ea;
}
.parallax-background {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: -1;
background-attachment: fixed;
background-clip: border-box;
background-origin: padding-box;
background-repeat: no-repeat;
background-position: center top;
background-color: rgba(0, 0, 0, 0.3);
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.parallax {
position: relative !important;
z-index: 1 !important;
background-repeat: no-repeat !important;
background-attachment: fixed !important;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.parallax-feature::after{
content: '';
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-image: url('http://mountaintheme.com/themeforest/mountain/demo-3/images/overlay.png');
background-repeat: repeat;
background-color: rgba(95,96,97,0.4);
z-index: -1;
}
View Compiled
/*
https://tympanus.net/Development/ProgressButtonStyles/
*/
function validateEmail(email) {
var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
return re.test(email);
}
$("#signup-button").click(function(e){
var $email = $("#subscribe-email").val();
if(validateEmail($email)){
//alert("Valid email!");
$(".message-content").html("Now you are subscribed!");
}else{
//alert("Invalid email!");
$(".message-content").html("E-mail address is not valid.");
}
$(".subscribe-message").fadeIn(1500).css("display","block").delay(2000).fadeOut(500);
e.preventDefault();
});
This Pen doesn't use any external CSS resources.