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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <div class="container">

	<h1>Avatar Upload Example</h1>

	
	<div class="row">
		<div class="col-sm-3">
			<ul class="nav nav-pills nav-stacked" role="tablist">
				<li role="presentation" class="active"><a href="#step1" aria-controls="step1" role="tab" data-toggle="tab"><b>STEP 1:</b> <small>Before Image Selection</small> <span class="fa fa-angle-right pull-right"></span></a></li>
				<li role="presentation"><a href="#step2" aria-controls="step2" role="tab" data-toggle="tab"><b>STEP 2:</b> <small>After Image Selection</small> <span class="fa fa-angle-right pull-right"></span></a></li>
				<li role="presentation"><a href="#step3" aria-controls="step3" role="tab" data-toggle="tab"><b>STEP 3:</b> <small>During Image Processing</small> <span class="fa fa-angle-right pull-right"></span></a></li>
				<li role="presentation"><a href="#step4" aria-controls="step4" role="tab" data-toggle="tab" id="fadeInOut"><b>STEP 4:</b> <small>After Image Processing</small> <span class="fa fa-angle-right pull-right"></span></a></li>
				<li role="presentation"><a href="#step5" aria-controls="step5" role="tab" data-toggle="tab"><b>STEP 5:</b> <small>Complete</small> <span class="fa fa-angle-right pull-right"></span></a></li>
			</ul>
		</div>
		<div class="col-sm-9">
			<div role="tabpanel">
				<div class="tab-content">
					<div role="tabpanel" class="tab-pane active" id="step1">
						<h4>Before Image Selection</h4>
						<div class="avatarWrapper">
							<div class="avatar cursor-pointer">
								<div class="uploadOverlay"><i class="fa fa-cloud-upload"></i></div>
								<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/20625/avatar-bg.png">
							</div>
						</div>
						<blockquote>Before a user uploads their avatar, if they hover over the placeholder, it will show the upload button, if they click it will allow them to browse for an image to upload.</blockquote>
					</div>
					<div role="tabpanel" class="tab-pane" id="step2">
						<h4>After Image Selection</h4>
						<div class="avatarWrapper">
							<div class="avatarNav">
								<a href="#" class="avZoomIn" data-toggle="tooltip" data-placement="right" title="Zoom In"><span class="fa fa-plus-circle"></span></a>
								<a href="#" class="avZoomOut" data-toggle="tooltip" data-placement="right" title="Zoom Out"><span class="fa fa-minus-circle"></span></a>
								<a href="#" class="avSave" data-toggle="tooltip" data-placement="right" title="Save"><span class="fa fa-cloud-upload"></span></a>
								<span class="divider"><span class="fa fa-ellipsis-h"></span></span>
								<a href="#" class="avDelete" data-toggle="tooltip" data-placement="right" title="Delete"><span class="fa fa-trash"></span></a>
							</div>
							<div class="avatar active cursor-move">
								<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/20625/chris-02-800x800.jpg">
							</div>
						</div>
						<blockquote>After the user has seleted their avatar image it will appear in the avatar placeholder window.  This window will allow the user to zoom in and out, and drag the image around to place where they like.</blockquote>
					</div>
					<div role="tabpanel" class="tab-pane" id="step3">
						<h4>During Image Processing</h4>
						<div class="avatarWrapper">
							<div class="avatar cursor-wait">
								<div class="processingOverlay"></div>
								<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/20625/chris-02-800x800.jpg">
							</div>
						</div>
						<blockquote>After the user clicks on the save button, the image will be resized and cropped on the client side before it is automatically uploaded to the server.</blockquote>
					</div>
					<div role="tabpanel" class="tab-pane" id="step4">
						<h4>After Image Processing</h4>
						<div class="avatarWrapper">
							<div class="avatar">
								<div class="uploadCompleteOverlay cursor-wait"><i class="fa fa-check"></i></div>
								<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/20625/chris-02-800x800.jpg">
							</div>
						</div>
						<blockquote>After processing, the window will show a green background with a check mark giving the user some feedback that their avatar was uploaded to the server successfully, then will fade out after a few seconds to show their final avatar.</blockquote>
					</div>
					<div role="tabpanel" class="tab-pane" id="step5">
						<h4>After Image Upload Complete</h4>
	<div class="avatarWrapper">
		<div class="avatar cursor-pointer">
			<div class="uploadOverlay"><i class="fa fa-cloud-upload"></i></div>
			<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/20625/chris-02-800x800.jpg">
		</div>
	</div>
	<blockquote>If the user hovers over their avatar again it will show the upload button again to start the process over if they wish to replace their current avatar.</blockquote>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
            
          
!

CSS

            
              
@mixin transition($settings) {
	-webkit-transition: $settings;
	-moz-transition: $settings;
	-ms-transition: $settings;
	-o-transition: $settings;
	transition: $settings;
}
@mixin delay($time){
	-webkit-transition-delay: $time;
   transition-delay: $time;
}

