Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <section class="hero">
  
  
  <h1 class="header-wrapper">
    
    <span class="house">House</span>
    
    <span class="music">MUSIC</span>
    
  </h1>
  
  
  <p class="lead">Get access to secret shows in your city.</p>
  
  
  <div class="form-wrapper">
    
    <form id="notify-me" data-validate="parsley">
      
      <label for="phone">

        <input type="tel" id="phone" type="number" name="phone" required="required" placeholder="573-555-5555" data-parsley-ui-enabled="false" data-parsley-minlength="14" data-parsley-maxlength="14" class="phone"/>
        
        <i class="fa fa-phone input-icon"></i>
        
      </label>
 
      <button type="submit">
        
        <span>Notify Me</span>
        
      </button>
      <button class="submit--reflection">
        
        <span>Notify Me</span>
        
      </button>
      
    </form>

  </div>
  
  
 </section>
  


   
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Mr+Dafoe);

@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,900);

$dark: rgba(00,00,00,.87);
$light: rgba(255,255,255,.95);
$hint-text:rgba(00,00,00,.25);
$primary-color:rgba(237, 66, 100,1);
$accent-color:rgba(10,191,188,1);
$success-color:rgba(74, 86, 157,1);
$break-xsmall: 320px;
$break-small: 769px;
$break-medium: 992px;
$break-large: 1200px;

*
{
  box-sizing: border-box;
  outline: none;
}

html{
  font-size:16px;
  
  @media screen and (min-width: $break-small){
    font-size:18px;
  }
  @media screen and (min-width: $break-medium){
    font-size:20px;
  }
  @media screen and (min-width: $break-large){
    font-size:22px;
  }
}
html,body
{
  font-family: 'Open Sans',sans-serif;
  margin: 0;
  padding: 0;
}

body
{
  font-family: 'Open Sans',sans-serif;
  font-weight: 400;
  line-height: 1.45;
  color: #333;
}

p
{
  margin-bottom: 1.3em;
}

h1,h2,h3,h4
{
  font-weight: inherit;
  line-height: 1.2;
  margin: 1.414em 0 .5em;
}

h1
{
  margin-top: 0;
  font-size: 3.157em;
}

h2
{
  font-size: 2.369em;
}

h3
{
  font-size: 1.777em;
}

h4
{
  font-size: 1.333em;
}

.lead
{
  font-size: 1.333em;
  margin-bottom: 0;
}

small,.font_small
{
  font-size: .75em;
}

.hero
{
  align-content: center;
  align-items: center;
  bottom: 0;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  height: 100%;
  justify-content: center;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  position: absolute;
  color: $light;
  font-weight: 300;
  font-family: 'Open Sans',sans-serif;
  margin: 0;
  padding: 0;
  background-color: #00214f;
  background-image: url();
  background-repeat: no-repeat;
  background-position: center;
  background-size:cover;
}

.header-wrapper
{
  line-height: 1;
  margin-bottom: 1em;
  position: relative;
  z-index: 0;
  white-space:nowrap;
  font-size:1.75em;
  @media screen and (min-width: $break-small){
    font-size:2.5em;
  }
  @media screen and (min-width: $break-medium){
    font-size:3em;
  }
}

.house
{
  font-family: 'Mr Dafoe',cursive;
  font-size: 4em;
  position: relative;
  z-index: 3;
  padding: 0 .23em 0 .02em;
}

.music
{
  color: $light;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 3.5em;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.05em;
  text-transform: uppercase;
  text-rendering: optimizeLegibility;
  margin-left: -1.6em;
  top: -.13em;
  position: relative;
  z-index: 0;
}

.form-wrapper
{
  margin-top: 1em;
  z-index: 4;
}

form
{
  position: relative;
}

input,button
{
  border: none;
  border-radius: 5px;
  box-shadow: 0 0 1px 1px rgba(0,91,103,.1),0 1px 2px rgba(0,91,103,.25),inset 0 1px 1px rgba(255,255,255,.5);
  font-size: 1em;
  padding: 1em 0 1em 3em;
}

input
{
  border-radius: 5px 0 0 5px;
  color: $dark;
  position: relative;
}

button
{
  color: $light;
  font-weight: 500;
  text-shadow: 0 1px 0 #212121;
  transition: .5s;
  margin-left: -7px;
  border-radius: 0 5px 5px 0;
  box-shadow: 0 0 10px 3px rgba(0,91,103,.1),0 1px 2px rgba(0,91,103,.25),inset 0 1px 1px rgba(255,255,255,0.5);
  width: 9em;
  z-index: 5;
  padding: 1em 2em;
  background: $primary-color;
}
button:hover
{
  background-color:rgb(221, 28, 66);
}
button:active
{
  transition: .1s;
  background-color:rgb(211, 17, 56);
}

button.sent
{
  background: $accent-color;
  transition: 2.25s all ease-in;
}
input.sent
{
  color: $accent-color!important;
  transition: 2s all ease-in;
}

.input-icon.sent
{
  color: $accent-color!important;
  transition: 2.5s all ease-in;
}

label
{
  color: $light;
  margin-right: 0;
  position: relative;
  z-index: 0;
}

