Use your mousewheel

Developer
Size
4,109 Kb
Views
14,168

How do I make an use your mousewheel?

A new take on mousewheel interaction. Pretty jerky in Firefox ... sorry Foxies.Icons by http://icomoon.io/. What is a use your mousewheel? How do you make a use your mousewheel? This script and codes were developed by Timo Hausmann on 16 October 2022, Sunday.

Use your mousewheel Previews

Use your mousewheel - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>use your mousewheel</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ @font-face {	font-family: 'icomoon';	src:url('https://trashnet.de/tech/nw_cloud_5/assets/font/icomoon.eot');	src:url('https://trashnet.de/tech/nw_cloud_5/assets/font/icomoon.eot?#iefix') format('embedded-opentype'),	url('https://trashnet.de/tech/nw_cloud_5/assets/font/icomoon.woff') format('woff'),	url('https://trashnet.de/tech/nw_cloud_5/assets/font/icomoon.ttf') format('truetype'),	url('https://trashnet.de/tech/nw_cloud_5/assets/font/icomoon.svg#icomoon') format('svg');	font-weight: normal;	font-style: normal;
}
* {	margin: 0;	padding: 0;
}
html,
body {	height: 100%;
}
body {	background: rgba(0,0,0,0.1);	overflow: hidden;
}
.cloud {	position: absolute;	left: 50%;	top: 200px;	margin-left: -120px;	width: 240px;	perspective: 500px;
}
.wrap {	position: absolute;	width: 240px;	height: 240px;	transition: 2s ease-out;	transform-style: preserve-3d;
}
.wrap:nth-child(1) {	left: -280px;	top: -140px;
}
.wrap:nth-child(2) {	left: -280px;	top: 140px;
}
.wrap:nth-child(3) {	left: 280px;	top: -140px;
}
.wrap:nth-child(4) {	left: 280px;	top: 140px;
}
.article {	cursor: pointer;	position: absolute;	width: 240px;	height: 240px;	background: rgba(255,255,255,1);	box-shadow: 0 0 80px rgba(0,0,0,0.15);	font-family: 'icomoon';	text-align: center;	line-height: 240px;	font-size: 96px;	color: #222;	text-shadow: 0 0 20px rgba(0,0,0,0.5);	border-radius: 2px;	transition: 0.4s;	transform-origin: 50% 50%;	opacity: 0;
}
.article.active {	opacity: 1;	z-index: 100;
}
.article:hover {	transform: scale(1.1);
}
.article.prev {	transform: scale(1) rotateX(-80deg) translateZ(0px);
}
.article.next {	transform: scale(1) rotateX(80deg) translateZ(0px);
}
.mouse {	font-family: 'icomoon';	text-align: center;	line-height: 240px;	font-size: 256px;	color: #ccc;	position: absolute;	width: 240px;	height: 240px;	left: 50%;	margin-left: -120px;	top: 200px;	text-align: center;
}
.mouse span {	position: absolute;	color: #666;	left: 0;	bottom: -50px;	width: 100%;	font-family: Consolas, sans-serif;	font-size: 20px;	line-height: 20px;
}
.mouse .wheel {	opacity: 0.2;	left: 119px;	top: 54px;	width: 10px;	height: 35px;	position: absolute;	background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAG0lEQVQIW2NkwAIYgWL/0cUZ/wMBhiAu7RjiAEJxBQFuig8vAAAAAElFTkSuQmCC);	animation: wheel 0.5s linear infinite alternate;
}
@keyframes wheel {	from {	background-position: 0 0;	}	to {	background-position: 0 3px;	}
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="cloud">	<div class="wrap">	<div class="article active">&#xe003;</div>	<div class="article">&#xe014;</div>	<div class="article">&#xe006;</div>	<div class="article">&#xe000;</div>	<div class="article">&#xe00e;</div>	</div>	<div class="wrap">	<div class="article active">&#xe00f;</div>	<div class="article">&#xe00c;</div>	<div class="article">&#xe002;</div>	<div class="article">&#xe008;</div>	<div class="article">&#xe009;</div>	</div>	<div class="wrap">	<div class="article active">&#xe00a;</div>	<div class="article">&#xe001;</div>	<div class="article">&#xe007;</div>	<div class="article">&#xe00d;</div>	<div class="article">&#xe005;</div>	</div>	<div class="wrap">	<div class="article active">&#xe013;</div>	<div class="article">&#xe00b;</div>	<div class="article">&#xe015;</div>	<div class="article">&#xe004;</div>	<div class="article">&#xe010;</div>	</div>	</div>	<div class="mouse">&#xe000;<span>use your mousewheel</span><span class="wheel"></span></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://trashnet.de/js/jquery.mousewheel.js'></script> <script src="js/index.js"></script>
</body>
</html>

Use your mousewheel - Script Codes CSS Codes

@font-face {	font-family: 'icomoon';	src:url('https://trashnet.de/tech/nw_cloud_5/assets/font/icomoon.eot');	src:url('https://trashnet.de/tech/nw_cloud_5/assets/font/icomoon.eot?#iefix') format('embedded-opentype'),	url('https://trashnet.de/tech/nw_cloud_5/assets/font/icomoon.woff') format('woff'),	url('https://trashnet.de/tech/nw_cloud_5/assets/font/icomoon.ttf') format('truetype'),	url('https://trashnet.de/tech/nw_cloud_5/assets/font/icomoon.svg#icomoon') format('svg');	font-weight: normal;	font-style: normal;
}
* {	margin: 0;	padding: 0;
}
html,
body {	height: 100%;
}
body {	background: rgba(0,0,0,0.1);	overflow: hidden;
}
.cloud {	position: absolute;	left: 50%;	top: 200px;	margin-left: -120px;	width: 240px;	perspective: 500px;
}
.wrap {	position: absolute;	width: 240px;	height: 240px;	transition: 2s ease-out;	transform-style: preserve-3d;
}
.wrap:nth-child(1) {	left: -280px;	top: -140px;
}
.wrap:nth-child(2) {	left: -280px;	top: 140px;
}
.wrap:nth-child(3) {	left: 280px;	top: -140px;
}
.wrap:nth-child(4) {	left: 280px;	top: 140px;
}
.article {	cursor: pointer;	position: absolute;	width: 240px;	height: 240px;	background: rgba(255,255,255,1);	box-shadow: 0 0 80px rgba(0,0,0,0.15);	font-family: 'icomoon';	text-align: center;	line-height: 240px;	font-size: 96px;	color: #222;	text-shadow: 0 0 20px rgba(0,0,0,0.5);	border-radius: 2px;	transition: 0.4s;	transform-origin: 50% 50%;	opacity: 0;
}
.article.active {	opacity: 1;	z-index: 100;
}
.article:hover {	transform: scale(1.1);
}
.article.prev {	transform: scale(1) rotateX(-80deg) translateZ(0px);
}
.article.next {	transform: scale(1) rotateX(80deg) translateZ(0px);
}
.mouse {	font-family: 'icomoon';	text-align: center;	line-height: 240px;	font-size: 256px;	color: #ccc;	position: absolute;	width: 240px;	height: 240px;	left: 50%;	margin-left: -120px;	top: 200px;	text-align: center;
}
.mouse span {	position: absolute;	color: #666;	left: 0;	bottom: -50px;	width: 100%;	font-family: Consolas, sans-serif;	font-size: 20px;	line-height: 20px;
}
.mouse .wheel {	opacity: 0.2;	left: 119px;	top: 54px;	width: 10px;	height: 35px;	position: absolute;	background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAG0lEQVQIW2NkwAIYgWL/0cUZ/wMBhiAu7RjiAEJxBQFuig8vAAAAAElFTkSuQmCC);	animation: wheel 0.5s linear infinite alternate;
}
@keyframes wheel {	from {	background-position: 0 0;	}	to {	background-position: 0 3px;	}
}

