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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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 id="focus-container" class="container">
	<div class="left-side"></div>
	<div class="right-side"></div>
	<div class="hover">
		<div class="tri-1">
			<div class="bit-top"></div>
			<div class="bit-top-left"></div>
		</div>
		<div class="tri-2">
			<div class="bit-top-right"></div>
			<div class="bit-top-right-2"></div>
		</div>
		
		<div class="tri-3">
			<div class="bit-bottom-left"></div>
			<div class="bit-bottom-left-2"></div>
		</div>
		
		<div class="tri-4">
			<div class="bit-bottom-right"></div>
			<div class="bit-bottom-right-2"></div>
		</div>
		
	</div>
	<p class="blur">FOCUS</p>
	<p class="focus">FOCUS</p>
</div>





<div id="made-by-cameron">
	<code>
		<span class="made-by-twitter">🐦 Follow me on <a href="https://twitter.com/cameronjfitz" target="_BLANK">Twitter!</a></span>
		<span class="made-by-author">Made by <a href="https://cameronfitzwilliam.com" target="_BLANK">Cameron Fitzwilliam</a></span>
	</code>
</div>
            
          
!
            
              @import url('https://fonts.googleapis.com/css?family=Overpass');

.left-side {
    position: absolute;
    height: 100vh;
    width: 100vw;
    background: #000;
    overflow: hidden;
    z-index: 3;
}

.right-side {
    position: absolute;
    height: 100vh;
    width: 100vw;
    background: #000;
    z-index: 3;
    overflow: hidden;
}
.hover {
    position: absolute;
    float: left;
    height: 70px;
    width: 70px;
    cursor: none;
    overflow: hidden;
}

.bit-top {
	position: absolute;
	left: 0%;
	top: 0%;
	height: 5px;
	width: 10px;
	background: #fff;
}

.bit-top-left {
	position: absolute;
	left: 0%;
	top: 5px;
	height: 5px;
	width: 5px;
	background: #fff;
}


.bit-top-right {
	position: absolute;
	right: 0%;
	top: 0%;
	height: 5px;
	width: 10px;
	background: #fff;
}

.bit-top-right-2 {
	position: absolute;
	right: 0%;
	top: 0px;
	height: 10px;
	width: 5px;
	background: #fff;
}

.bit-bottom-left {
	position: absolute;
	bottom: 0%;
	left: 0px;
	height: 10px;
	width: 5px;
	background: #fff;	
}

.bit-bottom-left-2 {
	position: absolute;
	bottom: 0%;
	left: 0px;
	height: 5px;
	width: 10px;
	background: #fff;		
}

.bit-bottom-right {
	position: absolute;
	bottom: 0%;
	right: 0px;
	height: 5px;
	width: 10px;
	background: #fff;			
}
.bit-bottom-right-2 {
	position: absolute;
	bottom: 0%;
	right: 0px;
	height: 10px;
	width: 5px;
	background: #fff;			
}

.blur {
    position: absolute;
    color: #fefefe;
    font-family: 'Overpass', sans-serif;
    font-size: 64px;
    letter-spacing: 20px;
    margin: auto;
    width: 100%;
    filter: blur(5px);
    cursor: none;
    overflow: hidden;
    text-align: center;
    z-index: 3;
}

.focus {
    position: absolute;
    color: #fefefe;
    font-family: 'Overpass', sans-serif;
    font-size: 64px;
    letter-spacing: 20px;
    margin: auto;
    width: 100%;
    filter: blur(0px);
    cursor: none;
    overflow: hidden;
    text-align: center;
    z-index: 2;
}

.container {
	position: absolute;
	height: 80vh;
	padding-top: 20vh;
	width: 100%;
	overflow: hidden;
}


body {
	background: #000;
	margin: 0;
	padding: 0;
	cursor: none;
}



/* Made by */
body {
	margin: 0;
	padding: 0;
}
#made-by-cameron {
	position: fixed;
	bottom: 0%;
	height: 5vh;
	width: 100%;
	font-size: 1.2rem;
	z-index: 9;
	color: #f1f1f1;
}
#made-by-cameron a {
	color: #f1f1f1;
}
.made-by-author {
	position: absolute;
	right: 2%;
	top: 23%;
}
.made-by-twitter {
	position: absolute;
	left: 2%;
	top: 23%;
}
            
          
!
            
              (function(){
	var addEvent = function(object, type, callback) {
	    if (object == null || typeof(object) == 'undefined') return;
	    if (object.addEventListener) {
	        object.addEventListener(type, callback, false);
	    } else if (object.attachEvent) {
	        object.attachEvent("on" + type, callback);
	    } else {
	        object["on"+type] = callback;
	    }
	};
	function detectMouseMove() {
		// Initial container width
		var containerWidth = $('.container').outerWidth();
		document.addEventListener('mousemove', function(e) {
			$('.hover').css({
				 left:  e.pageX
			});
			$('.left-side').css({
				left: e.pageX + 75
			});
			var rightSideLeft = containerWidth - e.pageX;
			$('.right-side').css({
				right: rightSideLeft
			});

		})
	}
	detectMouseMove();
	function detectInput(inputType){
		// Detect container width after resizing
		addEvent(window, "resize", function(event) {
			var containerWidth = $('.container').outerWidth();
			$(document).bind(inputType, function(e){
				$('.hover').css({
					 left:  e.pageX
				});
				$('.left-side').css({
					left: e.pageX + 75
				});
				var rightSideLeft = containerWidth - e.pageX;
				$('.right-side').css({
					right: rightSideLeft
				});
			});
		});
	}
	
	detectInput('mousemove');
	detectInput('touchmove');
	
})();
            
          
!
999px
Loading ..................

Console