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

              
                <head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Guides.js by Joe Templeton</title>
	<link rel="stylesheet" type="text/css" href="style/stylesheets/screen.css">
 
	<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,300italic' rel='stylesheet' type='text/css'>

	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
	<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
</head>

<body>

	<div class="panel">
		<div class="controls">
			<button class="control x">X</button>
			<button class="control y selected">Y</button>
			<!--<input class="angle" type="text" placeholder="angle">
			<input class="coords" type="text" placeholder="x, y">-->
		</div>

		<div class="palette">
			<button class="color c1"></button>
			<button class="color c2"></button>
			<button class="color c3"></button>
			<button class="color c4"></button>
			<button class="color c5"></button>
			<button class="color c6"></button>
		</div>
	</div>
  
  <h1>Dev Panel</h1>
  <p>Set guides with left panel</p>

</body>
              
            
!

CSS

              
                html, body{
	height: 100%;
  margin: 0;
}

h1{
  text-align: center;
  font-family: 'Roboto', sans-serif;
  font-weight: 300;
  margin-bottom: -0.25em;
  font-size: 4em;
  color: #95a5a6;
}

p{
  text-align: center;
  font-family: 'Roboto', sans-serif;
  font-weight: 300;
  font-style: italic;
  font-size: 1.5em;
  color: #95a5a6;
}

$c1: #2ecc71;
$c2: #3498db;
$c3: #9b59b6;
$c4: #e74c3c;
$c5: #f2ca27;
$c6: #7f8c8d;

@mixin transition($target, $duration){
	-webkit-transition: $target $duration;
	   -moz-transition: $target $duration;
	   	-ms-transition: $target $duration;
	   	 -o-transition: $target $duration;
	   	    transition: $target $duration;
}

@mixin transform($transform){
	-webkit-transform: $transform;
	   -moz-transform: $transform;
	   	-ms-transform: $transform;
	   	 -o-transform: $transform;
	   	    transform: $transform;
}

.color{
	float: left;
	width: 2em;
	height: 2em;
	margin: 1em 0 0 1em;
	border-radius: 0.25em;
	opacity: 0.7;
	@include transition(all, 0.1s);
}

.color:hover{
	opacity: 1;
	@include transform(scale(1.2));
}

.guideX{
	bottom: 7em;
	height: 20px;
	width: 100%;
	position: absolute;

	.line{
		width: 100%;
		height: 1px;
		margin-top: 10px;
	}
}

.guideY{
	left: 7em;
  top: 0;
	height: 100%;
	width: 20px;
	position: fixed;

	.line{
		height: 100%;
		width: 1px;
		margin-left: 10px;
	}
}

.c1{ background: $c1; }
.c2{ background: $c2; }
.c3{ background: $c3; }
.c4{ background: $c4; }
.c5{ background: $c5; }
.c6{ background: $c6; }

.panel{
	position: fixed;
	width: 7em;
  height: 100%;
	opacity: 0.1;
	@include transition(all, 0.25s);
  z-index: 1000;
}

.panel:hover{
	opacity: 1;
}

.controls{
	position: relative;
}

button{
	position: relative;
	width: 5em;
	height: 2em;
	margin: 0;
	padding: 0;
	background: #bdc3c7;
	border-radius: 0.25em;
	line-height: 2em;
	text-align: center;
	color: white;
	font-family: 'Roboto', sans-serif;
  font-weight: 400;
	opacity: 0.75;
	@include transition(all, 0.1s);

	border: none;
	outline: none;
	
	margin-left: 1em;
	margin-top: 1em;	
}

input{
	width: 5em;
	height: 2em;
	background: #ecf0f1;
	color: #95a5a6;
	font-family: 'Roboto', sans-serif;
	border-radius: 0.25em;
	text-align: center;
	border: none;
	
	margin-top: 1em;
	margin-left: 1em;	
}

.selected{
	opacity: 1;
	@include transform(scale(1.2));
}

input:focus{
	width: calc(5em - 2px);
	height: calc(2em - 2px);
	background: white;
	border: 1px solid $c1;
}

button:hover{
	opacity: 1;
	@include transform(scale(1.2));
}



.palette{
	width: 6em;
	position: relative;
}

              
            
!

JS

              
                // DevPanel by Joe Templeton
// fork or follow this project at https://github.com/joetemp/DevPanel

$( document ).ready(function() {

	var x = false;
	var y = false;

	$('.control').click(function(){
		$('.control').removeClass('selected');
		$(this).addClass('selected');
	});

	$('.y').click(function(){
		x = false;
		y = true;
	});

	$('.x').click(function(){
		x = true;
		y = false;
	});

	$('.color').click(function(){
		$('.color').removeClass('selected');
		$(this).addClass('selected'); 
	});

	$('.c1').click(function(){
		if(x === true){
			$('body').append("<div class='guideX'><div class='line c1'></div></div>");
		}
		else{
			$('body').append("<div class='guideY'><div class='line c1'></div></div>");
		}

		$('.guideX').draggable({ axis:"y" });
		$('.guideY').draggable({ axis:"x" });
	});

	$('.c2').click(function(){
		if(x === true){
			$('body').append("<div class='guideX'><div class='line c2'></div></div>");
		}
		else{
			$('body').append("<div class='guideY'><div class='line c2'></div></div>");
		}
		$('.guideX').draggable({ axis:"y" });
		$('.guideY').draggable({ axis:"x" });
	});

	$('.c3').click(function(){
		if(x === true){
			$('body').append("<div class='guideX'><div class='line c3'></div></div>");
		}
		else{
			$('body').append("<div class='guideY'><div class='line c3'></div></div>");
		}
		$('.guideX').draggable({ axis:"y" });
		$('.guideY').draggable({ axis:"x" });
	});

	$('.c4').click(function(){
		if(x === true){
			$('body').append("<div class='guideX'><div class='line c4'></div></div>");
		}
		else{
			$('body').append("<div class='guideY'><div class='line c4'></div></div>");
		}
		$('.guideX').draggable({ axis:"y" });
		$('.guideY').draggable({ axis:"x" });
	});

	$('.c5').click(function(){
		if(x === true){
			$('body').append("<div class='guideX'><div class='line c5'></div></div>");
		}
		else{
			$('body').append("<div class='guideY'><div class='line c5'></div></div>");
		}
		$('.guideX').draggable({ axis:"y" });
		$('.guideY').draggable({ axis:"x" });
	});

	$('.c6').click(function(){
		if(x === true){
			$('body').append("<div class='guideX'><div class='line c6'></div></div>");
		}
		else{
			$('body').append("<div class='guideY'><div class='line c6'></div></div>");
		}
		$('.guideX').draggable({ axis:"y" });
		$('.guideY').draggable({ axis:"x" });
	});

});	
              
            
!
999px

Console