Transformers Cube with device orientation

Developer
Size
2,616 Kb
Views
70,840

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 Previews

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)');
});
Transformers Cube with device orientation - Script Codes
Transformers Cube with device orientation - Script Codes
Home Page Home
Developer Shankar Cabus
Username shankarcabus
Uploaded June 24, 2022
Rating 3
Size 2,616 Kb
Views 70,840
Do you need developer help for Transformers Cube with device orientation?

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!

Shankar Cabus (shankarcabus) Script Codes
Create amazing Facebook ads 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!