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

              
                <h2>Replace the Browser's default</h2>
<h1 id="perspective">
  <strong id="shadow">Context Menu</strong>
  <strong>Context Menu</strong>
</h1>

<ul id="menu" class="menu" hidden>
    <li class="item">
        <a href="javascript:window.history.go(-1)">
            <i class="fa-arrow-left	"></i>
            Back
          <span>bksp</span>
        </a>
    </li>
    <li class="item item--disabled">
        <a href="javascript:window.history.go(1)">
            <i class="fa-arrow-right"></i>
            Forward
            <span>shf + bksp</span>
        </a>
    </li>
    <li class="item">
        <a href="javascript:window.location.reload(true)">
            <i class="fa-refresh"></i>
            Reload
          <span>alt + <small>F5</small></span>
        </a>
    </li>
    <li class="divider"></li>
    <li class="item">
    <a>Profile</a>
      <i class="post fa-angle-right"></i>
    <ul class="menu sublet" hidden>
      <li class="item">
        <a href="#">
            <i class="fa-inbox"> </i>
            Inbox
        </a>
      </li>
      <li class="item">
        <a href="#">
          <i class="fa-user"> </i>
          View Profile
        </a>
      </li>
      <li class="item">
        <a href="#">
            <i class="fa-pencil"> </i>
            Edit Profile
        </a>
      </li>
      <li class="item">
        <a href="#">
            <i class="fa-cog"> </i>
            Preferences
        </a>
      </li>
    </ul>
  </li>
  <li class="divider"></li>
  <li class="item">
        <a href="#">
            <i class="fa-home"></i>
            Home
        </a>
    </li>
    <li class="item">
        <a href="#">
            <i class="fa-rss"></i>
            RSS
        </a>
    </li>
    <li class="item">
        <a href="#">
            <i class="fa-users"></i>
            Community
        </a>
    </li>
  <li class="divider"></li>
  <li class="item share">
      <a>Share</a>
      <i class="post fa-angle-right"></i>
  <ul class="menu sublet" hidden>
  <li class="item">
    <a class="link" href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fportableappz.x10.mx%2F&amp;src=sdkpreparse" target="_blank" title="Facebook">
      <i class="fa-facebook"> </i>
      Facebook
                </a>
  </li>
  <li class="item">
    <a class="link" href="https://twitter.com/share?text=PortableAppz.x10.mx%2F&amp;url=http%3A%2F%2Fportableappz.x10.mx%2F" target="_blank" title="Twitter">
      <i class="fa-twitter"> </i>
      Twitter
    </a>
  </li>
    <li class="item">
      <a class="link" href="https://plus.google.com/share?url=http%3A%2F%2Fportableappz.x10.mx%2F" target="_blank" title="Google+">
        <i class="fa-google-plus-square"></i>
        Google+
      </a>
    </li>
  </ul>
  </li>
  <li class="divider"></li>
  <li class="item">
    <a href="javascript:window.print()" title="Print">
      <i class="fa-print"></i> 
      Print
      <span>ctrl + p</span>
    </a>
  </li>
  <li class="item">
    <a href="" title="View Source">
      <i class="fa-code"></i> 
      View Source
      <span>ctrl + u</span>
    </a>
  </li>
</ul>

              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Oswald:700);

html, body { 
  margin:0; 
  overflow:hidden; 
  min-height:100%; 
}

html { 
  position:relative; 
  padding:20px 0 0; 
}

body { 
  position:absolute; 
  height:100%; 
  width:100%; 
  background:#607D8B; 
}

h1 {
  font: 600 3.8em/1 'Oswald', sans-serif;
  color: rgba(0,0,0,.5);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .3em;
  position: absolute;
  top: 25%;
  width: 100%;
  perspective: 100;
  -webkit-user-select: none;
	-moz-user-select: none;
  -ms-user-select: none;
	user-select: none;
  cursor: context-menu;
}

