Transformers Cube with device orientation
How do I make an transformers cube with device orientation?
Transformers Cube with device orientation. What is a transformers cube with device orientation? How do you make a transformers cube with device orientation? This script and codes were developed by Shankar Cabus on 24 June 2022, Friday.
Transformers Cube with device orientation - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Transformers Cube with device orientation</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="experiment"> <div id="cube"> <div class="face one"></div> <div class="face two"></div> <div class="face three"></div> <div class="face four"></div> <div class="face five"></div> <div class="face six"></div> </div>
</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>
Transformers Cube with device orientation - Script Codes CSS Codes
#experiment { -webkit-perspective: 800; -webkit-perspective-origin: 50% 200px;
}
#cube { position: relative; margin: 100px auto; height: 200px; width: 200px; -webkit-transform-style: preserve-3d;
}
.face { position: absolute; height: 180px; width: 180px; padding: 10px; border: 1px solid #000; background-color: rgba(100, 100, 100, 0.7); background-image: url(http://d.pr/Q6oS); background-size: 300% 400%;
}
.face:hover { opacity: 0;
}
.face.one { -webkit-transform: rotateX(90deg) translateZ(100px); background-position: 75% 33%;
}
.face.two { -webkit-transform: translateZ(100px); background-position: 50% 33%;
}
.face.three { -webkit-transform: rotateY(90deg) translateZ(100px); background-position: 25% 67%;
}
.face.four { -webkit-transform: rotateY(180deg) translateZ(100px); background-position: 0 33%;
}
.face.five { -webkit-transform: rotateY(-90deg) translateZ(100px); background-position: 25% 0;
}
.face.six { -webkit-transform: rotateX(-90deg) translateZ(100px) rotate(180deg); background-position: 25% 33%;
}
Transformers Cube with device orientation - Script Codes JS Codes
window.addEventListener('deviceorientation', function(){ $('#cube').css('webkitTransform',"rotateX(" + (-event.beta*1.8) + "deg)"); $('#experiment').css('webkitTransform','rotate(' + (event.gamma*1.8) + 'deg)');
});
Developer | Shankar Cabus |
Username | shankarcabus |
Uploaded | June 24, 2022 |
Rating | 3 |
Size | 2,616 Kb |
Views | 70,840 |
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 pie chart | 2,335 Kb |
Front in Aracaju Logo Pure CSS | 2,581 Kb |
Flat Progress Bar CSS e HTML | 3,296 Kb |
Conical gradient in pure CSS | 3,548 Kb |
Super Mario CSS | 8,335 Kb |
Color Picker in Pure CSS | 5,072 Kb |
A Pen by Shankar Cabus | 2,336 Kb |
Vertical align | 1,952 Kb |
Compass pure CSS | 4,350 Kb |
Guest Post on CSS-Tricks | 6,425 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 |
Vue.js Lazy Loading | Kjbrum | 3,620 Kb |
Jstam.com Home Page | Jstam | 10,558 Kb |
Sign Up Form | Sicontis | 5,272 Kb |
Rain Landing in a Pond | Edball | 3,009 Kb |
Drill-down Map | Good886 | 8,484 Kb |
CSS3 Selectables with information rollover | Jasonmayes | 9,565 Kb |
3D-box | Parthviroja | 2,346 Kb |
Base64 SVG Me | MrBambule | 44,786 Kb |
SVG email test v2.0 | M_J_Robbins | 2,090 Kb |
Highbrow Basic HTML Lesson 7 | Kimlarocca | 1,662 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!