RotateX and Y Demo
How do I make an rotatex and y demo?
This is used to embed in my blog http://agelber.com/blog/3d-transforms. What is a rotatex and y demo? How do you make a rotatex and y demo? This script and codes were developed by Assaf Gelber on 03 January 2023, Tuesday.
RotateX and Y Demo - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>RotateX and Y Demo</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <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! */ @import 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:300';
body { margin-top: 50px; overflow: hidden; font-family: Source Sans Pro; perspective: 400px;
}
#element { box-sizing: border-box; position: absolute; left: 300px; width: 100px; height: 100px; background: #387FF2; line-height: 90px; text-align: center; font-size: 100px; color: #444; border: 3px solid #444; margin: 0 auto;
}
.slider, #css { position: relative;
}
.slider label, #css label { display: inline-block; width: 12px;
}
.slider input, #css input { vertical-align: middle;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div id='element'>?</div>
<div class='slider'> <label>X:</label> <input id='xslider' max='180' min='-180' type='range'>
</div>
<div class='slider'> <label>Y:</label> <input id='yslider' max='180' min='-180' type='range'>
</div>
<div id='css'>transform: rotateX(0deg) rotateY(0deg)</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
RotateX and Y Demo - Script Codes CSS Codes
@import 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:300';
body { margin-top: 50px; overflow: hidden; font-family: Source Sans Pro; perspective: 400px;
}
#element { box-sizing: border-box; position: absolute; left: 300px; width: 100px; height: 100px; background: #387FF2; line-height: 90px; text-align: center; font-size: 100px; color: #444; border: 3px solid #444; margin: 0 auto;
}
.slider, #css { position: relative;
}
.slider label, #css label { display: inline-block; width: 12px;
}
.slider input, #css input { vertical-align: middle;
}
RotateX and Y Demo - Script Codes JS Codes
var el = document.getElementById('element'), css = document.getElementById('css'), x = 0, y = 0;
document.getElementById('xslider').addEventListener('change', function() { x = this.value; update();
}, false);
document.getElementById('yslider').addEventListener('change', function() { y = this.value; update()
}, false);
function update() { var prop = 'rotateX(' + x + 'deg) rotateY(' + y + 'deg)'; el.style[Modernizr.prefixed('transform')] = prop; css.innerText = 'transform: ' + prop;
}
Developer | Assaf Gelber |
Username | agelber |
Uploaded | January 03, 2023 |
Rating | 3 |
Size | 3,329 Kb |
Views | 8,096 |
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!
Name | Size |
Translate Demo | 3,188 Kb |
Carousel Tutorial Demo | 3,266 Kb |
Origin Demo | 3,523 Kb |
Animation Demo | 3,031 Kb |
Social Link Handle Animation | 3,241 Kb |
Scale Demo | 3,214 Kb |
Rotate Demo | 3,061 Kb |
Skew Demo | 3,209 Kb |
Interactive CSS 3D Transform | 3,690 Kb |
Text Looping Transition | 5,619 Kb |
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!
Name | Username | Size |
Off Canvas | Mariamarica | 1,870 Kb |
Simple Login Form | JoshBlackwood | 4,418 Kb |
A cube | KyleDavidE | 18,627 Kb |
Awesome Full Page Menu Nav | Ey_intuitive | 4,194 Kb |
Rows with image hover effect | Amit-webdesigner | 12,875 Kb |
Adding and Removing Element | Accimeesterlin | 2,119 Kb |
Segments mouse following | Nosir | 2,909 Kb |
Heartbeat | Apetrov | 2,079 Kb |
Sequence.js - Sliding Horizontal Parallax | Maheshc | 4,537 Kb |
Ionic - Wordpress REST API starter | Superpikar | 2,961 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!