Use your mousewheel - Script Codes JS Codes

 var	lastUpdate = new Date(),	deg = (360/$('.article').length);
$('.wrap').each(function(i) {	var $wrap = $(this),	$active = $wrap.find('.active').first(),	$prev = $active.prev(),	$next = $active.next();	if( !$prev.length ) $prev = $wrap.find('.article').last();	if( !$next.length ) $next = $wrap.find('.article').first();	$prev.addClass('prev');	$next.addClass('next');
});
$('.article').each(function(i) {	$(this).css('background', 'hsla(' + (i*deg) + ',60%,60%,1)');
});
$('body').on('mousewheel', function(event, delta, deltaX, deltaY) {	event.preventDefault();	var thisUpdate = new Date();	if( thisUpdate - lastUpdate < 500 ) return;	lastUpdate = thisUpdate;	$('.wrap').each(function() {	var $wrap = $(this),	$active = $wrap.find('.active'),	$prev = $wrap.find('.prev'),	$next = $wrap.find('.next'),	$tmp;	//go back	if( deltaY === 1) {	$active	.removeClass('active')	.addClass('next')	.siblings()	.removeClass('next');	$tmp = $prev	.removeClass('prev')	.addClass('active')	.prev();	if( !$tmp.length ) $tmp = $wrap.find('.article').last();	$tmp	.removeClass('next')	.addClass('prev')	.siblings()	.removeClass('prev');	} else {	$active	.removeClass('active')	.addClass('prev')	.siblings()	.removeClass('prev');	$tmp = $next	.removeClass('next')	.addClass('active')	.next();	if( !$tmp.length ) $tmp = $wrap.find('.article').first();	$tmp	.removeClass('prev')	.addClass('next')	.siblings()	.removeClass('next');	}	});
});
Use your mousewheel - Script Codes
Use your mousewheel - Script Codes
Home Page Home
Developer Timo Hausmann
Username timohausmann
Uploaded October 16, 2022
Rating 4.5
Size 4,109 Kb
Views 14,168
Do you need developer help for Use your mousewheel?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Timo Hausmann (timohausmann) Script Codes
Create amazing art & images with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!