3D cube rotation

Developer
Size
2,653 Kb
Views
44,528

How do I make an 3d cube rotation?

What is a 3d cube rotation? How do you make a 3d cube rotation? This script and codes were developed by Ivan Sakoman on 12 June 2022, Sunday.

3D cube rotation Previews

3D cube rotation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>3D cube rotation</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="wrapper"> <div class="cube"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </div>
</div>
<button id="prvi">stisni me</button>
<button id="drugi">stisni me</button> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

3D cube rotation - Script Codes CSS Codes

body { margin: 100px;
}
* { transition: all 0.8s linear;
}
.wrapper { width: 200px; height: 200px; position: relative; perspective: 1000px;
}
.wrapper .cube { width: 100%; height: 100%; position: absolute; transform-style: preserve-3d; transform: translateZ(-100px);
}
.wrapper .cube.show-back { transform: rotate3d(1, 0, 0, 180deg);
}
.wrapper .cube.show-right { transform: rotate3d(0, 1, 1, 90deg);
}
.wrapper .cube .face { position: absolute; width: 196px; height: 196px; border: 2px solid black;
}
.wrapper .cube .face.front { transform: rotateX(0) translateZ(100px); background-color: rgba(0, 0, 0, 0.3); background-blend-mode: multiply;
}
.wrapper .cube .face.back { transform: rotateX(180deg) translateZ(100px); background-color: rgba(0, 0, 163, 0.3); background-blend-mode: multiply;
}
.wrapper .cube .face.right { transform: rotateY(90deg) translateZ(100px); background-color: rgba(135, 0, 0, 0.3); background-blend-mode: multiply;
}
.wrapper .cube .face.left { transform: rotateY(-90deg) translateZ(100px); background-color: rgba(0, 231, 0, 0.3); background-blend-mode: multiply;
}
.wrapper .cube .face.top { transform: rotateX(90deg) translateZ(100px); background-color: rgba(0, 0, 234, 0.3); background-blend-mode: multiply;
}
.wrapper .cube .face.bottom { transform: rotateX(-90deg) translateZ(100px); background-color: rgba(157, 56, 0, 0.3); background-blend-mode: multiply;
}
button { margin-top: 150px;
}

3D cube rotation - Script Codes JS Codes

$('#prvi').click(function(){ $('.cube').toggleClass('show-back');
});
$('#drugi').click(function(){ $('.cube').toggleClass('show-right');
});
3D cube rotation - Script Codes
3D cube rotation - Script Codes
Home Page Home
Developer Ivan Sakoman
Username ssaakkaa
Uploaded June 12, 2022
Rating 3
Size 2,653 Kb
Views 44,528
Do you need developer help for 3D cube rotation?

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!

Ivan Sakoman (ssaakkaa) Script Codes
Create amazing captions 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!