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

              
                <div class="grain"></div>
<div class="wrapper">
	<div class="titles"></div>
	<ul class="dots">
		<li class="dot" data-title="Random Numbers"><a href="" class="dot__a">
			<img src="http://image-aws-us-west-2.vsco.co/2c69ac/15114039/5aca1e3c8cf4d60a15023f16/vsco5aca1e4175b54.jpg">
			</a></li>
		<li class="dot" data-title="Life on Mars"><a href="" class="dot__a">
			<img src="http://image-aws-us-west-2.vsco.co/2c69ac/15114039/5ac7daa88091a276179053af/vsco5ac7dab25ba30.jpg">
			</a></li>
		<li class="dot" data-title="Something"><a href="" class="dot__a">
			<img src="http://image-aws-us-west-2.vsco.co/2c69ac/15114039/5ac7da368091a276179053ad/vsco5ac7da3ce00f1.jpg">
			</a></li>
		<li class="dot" data-title="Me, Myself and I"><a href="" class="dot__a">
			<img src="http://image-aws-us-west-2.vsco.co/2c69ac/15114039/5ac7da0b8091a276179053ab/vsco5ac7da1067b4d.jpg">
			</a></li>
		<li class="dot" data-title="Ultramagnetic MC"><a href="" class="dot__a">
			<img src="http://image-aws-us-west-2.vsco.co/2c69ac/15114039/5ac7d9a78091a276179053aa/vsco5ac7d9ad275bf.jpg">
			</a></li>
	</ul>
</div>
              
            
!

CSS

              
                .grain {
    position: fixed;
    pointer-events: none;
    -webkit-animation: grainAnimation 1s steps(4) infinite;
    animation: grainAnimation 1s steps(4) infinite;
    background-image: url(http://willmayer.com/wp-content/themes/will_mayer/assets/images/grain-888ad7615a.png);
    height: 180%;
    left: -40%;
    top: -40%;
    width: 180%;
		mix-blend-mode: screen;
    z-index: 1000;
}

@keyframes grainAnimation {
    0% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0)
    }
    10% {
        -webkit-transform: translate(-5%, -5%);
        transform: translate(-5%, -5%)
    }
    20% {
        -webkit-transform: translate(-10%, 5%);
        transform: translate(-10%, 5%)
    }
    30% {
        -webkit-transform: translate(5%, -10%);
        transform: translate(5%, -10%)
    }
    40% {
        -webkit-transform: translate(-5%, 15%);
        transform: translate(-5%, 15%)
    }
    50% {
        -webkit-transform: translate(-10%, 5%);
        transform: translate(-10%, 5%)
    }
    60% {
        -webkit-transform: translate(15%, 0);
        transform: translate(15%, 0)
    }
    70% {
        -webkit-transform: translate(0, 10%);
        transform: translate(0, 10%)
    }
    80% {
        -webkit-transform: translate(-15%, 0);
        transform: translate(-15%, 0)
    }
    90% {
        -webkit-transform: translate(10%, 5%);
        transform: translate(10%, 5%)
    }
    100% {
        -webkit-transform: translate(5%, 0);
        transform: translate(5%, 0)
    }
}

.wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100vh;
	background: radial-gradient(ellipse at center, #002a8e 0%,#000c54 100%);
	overflow: hidden;
	perspective: 400px;
}

.titles {
	position: absolute;
	width: 50vw;
	height: 300px;
	top: 50%;
	left: 50%;
	transform: translateX(-50%) translateY(-50%);
}

h2 {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translateX(-50%);
	font-size: 100px;
	text-align: center;
	margin: 0;
	color: white;
	opacity: 0;
	visibility: hidden;
}

.dots {
	width: 100%;
	display: flex;
	justify-content: space-evenly;
	list-style-type: none;
	margin: 0;
	padding: 0;
}

.dot {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	//background-color: red;
	width: 75px;
	height: 75px;
	margin: 0 20px 0 0;
	border-radius: 50%;
	z-index: 1;
	//animation: floating 100s linear infinite alternate;
}

.dot:hover {
	animation-play-state:paused;	
}

.dot:nth-child(2) {
	animation-delay: -20s;
} 
.dot:nth-child(3) {
	animation-delay: -10s;
} 
.dot:nth-child(4) {
	animation-delay: -30s;
} 
.dot:nth-child(5) {
	animation-delay: -5s;
}

.dot:last-child {
	margin: 0;
}

.dot:before,
.dot:after {
	content: "";
	display: block;
	width: 10px;
	height: 10px;
	position: absolute;
	top: calc(50% - 5px);
	left: calc(50% - 5px);
	border-radius: 50%;
	animation: rotation 5s infinite;
}

.dot:before {
	background-color: white;
	box-shadow: 0 0 70px 20px white;
	transform: scaleX(.3);
	animation: rotationBefore 50s infinite;
}

.dot:after {
	background-color: white;
  box-shadow: 0 0 70px 20px white;
	transform: scaleY(.3);
	animation: rotationAfter 30s infinite;
}