strong {
  display: block;
  position: absolute;
  width: 100%;
  line-height: 50px;
  color: hsl(201,3%,18%);
  -webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

strong:first-child { 
  transform:rotateX(-110deg);
  transform-origin:center bottom;
  color:transparent;
  user-select:none;
  text-shadow:
    0 0 1px hsla(201,3%,30%,.6),
    0 -7px 10px hsla(201,3%,30%,.3);
}

h2 {
    font: 600 1em/1 'Raleway', sans-serif;
    color: rgba(0,0,0,.5);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .5em;
    position: absolute;
    top: 25%;
    width: 100%;
  	-webkit-user-select: none;
	  -moz-user-select: none;
	  -ms-user-select: none;
	  user-select: none;
    cursor: context-menu;
}

.menu {
	  cursor: default;
	  -webkit-user-select: none;
	  -moz-user-select: none;
	  -ms-user-select: none;
	  user-select: none;
	  font-size: 14px;
    font-family: 'Lato', sans-serif;
    color: #263238;
    list-style: none;
    margin: 0;
    padding: 0.05em 0.25em;
    border: 1px solid transparent;
    border-right-color: #90A4AE;
    border-top-color: #90a4ae;
    border-bottom-color: #90A4AE;
    border-radius: 3px;
    position: absolute;
    min-width: 175px;
    z-index: 9999;
    background: -webkit-linear-gradient(305deg, #B0BEC5, #607D8B);
    background: linear-gradient(145deg, #B0BEC5, #607D8B);
    box-shadow: 0 5px 20px -5px #263238;
}
.menu[hidden] {
	  display: block;
  	visibility: hidden;
  	opacity: 0;
  	transition: visibility 0s 0.3s, opacity 0.3s;
}

.move {
	  animation: move 0.3s;
}
@keyframes move {
	0% { opacity: 0; }
}

.sublet {
    background: linear-gradient(145deg, #B0BEC5, #607D8B);
    width: auto;
    min-width: 10em;
    left: 100%;
    top: -0.4em;
    -webkit-transform: translateX(-0.7em);
    transform: translateX(-0.7em);
    -webkit-transition: opacity, width, min-width, visibility, -webkit-transform;
    transition: opacity, width, min-width, visibility, -webkit-transform;
    transition: transform, opacity, width, min-width, visibility;
    transition: transform, opacity, width, min-width, visibility, -webkit-transform;
    -webkit-transition-timing-function: ease;
    transition-timing-function: ease;
    -webkit-transition-duration: 0.3s, 0.25s, 0.15s, 0.15s, 0.01s;
    transition-duration: 0.3s, 0.25s, 0.15s, 0.15s, 0.01s;
    -webkit-transition-delay: 0.3s, 0.25s, 0.3s, 0.3s, 0.35s;
    transition-delay: 0.3s, 0.25s, 0.3s, 0.3s, 0.35s;
    overflow: hidden;
}

.sublet .item {
    padding-left: 2em;
}

.sublet i[class*="fa-"] {
    -webkit-transform: translateX(-2.25em);
    transform: translateX(-2.25em);
}

.sublet.oppositeX {
    right: 100%;
    left: auto;
    -webkit-transform: translateX(0.7em);
    transform: translateX(0.7em);
}

.sublet.oppositeY {
    top: auto;
    bottom: -0.4em;
}

.header, .item {
    padding-left: 2.5em;
    padding-right: 1.5em;
    padding-top: 0.3em;
    padding-bottom: 0.35em;
}

.header, .divider {
    margin-top: 0.25em;
    margin-bottom: 0.25em;
    border-bottom: 1px solid rgba(38,50,56,0.3);
}

.header {
    font-weight: 700;
    padding-bottom: 0.5em;
}

.item {
    border-radius: 3px;
    position: relative;
    border: 1px solid transparent;
}

.item:not(.item--disabled):hover {
    background-color: rgba(38,50,56,.9);
    color: #ECEFF1;
    border: 1px solid rgba(38,50,56,0.3);
}

.item:not(.item--disabled):hover .sublet {
    opacity: 1;
    -webkit-transform: translateX(0);
    transform: translateX(0);
    -webkit-transition-delay: 0.2s, 0.25s, 0.2s, 0.2s, 0s;
    transition-delay: 0.2s, 0.25s, 0.2s, 0.2s, 0s;
    border-radius: 0 3px 3px 3px;
    visibility: visible;
}

.item:last-child {
    margin-bottom: 0.25em;
}

.item:first-child {
    margin-top: 0.25em;
}

.item--disabled {
    color: rgba(38,50,56,0.3);
}

.item--active {
    -webkit-animation: flash 0.5s ease 1;
    animation: flash 0.5s ease 1;
}

.menu a {
    cursor: default;
    color: inherit;
    text-decoration: none;
    display: block;
}

a span {
  color: rgba(38,50,56,0.5);
  float: right;
  font-weight: normal;
  font-family: sans-serif;
  font-variant: small-caps;
  margin-right: -15PX;
  font-size: 11px;
  margin-top: 3px;
}

.item:not(.item--disabled):hover a span {
  color: #ECEFF1;
}

.item:not(.item--disabled):hover .sublet a span {
  color: #ECEFF1;
}

.menu [class*="fa-"] {
    font-style: normal;
    position: absolute;
    -webkit-transform: translateX(-2em);
    transform: translateX(-2em);
    width: 2em;
    text-align: right;
}

.menu [class*="fa-"].post {
    -webkit-transform: translateY(-55%);
    transform: translateY(-55%);
    right: 0;
    top: 50%;
}

.menu [class*="fa-"]:before {
    font-family: 'FontAwesome', sans-serif;
    margin-right: 0.5em;
}

@-webkit-keyframes flash {
  0% {
    background: rgba(255, 255, 255, 0);
  }

  20% {
    background: rgba(255, 255, 255, 0.4);
  }
}

@keyframes flash {
  0% {
    background: rgba(255, 255, 255, 0);
  }

  20% {
    background: rgba(255, 255, 255, 0.4);
  }
}

              
            
!

JS

              
                'use strict';

var html = document.documentElement;
var ctxMenu = document.querySelector('.menu:not(.sublet)');
var ctxMenuOpen = false;
var ctxItemSelected;

ctxMenu.addEventListener('animationend', function () {
	ctxMenu.classList.remove('move');
});

function ctxMenuOpen() {
	ctxMenuOpen = true;
	ctxMenu.hidden = false;
}

function ctxMenuClose() {
	ctxMenu.hidden = true;
	ctxMenuOpen = false;
}

document.addEventListener('contextmenu', function (e) {

	if (ctxMenuOpen)
		ctxMenu.classList.add('move');

	ctxMenuOpen = true;
	ctxMenu.hidden = false;

	var sijX = e.clientX;
	var sijY = e.clientY;

	if (sijX + ctxMenu.offsetWidth > html.clientWidth)
		sijX -= ctxMenu.offsetWidth;

	if (sijY + ctxMenu.offsetHeight > html.clientHeight)
		sijY -= ctxMenu.offsetHeight;

	ctxMenu.style.left = Math.max(sijX, 0) + 'px';
	ctxMenu.style.top = Math.max(sijY, 0) + 'px';

	e.preventDefault();
});

document.addEventListener("keyup", function (event) {
	if (event.defaultPrevented) {
		return;
	}

	if (ctxMenuOpen) {
		switch (event.code) {
		case "ContextMenu":
		case "Escape":
			ctxMenuClose();
			break;
		case "Home":
			window.location.assign("http://portableappz.x10.mx/");
			break;
		case "AltRight" && "F5":
		case "AltLeft" && "F5":
			window.location.reload(true);
			break;
		case "Backspace":
			window.history.go(-1);
			break;
		case "ShiftLeft" && "Backspace":
		case "ShiftRight" && "Backspace":
			window.history.go(1);
			break;
		case "ControlLeft" && "KeyU":
		case "ControlRight" && "KeyU":
			var z;
			var viewSourceLink = void(z = document.body.appendChild(document.createElement('script')));void(z.language = 'javascript');void(z.type = 'text/javascript');void(z.src = 'http://portableappz.x10.mx/Source.php?p=' + location.href);
			window.location.assign('javascript:' + viewSourceLink);
			break;
		}
	} else if (ctxMenuOpen == false) {
		switch (event.code) {
		case "ContextMenu":
			ctxMenuOpen();
			break;
		case "AltRight" && "F5":
		case "AltLeft" && "F5":
			window.location.reload(true);
			break;
		case "Backspace":
			window.history.go(-1);
			break;
		case "ShiftLeft" && "Backspace":
		case "ShiftRight" && "Backspace":
			window.history.go(1);
			break;
		case "ControlLeft" && "KeyU":
		case "ControlRight" && "KeyU":
			var z;
			var viewSourceLink = void(z = document.body.appendChild(document.createElement('script')));void(z.language = 'javascript');void(z.type = 'text/javascript');void(z.src = 'http://portableappz.x10.mx/Source.php?p=' + location.href);
			window.location.assign('javascript:' + viewSourceLink);
			break;
		}
	}
	event.preventDefault();
}, true);

document.addEventListener('click', ctxMenuClose);
window.addEventListener('blur', ctxMenuClose);
window.addEventListener('resize', ctxMenuClose);

function cancelScroll(e) {
	if (ctxMenuOpen)
		e.preventDefault();
}

document.addEventListener('scroll', cancelScroll);
window.addEventListener('wheel', cancelScroll, {passive:true});

ctxMenu.addEventListener('mousemove', function (e) {
	if (e.target.matches('li')) {
		e.target.classList.add('.item:not(.item--disabled):hover');
		ctxItemSelected = e.target;
	}
});

ctxMenu.addEventListener('mouseout', function (e) {
	if (ctxItemSelected) {
		ctxItemSelected.classList.remove('.item:not(.item--disabled):hover');
		ctxItemSelected = null;
	}
});

window.addEventListener('keydown', function (e) {
	if (ctxMenuOpen && (e.keyCode === 40 || e.keyCode === 38)) {
		var zzz = (e.keyCode === 40)
		 ? (ctxItemSelected && !e.altKey ? ctxItemSelected.nextElementSibling : ctxMenu.firstElementChild)
		 : (ctxItemSelected && !e.altKey ? ctxItemSelected.previousElementSibling : ctxMenu.lastElementChild);

		if (zzz) {
			if (ctxItemSelected)
				ctxItemSelected.classList.remove('.item:not(.item--disabled):hover');
			zzz.classList.add('.item:not(.item--disabled):hover');
			ctxItemSelected = zzz;
		}
	} else if (ctxItemSelected && (e.keyCode === 13 || e.keyCode === 32)) {
		ctxMenuClose();
	}
});

              
            
!
999px

Console