$red: #CC0000;

body {
	font-family: 'helvetica neue', helvetica, arial, sans-serif;
  background-color: #EDEBE1;
	color: #98907C;
	padding: 50px;
}
h1 {
	margin: -50px -50px 40px -50px;
	border-radius: 8px 8px 0 0;
	background-color: $red;
	font-weight: 100;
	padding: 50px 0;
	font-size: 42px;
	color: #FFF;
}
h4 {
	font-weight: 100;
	font-size: 30px;
}
hr {
	border-color: #DBD5C2;
  border-style: dotted;
	margin: 40px 0;
}
blockquote {
	border-color: #E2DDD2;
	text-align: left;
	font-size: 15px;
}
.container {
	background-color: rgba(255, 255, 255, 0.4);
	padding: 50px 50px 50px 50px;
	border-radius: 8px;
	text-align: center;
}
.avatarWrapper {
	position: relative;
	margin: 0 auto;
	width: 258px;
}
.avatar {
	background-color: #edebe1;
	border-radius: 100%;
	height: 216px;
	width: 216px;
	padding: 8px 50px 8px 0;
	&.active {
		border-radius: 100% 0 20px 100%;
		background-color: $red;
	}
	img {
		border-radius: 100%;
		width: 200px;
		margin-left:8px;
	}
	.uploadOverlay, .uploadCompleteOverlay {
		background-color: rgba(204, 1, 1,0.8);
		@include transition(all 150ms ease);
		background-repeat: no-repeat;
		background-position: center;
		border-radius: 100%;
		position: absolute;
		height: 200px;
		width: 200px;
		left: 8px;
		top: 0;
		opacity: 0;
		i {
			vertical-align: bottom;
			display:inline-block;
			line-height: 200px;
			text-align: center;
			font-size: 40px;
			height: 200px;
			width: 200px;
			color:white;
		}
	}
	&:hover .uploadOverlay {
		@include transition(all 150ms ease);
		opacity: 1;
		top: 8px;
	}
	.uploadCompleteOverlay {
		background-color: rgba(104, 174, 0, 0.9);
		opacity: 1;
		top: 8px;
	}
	.processingOverlay {
		background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/20625/loading2.gif');
		background-color: rgba(204, 1, 1,0.8);
		background-repeat: no-repeat;
		background-position: center;
		border-radius: 100%;
		position: absolute;
		height: 200px;
		width: 200px;
		left: 8px;
		top: 8px;
	}
}
.avatarNav {
	background-color: $red !important;
	position: absolute;
	top: 0;
	right: 0;
	width: 42px;
	height: 100%;
	font-size: 30px;
	border-radius: 0 10px 10px 0;
	color: #fff;
	a {
		color: #fff;
		opacity:1;
		&:hover {
			opacity:0.7;
		}
	}
	.avZoomIn, .avZoomOut, .avSave, .avDelete {
		position: absolute;
	}
	.avZoomIn {
		top: 20px;
		left: 6px;
	}
	.avZoomOut {
		top: 55px;
		left: 6px;
	}
	.divider {
		position: absolute;
    top: 91px;
    left: 7px;
    color: #A70000;
    font-size: 20px;
    text-align: center;
    width: 24px;
	}
	.avSave {
		top: 112px;
		left: 4px;
  }
	.avDelete {
    background-color: #f5f3ed;
    color: #B5AFA3;
    top: 174px;
    left: 0px;
    width: 42px;
    border-radius: 10px 0 0 0;
  }
}
.cursor-pointer {
	cursor: pointer;
}
.cursor-move{
	cursor: move;
}
.cursor-wait{
	cursor: wait;
}
.tooltip {
	white-space: nowrap;
}
ul.nav.nav-pills.nav-stacked {
	text-align: left;
	margin-bottom: 50px;
	li a {
		color: #98907C;
		.fa-angle-right {
			display: none;
			line-height: 20px;
		}
		&:hover {
			background-color: #EAE6DB;
			.fa-angle-right {
				display: block;
			}
		}
	}
	li.active a {
		background-color: $red;
		color: #fff;
		.fa-angle-right {
			display: block;
		}
	}
}
.fast {
	-webkit-animation-duration: 200ms;
   animation-duration: 200ms;
}
            
          
!

JS

            
              $(function () {
  $('[data-toggle="tooltip"]').tooltip();
});
$('#fadeInOut').on('click', function(){
	$('.uploadCompleteOverlay').show().addClass('animated zoomIn');
	setTimeout(function(){
    $('.uploadCompleteOverlay').addClass('zoomOut');
  }, 2000);
	setTimeout(function(){
    $('.uploadCompleteOverlay').removeClass('animated zoomIn zoomOut').hide();
  }, 3000);
});
            
          
!
999px

Console