Perspective Demo
How do I make an perspective demo?
This is used to embed in my blog http://agelber.com/blog/3d-transforms. What is a perspective demo? How do you make a perspective demo? This script and codes were developed by Assaf Gelber on 03 January 2023, Tuesday.
Perspective Demo - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Perspective 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: 600px;
}
#element { box-sizing: border-box; position: absolute; left: 250px; width: 100px; height: 100px; background: #387FF2; border: 3px solid #444; margin: 0 auto; transform: rotateY(60deg);
}
.slider, #css { position: relative;
}
.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>Perspective:</label> <input id='pslider' max='600' min='100' type='range' value='600'>
</div>
<div id='css'>perspective: 600px</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>
Perspective 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: 600px;
}
#element { box-sizing: border-box; position: absolute; left: 250px; width: 100px; height: 100px; background: #387FF2; border: 3px solid #444; margin: 0 auto; transform: rotateY(60deg);
}
.slider, #css { position: relative;
}
.slider input, #css input { vertical-align: middle;
}
Perspective Demo - Script Codes JS Codes
var el = document.body, css = document.getElementById('css'), p = 600;
document.getElementById('pslider').addEventListener('change', function() { p = this.value; update();
}, false);
function update() { var prop = p + 'px'; el.style[Modernizr.prefixed('perspective')] = prop; css.innerText = 'perspective: ' + prop;
}
Developer | Assaf Gelber |
Username | agelber |
Uploaded | January 03, 2023 |
Rating | 3 |
Size | 3,143 Kb |
Views | 6,072 |
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 |
Skew Demo | 3,209 Kb |
Rotate Demo | 3,061 Kb |
Origin Demo | 3,523 Kb |
Simple Night Sky | 3,266 Kb |
Interactive CSS 3D Transform | 3,690 Kb |
Transition Demo | 2,780 Kb |
Pure CSS Image Gallery | 3,911 Kb |
ScaleZ Demo | 3,184 Kb |
Blurring Menu | 2,934 Kb |
Translate Demo | 3,188 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 |
SlideupBoxes | Gavra | 23,772 Kb |
Gears | Synvox | 3,278 Kb |
Isometric css island | Xaddict | 2,950 Kb |
LAMP PURE CSS with Animation | Dam62500 | 2,911 Kb |
Under construction | GhostRider | 1,642 Kb |
JQuery exercise | Brian-baum | 3,780 Kb |
Elon Musk - Tribute Page - FreeCodeCamp | Yunnimun | 8,615 Kb |
CSS Google Now | Jackmoran | 3,196 Kb |
Birthday Party Starter | Aussieyang | 1,629 Kb |
Buttons for autumn | Nikazawila | 1,795 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!