Device Orientation Demo02
How do I make an device orientation demo02?
What is a device orientation demo02? How do you make a device orientation demo02? This script and codes were developed by Ken Smith on 04 November 2022, Friday.
Device Orientation Demo02 - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Device Orientation Demo02</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Device Orientation - Demo02</h1>
<h2>Device Orientation with HTML5 | <a href="http://www.onlywebpro.com/2011/06/11/introduction-to-device-orientation-with-html5/">onlywebpro.com</a></h2>
<h3>Also see on <a href="http://kennethbsmith.com/bonus/pan/device-orientation02.html">kbs.com</a></h3> <img src="http://www.onlywebpro.com/wp-content/uploads/2011/10/test_img.png" id="imgLogo" class="logo"> <script src="js/index.js"></script>
</body>
</html>
Device Orientation Demo02 - Script Codes CSS Codes
h1 { font-family: verdana, sans-serif; font-weight: bold; font-size: 28px; } p { font-family: verdana, sans-serif; font-size: 12px; } #canvas { width: 200px; height: 200px; border: 5px solid #ddd; border-radius: 10px; -moz-border-radius: 10px; } #middle { background-color: #aaa; position: relative; width: 4px; height: 4px; left: 98px; top: 98px; } #ball { background-color: green; position: relative; width: 20px; height: 20px; left: 90px; top: 90px; border-radius: 20px; -moz-border-radius: 20px; box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.4); -moz-box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.4); -webkit-box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.4); background-image: -moz-linear-gradient(top, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 12px); background-image: -webkit-gradient(linear, 0 0, 0 12, from(rgba(255, 255, 255, .5)), to(rgba(255, 255, 255, 0))); } #warning { display: none; padding: 5px 10px; font-weight: bold;
Device Orientation Demo02 - Script Codes JS Codes
if (window.DeviceOrientationEvent) { console.log("DeviceOrientation is supported"); window.addEventListener('deviceorientation', function(eventData) { var LR = eventData.gamma; var FB = eventData.beta; var DIR = eventData.alpha; deviceOrientationHandler(LR, FB, DIR); }, false);
} else { alert("Not supported on your device or browser. Sorry.");
}
function deviceOrientationHandler(LR, FB, DIR) { //for webkit browser document.getElementById("imgLogo").style.webkitTransform = "rotate("+ LR +"deg) rotate3d(1,0,0, "+ (FB*-1)+"deg)"; //for HTML5 standard-compliance document.getElementById("imgLogo").style.transform = "rotate("+ LR +"deg) rotate3d(1,0,0, "+ (FB*-1)+"deg)";
}
Developer | Ken Smith |
Username | kensmith |
Uploaded | November 04, 2022 |
Rating | 3 |
Size | 2,343 Kb |
Views | 18,216 |
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 |
CSS min-content | 2,022 Kb |
Device Orientation Demo | 2,594 Kb |
CSS min-content 2 Height | 2,045 Kb |
Caption Hover Effect Three | 2,576 Kb |
Image hover text | 1,831 Kb |
HTML5 Audio Load IBM | 1,806 Kb |
Slide up captions from CSS-tricks | 1,948 Kb |
7 Caption Hover Effects | 3,459 Kb |
Adding a loader image to HTML5 video | 1,965 Kb |
HTML5 Audio Load | 1,498 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 |
DNA Double Helix | Hugo | 5,112 Kb |
Savemedia1.1 | EdsonAlcala | 2,148 Kb |
Out of the blue | Giaco | 2,537 Kb |
Swiftype Lower Third | Zumwalt | 4,796 Kb |
Freecodecamp - Tribute Page | Samoht513 | 3,583 Kb |
SCSS Unit Conversion | Jakob-e | 8,210 Kb |
Adding and Removing Element | Accimeesterlin | 2,119 Kb |
Fun form with currentColor | Bnthor | 2,713 Kb |
Image grid with captions | Mchernin34 | 2,222 Kb |
JavaScript constructors | Simboonlong | 2,415 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!