.dot:nth-child(2):before {
	animation-delay: -20s;
} 
.dot:nth-child(3):before {
	animation-delay: -10s;
} 
.dot:nth-child(4):before {
	animation-delay: -30s;
} 
.dot:nth-child(5):before {
	animation-delay: -5s;
}

.dot:nth-child(2):after {
	animation-delay: -20s;
} 
.dot:nth-child(3):after {
	animation-delay: -10s;
} 
.dot:nth-child(4):after {
	animation-delay: -30s;
} 
.dot:nth-child(5):after {
	animation-delay: -5s;
}

@keyframes rotationBefore {
    0% {
        transform: rotate(0) scaleX(.3) scaleY(1)
    }
	  50% {
        transform: rotate(180deg) scaleX(.1) scaleY(.5)
    }
    100% {
        transform: rotate(360deg) scaleX(.3) scaleY(1)
    }
}

@keyframes rotationAfter {
    0% {
        transform: rotate(0) scaleY(.3) scaleX(1)
    }
	  50% {
        transform: rotate(-180deg) scaleY(.1) scaleX(.5)
    }
    100% {
        transform: rotate(-360deg) scaleY(.3) scaleX(1)
    }
}

@keyframes floating {
    0% {
        transform: translateY(0vh)
    }
    50% {
        transform: translateY(20vh)
    }		
    100% {
        transform: translateY(-20vh)
    }	
}

.dot__a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: white;
	overflow: hidden;
	pointer-events: none;
	position: relative;
	z-index: 1;
}



.dot__a img {
	width: 300px;
	opacity: 0;
	visibility: hidden;
}
              
            
!

JS

              
                var $dots = $('.dots'),
		loaderRotate = new TimelineMax({repeat:-1});

loaderRotate .to($('.titles'), 5, {rotationX: 360, rotationY: 360, ease: Power0.easeNone});

$('.dot').each(function(e){
	var floatingThis = new TimelineMax({repeat:-1, yoyo: true, onUpdate: update});
	
	var timing = Math.floor(Math.random() * 10) + 8,
			posY = Math.floor(Math.random() * 90) + 0,
			posX = Math.floor(Math.random() * 100) + 0;
	
	function update(){
			timing = Math.floor(Math.random() * 10) + 1,
			posY = Math.floor(Math.random() * 90) + -90,
			posX = Math.floor(Math.random() * 6) + 1;
		
		// console.log(timing, posY, posX);
		// floatingThis	.to($(this), 1, {x: posX + 'vw', y: posY + 'vh'});
		// floatingThis.play();
	}
	
	console.log(timing, posY, posX);
	
	floatingThis	.to($(this), 10, {x: posX + 'vw', y: posY + 'vh', ease: Power0.easeNone});

});


$('.dot').on('mousemove', function(e){
	var $thisA = $(this).find('a'),
			$img = $(this).find('img'),
			thisW = $(this).width(),
			thisH = $(this).height(),
			offsetThis = $(this).offset(),
			x = (e.pageX - offsetThis.left) - thisW / 2,
			y = (e.pageY - offsetThis.top) - thisH / 2;
	
	TweenMax.set($(this), {zIndex : 2});
	TweenMax.to($thisA, 2, {y: y + 'px', x: x + 'px', rotation: x / 2, transformOrigin: 'center 60%', ease: Power4.easeOut});
	TweenMax.to($thisA, 1, {scale: 20, ease: Back.easeOut.config(3)});
	TweenMax.to($img, .25, {autoAlpha: 1, scale: .05, ease: Power4.easeOut});
	
	
});

$('.dot').on('mouseleave', function(){
	var $thisA = $(this).find('a'),
			$img = $(this).find('img');
	
	TweenMax.set($(this), {zIndex : 1});
	TweenMax.to($thisA, .75, {scale: 1, y: 0, x: 0, ease: Power4.easeOut}, 0.5);
	TweenMax.to($img, .5, {autoAlpha: 0, scale: 1, ease: Power4.easeOut});
	
	TweenMax.to($('.wrapper').find('h2'), 1, {display: 'none', autoAlpha: 0, y: '+=50px', ease: Power4.easeOut});
	TweenMax.to($('.dot'), .5, {autoAlpha: 1});
});

var $dot = $('.dot');

$dot.each(function(i){
	var index = i + 1,
			thisTitle = $(this).data('title'),
			htmlH2 = '<h2 data-index="'+ index +'">'+ thisTitle +'</h2>';
	
	$('.titles').append(htmlH2);
		
});

$('.dot').on('mouseenter', function(e){
	var thisIndex = $(this).index(),
			relatedTitle = $('.wrapper').find('h2').eq(thisIndex);
	
	//console.log(thisIndex, relatedTitle);
	TweenMax.staggerTo($('.dot').not(this), .5, {autoAlpha: .1}, .1);
	TweenMax.set(relatedTitle, {y: '-50%'});
	TweenMax.fromTo(relatedTitle, 1, {display: 'none', autoAlpha: 0, y: '-=50px'}, {display: 'block', autoAlpha: 1, y: '-50%', ease: Power4.easeOut});
});
              
            
!
999px

Console