Pen Settings

HTML

CSS

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.

+ 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

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.

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 id="demo">
		<h2>Deter plugin overview</h2>
		<p>
			<label for="testPassword1">Change password input aspect (color of the box-shadow): </label>
			<input id="testPassword1" type="password"></input>
		</p>
		<p>
			<label for="testPassword2">Change background of a sibling box (with css3 transition) : </label>
			<input id="testPassword2" type="password"></input>
		</p>
		<p>					
			<label for="testPassword31">Change background of the current input  (textcolor = normal / complementary / monochrome): </label>
			<input id="testPassword31" type="password"></input>
			<input id="testPassword32" type="password"></input>
			<input id="testPassword33" type="password"></input>
		</p>
		<p>					
			<label for="testPassword3bis">Change background of the body (only if the password input got the focus) : </label>
			<input id="testPassword3bis" type="password"></input>
		</p>
		<p>					
			<label for="testPassword4">Generate an identicon (or a colored box on old browsers) : </label>
			<input id="testPassword4" type="password"></input>
		</p>
		<h2>Advanced usage</h2>
		<p>					
			<label for="testPassword5">Bind only on the "change" event and force redraw on fingerprint hover :</label>
			<input id="testPassword5" type="password"></input>
		</p>

		<p id="span1">
			<label for="testSpan1">Use deter with full custom behaviour (get a look into the code):</label>
			<span id="testSpan1">Click on me !</span>
			<span class="colorBox"></span>
			<span class="buttons">
				<a class="clear" href="#" title="clear the span content">clear</a>
				<a class="fill" href="#" title="fill the span with new content">fill with a random string</a>
			</span>
		</p>

		<p id="dynamicContainer">
			<label for="#">Use deter on dom element created dynamically (get a look into the code):</label>
		</p>

		<h2>A real use case</h2>
		<p id="password6">

			<label for="testPassword6">Enter your password:</label>
			<input id="testPassword6" type="password" placeholder="password"></input>
		</p>
	</section>
              
            
!

CSS

              
                body
{
    /* transition */
    -webkit-transition: background-color 0.3s;
    -moz-transition: background-color 0.3s;
    -ms-transition: background-color 0.3s;
    -o-transition: background-color 0.3s;
    transition: background-color 0.3s;
    min-height: 1000px;
    margin: 0;
    font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
    font-size: 14px;
    line-height: 20px;
    color: #333333;
    background-color: #ffffff;
    padding-right: 20px;
    padding-left: 20px;
    margin-bottom:150px;
}

h2
{
    font-size: 31.5px;
}

h1, h2, h3
{
    line-height: 40px;
}

h1, h2, h3, h4, h5, h6
{
    margin: 10px 0;
    font-family: inherit;
    font-weight: bold;
    line-height: 20px;
    color: inherit;
    text-rendering: optimizelegibility;
}

label
{
    display: block;
    margin-bottom: 5px;
}

label, input, button, select, textarea
{
    font-size: 14px;
    font-weight: normal;
    line-height: 20px;
}

textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input
{
    background-color: #ffffff;
    border: 1px solid #cccccc;
    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    -webkit-transition: border linear .2s, box-shadow linear .2s;
    -moz-transition: border linear .2s, box-shadow linear .2s;
    -o-transition: border linear .2s, box-shadow linear .2s;
    transition: border linear .2s, box-shadow linear .2s;
}

select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input
{
    display: inline-block;
    height: 20px;
    padding: 4px 6px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 20px;
    color: #555555;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    vertical-align: middle;
}

input, textarea, .uneditable-input
{
    margin-left: 0;
}

input, button, select, textarea
{
    font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
}

textarea:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="date"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, input[type="number"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="color"]:focus, .uneditable-input:focus
{
    border-color: rgba(82, 168, 236, 0.8);
    outline: 0;
    outline: thin dotted \9;
    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
    -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
}

input[type="password"]
{
    float: left;
}

.deter-container
{
    clear:both;
}

#testSpan1
{
    float: left;
    cursor: pointer;
    border: 1px solid #cccccc;
    line-height: 27px;
    padding: 0 10px;
    min-height: 27px;
    min-width: 20px;
}

#span1 span.buttons
{
    clear: both;
    display: block;
    margin: 40px 5px 0;
}

.colorBox,
.deter-container > span.deter-fingerprint
{
    display: block;
    float: left;
    border: 1px solid #cccccc;
    width: 27px;
    height: 27px;
    margin-left: 10px;
    /* transition */
    -webkit-transition: background-color 1s;
    -moz-transition: background-color 1s;
    -ms-transition: background-color 1s;
    -o-transition: background-color 1s;
    transition: background-color 1s;
}

.deter-fingerprint
{
    float: left;
}

