cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

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.

            
              
<div class="form-wrapper">
	<div class="top">
		<div class="colors">
		</div>
	</div>
	<h1 class="h1h">
	Fort.js </h1>
	<form name="form" action="#">
		<div class="form">
			<div class="form-item">
				<input type="text" name="text" required="required" placeholder="Name" autocomplete="off">
			</div>
			<div class="form-item">
				<input type="text" name="text" required="required" placeholder="Username" autocomplete="off">
			</div>
			<div class="form-item">
				<input type="password" name="password" required="required" placeholder="Password" autocomplete="off">
			</div>
			<div class="button-panel">
				<input type="submit" class="button" title="Sign In" value="Test It Out">
				<ul>
					<li class="lil">
					<p class="view">
						<a href="https://github.com/Colourity/Fort.js" id="ref">View on GitHub</a>
					</p>
					</li>
					 or
					<li>
					<p class="view">
						<a href="https://twitter.com/intent/tweet?text=Fort-js+-+A+Modern+Progress+Bar+for+Form+Completion.&url=https://bit.ly/1gQQ4V8" id="ref">Share</a>
					</p>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>


            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Open+Sans:300);
 * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    text-align: center;
    background: #fff;
    color: #7b8993;
    font: 300 87.5%/1.5em'Open Sans', sans-serif;
}
.form-wrapper {
    padding-top: 2%;
    border-radius: 2px;
    margin: 50px auto;
    position: relative;
    width: 375px;
}
form {
    padding: 30px 20px 0;
}
.form-item {
    margin-bottom: 10px;
    width: 100%;
}
.form-item input {
    border: 1px solid #ccc;
    border-radius: 2px;
    color: #000;
    font-family:'Open Sans', sans-serif;
    font-size: 1em;
    height: 50px;
    padding: 0 16px;
    transition: background 0.3s ease-in-out;
    width: 100%;
}
.form-item input:focus {
    outline: none;
    border-color: #9ecaed;
    box-shadow: 0 0 10px #9ecaed;
}
.button-panel {
    margin: 20px 0 0;
    width: 100%;
}
.button-panel .button {
    -webkit-appearance: none;
    background: #009dff;
    border: none;
    border-radius: 2px;
    color: #fff;
    cursor: pointer;
    height: 50px;
    font-family:'Open Sans', sans-serif;
    font-size: 1.2em;
    letter-spacing: 0.05em;
    text-align: center;
    text-transform: uppercase;
    transition: background 0.3s ease-in-out;
    width: 100%;
}
.button:hover {
    background: #00c8ff;
}
@media only screen and (max-width : 320px) {
    .form-wrapper {
        padding-top: 10%;
        border-radius: 2px;
        margin: 50px auto;
        position: relative;
        width: 320px;
    }
}
.cent {
    text-align: center;
    color: #000;
}
.view {
    text-align: center;
    text-decoration: none;
    color: #7b8993;
    padding-top: 10px;
}
#ref {
    text-align: center;
    text-decoration: underline;
    color: #7b8993;
    padding-top: 8px;
    font-size: 16px;
}
#ref:hover {
    text-align: center;
    color: #009dff;
    text-decoration: underline;
    -webkit-animation: hue 60s infinite linear;
    padding-top: 8px;
    font-size: 16px;
}
ul li {
    display: inline-block;
    list-style-type: none;
    text-align: center;
}
.h1h {
    color: #000;
    text-align: center;
}
.lil {
    display: inline-block;
}