input:focus
{
  color: $primary-color;
}


.input-icon
{
  position: absolute;
  top: .05em;
  left: .65em;
  z-index: 2;
  font-size: 1.5em;
  color: $hint-text;
  transition: all .5s;
}
.button-icon
{
  
}
input:focus + .input-icon
{
  color: $primary-color;
  transform: rotate(360deg);
}

.loadingBar
{
  z-index: 4;
}
.submit--reflection
{
  position:absolute;
  right:0;
  top:0;
  z-index:-5;
  animation: pulse 1.5s infinite;
  animation-direction: alternate;

}
@keyframes pulse {
  0% { filter:blur(5px);}
  100% { filter:blur(10px); }
}
::selection
{ color:$light;
  background-color:$primary-color; } 
              
            
!

JS

              
                /* This pen made me realize you can't keyframe CSS gradients. Luckily Mario Klingemann is a genius. Check out his original pen here:

https://codepen.io/quasimondo/pen/lDdrF 

However, because the gradients are added inline, -webkit-background-clip and -webkit-text-color have to be as well.

*/
var colors = new Array(
    [28, 216, 210], [147, 237, 199],

    [237, 66, 100], [255, 237, 188],

    [220, 36, 36], [74, 86, 157],

    [252, 53, 76], [10, 191, 188],

    [248, 87, 166], [255, 88, 88],

    [229, 93, 135], [95, 195, 228]
);

var step = 0;
//color table indices for: 
// current color left
// next color left
// current color right
// next color right
var colorIndices = [0, 1, 2, 3];

//transition speed
var gradientSpeed = 0.005;

function updateGradient() {
    var c0_0 = colors[colorIndices[0]];
    var c0_1 = colors[colorIndices[1]];
    var c1_0 = colors[colorIndices[2]];
    var c1_1 = colors[colorIndices[3]];

    var istep = 1 - step;
    var r1 = Math.round(istep * c0_0[0] + step * c0_1[0]);
    var g1 = Math.round(istep * c0_0[1] + step * c0_1[1]);
    var b1 = Math.round(istep * c0_0[2] + step * c0_1[2]);
    var color1 = "#" + ((r1 << 16) | (g1 << 8) | b1).toString(16);

    var r2 = Math.round(istep * c1_0[0] + step * c1_1[0]);
    var g2 = Math.round(istep * c1_0[1] + step * c1_1[1]);
    var b2 = Math.round(istep * c1_0[2] + step * c1_1[2]);
    var color2 = "#" + ((r2 << 16) | (g2 << 8) | b2).toString(16);

    $('.house').css({
        background: "-webkit-gradient(linear, left top, right top, from(" + color1 + "), to(" + color2 + "))"
    }).css({
        background: "-moz-linear-gradient(left, " + color1 + " 0%, " + color2 + " 100%)"
    }).css({
        '-webkit-text-fill-color': 'transparent',
        '-webkit-background-clip': 'text'
    });


    step += gradientSpeed;
    if (step >= 1) {
        step %= 1;
        colorIndices[0] = colorIndices[1];
        colorIndices[2] = colorIndices[3];

        //pick two new target color indices
        //do not pick the same as the current one
        colorIndices[1] = (colorIndices[1] + Math.floor(1 + Math.random() * (colors.length - 1))) % colors.length;
        colorIndices[3] = (colorIndices[3] + Math.floor(1 + Math.random() * (colors.length - 1))) % colors.length;

    }
}

setInterval(updateGradient, 10);




// The rest of this is just polish. Ignore at will.
// INPUT MASK
$("#phone").mask("(999) 999-9999");


$("#phone").on("blur", function() {
    var last = $(this).val().substr($(this).val().indexOf("-") + 1);

    if (last.length == 3) {
        var move = $(this).val().substr($(this).val().indexOf("-") - 1, 1);
        var lastfour = move + last;

        var first = $(this).val().substr(0, 9);

        $(this).val(first + '-' + lastfour);
    }
});

// BUTTON SUBMISSION

$(function() {
    $('form').submit(function(e) {
        e.preventDefault();
      
      //on successful submission
        if ($(this).parsley().isValid()) {
            trigger: 'keyup',
            $(this).find("button, input, .input-icon").addClass("sent");
            $(this).find("button").html("Sending...");
            $(this).find("button[type='submit'], input").prop('disabled', true);
          
            // http://stackoverflow.com/questions/591269/settimeout-and-this-in-javascript
            var that = this; 
          
            //SUCCESS STATE
            setTimeout(function() {
                $(that).find('button').html("<span class='fa fa-check button-icon'></span> Sent!");
                $(that).find('input-icon').remove
            }, 3500);
          
            //RESET STATE
            setTimeout(function() {
                $(that).find('button, input, .input-icon').removeClass('sent');
                $(that).find('button').html("Notify Me");
                $(that).find(':input', '#myform')
                    .not(':button, :submit, :reset, :hidden')
                    .val('')
                    .removeAttr('checked')
                    .removeAttr('selected');
              $(that).find("button[type='submit'], input").prop('disabled', false);
            }, 4700);



        }
    });
});
              
            
!
999px

Console