p, h2
{
    clear: both;
}

h2
{
    padding-top: 20px;
    color: #919191;
}

label
{
    padding: 20px 0 5px;
    font-weight: bold;
}

#testPassword6
{
    padding-right: 45px;
    width: 250px;
    height: 30px;
    font-size: 22px;
}

#password6
{
    float: left;
    position: relative;
}

#password6 .deter-fingerprint
{
    position: absolute;
    right: 1px;
    bottom: 11px;
    height: 100%;
    width: 30px;
    height: 38px;
    width: 38px;
    border: 0;
    cursor: text;
}

#password6 .deter-container.focused .deter-fingerprint
{
    cursor: default;
}

#password6 .deter-fingerprint canvas
{
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    -webkit-transition: border linear .2s, box-shadow linear .2s;
    -moz-transition: border linear .2s, box-shadow linear .2s;
    -o-transition: border linear .2s, box-shadow linear .2s;
    transition: border linear .2s, box-shadow linear .2s;
}

#password6 .deter-container.focused .deter-fingerprint canvas
{
    box-shadow: -5px 0px 20px -5px #aaaaaa;
}
              
            
!

JS

              
                $(document).ready(function(){

			/**
			 * Modify current input shape + use options
			 */		
			$('#testPassword1')
				.deter('border', {opacity: 0.8});

			/**
			 * Modify background color of a sibling box.
			 */
			$('#testPassword2')
				.deter('box-color');

			/**
			 * Modyfy elem background color
			 */
			$('#testPassword31')
				.deter('background', {addDeterExtraMarkups: false, textColorMode:'default'});
			$('#testPassword32')
				.deter('background', {addDeterExtraMarkups: false, textColorMode:'complementary'});
			$('#testPassword33')
				.deter('background', {addDeterExtraMarkups: false, textColorMode:'monochrome'});

			/**
			 * Modyfy body background color + use delegated selector + chain other jquery events
			 */
			$('#testPassword3bis')
				.deter('background', {events: 'keyup focus', target: 'body'})
				.on('blur', function(e){
					$('body')
						.css('background-color', '');
				});

			/**
			 * Generate an identicon into sibling element.
			 */
			$('#testPassword4')
				.deter('box-identicon');

			/**
			 * Generate an identicon on the 'change' event and force redraw.
			 */
			$('#testPassword5')
				.deter('box-identicon', { events: 'change' });

			//resize the element and force the fingerprint canevas redraw
			$('#testPassword5').siblings('.deter-fingerprint')
				.hover(function(e){
					var $this = $(this);
					var $deterPassword = $this.siblings('.deter-password');
					$this
						.css('width', '100px')
						.css('height', '100px');
					$deterPassword
						.trigger('repaint', {'value': $deterPassword.val()});
				}, function(e){
					var $this = $(this);
					var $deterPassword = $this.siblings('.deter-password');
					$this
						.css('width', '')
						.css('height', '');
					$deterPassword
						.trigger('repaint', {'value': $deterPassword.val()});
				});

			/**
			 * Modify sibling box background color from a span and not an input.
			 */
			$('#testSpan1').deter(function(settings, deter, value){
				//if no value, come back to the initial state (transparent background)
				$(this).siblings('.colorBox')
					.css('background-color', (value == '')? '' : deter.hex);
			},{
				events: 'click',
				addDeterExtraMarkups : false,
				getContent: function(){
			 		return $(this).text();
		 		}
			});

			//add utilites button for the demo
			$('#span1 .buttons a.clear').click(function(e){
				e.preventDefault();
				$('#testSpan1').text('');
			});

			$('#span1 .buttons a.fill').click(function(e){
				e.preventDefault();
				//generate a random string
			    var text = '';
			    var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
			    var i;
			    var max = Math.floor(Math.random() * 20) + 1;
			    for(i = 0; i < max; i++){
			        text += possible.charAt(Math.floor(Math.random() * possible.length));
			    }
				$('#testSpan1').text(text);
			});

  		/**
			 * Delegate deter behaviour (deter is compatible with dynamic dom creation)
			 */
  
			$('body').deter('box-identicon', { selectorDelegated: '.dynamicInputsPassword' })

			// ... later ...
			
			//create the elements 
			$('#dynamicContainer')
				.append('<input type="password" id="dynamicPassword1" class="dynamicInputsPassword"></input>')
				.append('<input type="password" id="dynamicPassword2" class="dynamicInputsPassword"></input>');
			//add deter extra markups
        $.deter.wrapWithMarkup('.dynamicInputsPassword', 'box-identicon');
  
			/**
			 * A more realistic identicon password case + fancy effects
			 */
 			$('#testPassword6')
				.deter();

		});
              
            
!
999px

Console