.top {
    background: #009dff;
    /*background:linear-gradient(to right,#009dff 0,#00c8ff 100%);*/
    position:fixed;
    z-index:1031;
    top:0;
    left:0;
    height:9px;
    transition:all 1s;
    width:0;
    overflow: hidden;
}
.colors {
    width: 100%;
    height: 4px;
}
            
          
!
            
              function solid() {
    function cback(e) {
        var t = [];
        for (var n = inputs.length; n--;) {
            if (!inputs[n].value.length) t.push(inputs[n]);
        }
        var r = t.length;
        var i = inputs.length;
        var s = document.querySelectorAll(".top");
        for (var o = s.length; o--;) {
            s[o].style.width = 100 - r / i * 100 + "%";
        }
    }
    var forms = document.querySelectorAll(".form"),
        inputs = [];
    for (var i = forms.length; i--;) {
        var els = forms[i].querySelectorAll("input, textarea, select");
        for (var j = els.length; j--;) {
            if (els[j].type != "button" && els[j].type != "submit") {
                inputs.push(els[j]);
                els[j].addEventListener("input", cback, false);
            }
        }
    }
}

function flash() {
    function cback(e) {
        var t = [];
        for (var n = inputs.length; n--;) {
            if (!inputs[n].value.length) t.push(inputs[n]);
        }
        var r = t.length;
        var i = inputs.length;
        var s = document.querySelectorAll(".top");
        for (var o = s.length; o--;) {
            s[o].style.width = 100 - r / i * 100 + "%";
            s[o].style.background = cols[i - r - 1];
        }
    }
    var forms = document.querySelectorAll(".form"),
        inputs = [];
    for (var i = forms.length; i--;) {
        var els = forms[i].querySelectorAll("input, textarea, select");
        for (var j = els.length; j--;) {
            if (els[j].type != "button" && els[j].type != "submit") {
                inputs.push(els[j]);
                els[j].addEventListener("input", cback, false);
            }
        }
    }

    var cols = ["#1ABC9C", "#EC7063", "#3498DB"];
}

function gradient() {
    function cback(e) {
        var t = [];
        for (var n = inputs.length; n--;) {
            if (!inputs[n].value.length) t.push(inputs[n]);
        }
        var r = t.length;
        var i = inputs.length;
        var s = document.querySelectorAll(".top");
        for (var o = s.length; o--;) {
            s[o].style.width = 100 - r / i * 100 + "%";
        }
    }
    var forms = document.querySelectorAll(".form"),
        inputs = [];
    for (var i = forms.length; i--;) {
        var els = forms[i].querySelectorAll("input, textarea, select");
        for (var j = els.length; j--;) {
            if (els[j].type != "button" && els[j].type != "submit") {
                inputs.push(els[j]);
                els[j].addEventListener("input", cback, false);
            }
        }
    }
}

function sections() {
    function cback(e) {
        var t = [];
        for (var n = inputs.length; n--;) {
            if (!inputs[n].value.length) t.push(inputs[n]);
        }
        var r = t.length;
        var i = inputs.length;
        var s = document.querySelectorAll(".top");
        for (var o = s.length; o--;) {
            s[o].style.width = 100 - r / i * 100 + "%";
        }
    }
    var forms = document.querySelectorAll(".form"),
        inputs = [];
    for (var i = forms.length; i--;) {
        var els = forms[i].querySelectorAll("input, textarea, select");
        for (var j = els.length; j--;) {
            if (els[j].type != "button" && els[j].type != "submit") {
                inputs.push(els[j]);
                els[j].addEventListener("input", cback, false);
            }
        }
    }


    function generateCSSGradient(colours) {
        var l = colours.length,
            i;
        for (i = 0; i < l; i++) colours[i] = colours[i].join(" ");
        return "linear-gradient( to right, " + colours.join(", ") + ")";
    }

    //Edit your colors here. Enter the color twice.
    var cols = [
        ["#1ABC9C", "0%"],
        ["#1ABC9C", "33.3%"],
        ["#EC7063", "33.3%"],
        ["#EC7063", "66.6%"],
        ["#3498DB", "66.6%"],
        ["#3498DB", "100%"]
    ];
    document.getElementsByClassName('top').innerHTML = '<div class="colors"></div>';
    document.querySelector(".colors").style.background = generateCSSGradient(cols);

    var window_width = window.innerWidth + "px";
    document.querySelector(".colors").style.width = window_width;
};
flash();

            
          
!
999px
Loading ..................

Console