3D cube - hover rotate

Developer
Size
2,980 Kb
Views
52,624

How do I make an 3d cube - hover rotate?

CSS 3D transform. Cube rotates on hover to reveal content beneath.. What is a 3d cube - hover rotate? How do you make a 3d cube - hover rotate? This script and codes were developed by Andrew Canham on 23 August 2022, Tuesday.

3D cube - hover rotate Previews

3D cube - hover rotate - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>3D cube - hover rotate</title> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="centre">
<div class="gridItem"> <div class="itemContainer"> <div class="item"> <div class="front"> <h2>The title</h2> <img src="http://www.s4c.cymru/media/media_assets/dan-glo.jpg"> </div> <div class="bottom"> <p>This is some content.</p> </div> </div> </div>
</div>
<div class="gridItem"> <div class="itemContainer"> <div class="item"> <div class="front"> <h2>The title</h2> <img src="http://www.s4c.cymru/media/media_assets/tag-card.jpg"> </div> <div class="bottom"> <p>This is some content.</p> </div> </div> </div>
</div>
<div class="gridItem"> <div class="itemContainer"> <div class="item"> <div class="front"> <h2>The title</h2> <img src="http://www.s4c.cymru/media/media_assets/madron-card_14.49.50.jpg"> </div> <div class="bottom"> <p>This is some content.</p> </div> </div> </div>
</div>
<div class="gridItem"> <div class="itemContainer"> <div class="item"> <div class="front"> <h2>The title</h2> <img src="http://www.s4c.cymru/media/media_assets/hacio-card.jpg"> </div> <div class="bottom"> <p>This is some content.</p> </div> </div> </div>
</div>
</div>
</body>
</html>

3D cube - hover rotate - Script Codes CSS Codes

body { background: #87be46; text-align: center;
}
div.gridItem { background: #4a9b0e; border-radius: 12px; float: left; list-style: none; height: 320px; margin: 20px; padding: 20px; position: relative; width: 620px;
}
div.itemContainer { border-radius: 8px; height: 320px; -webkit-perspective: 1000px; perspective: 1000px; position: absolute; width: 620px;
}
div.item { cursor: pointer; height: 100%; position: absolute; -webkit-transform: translateZ(-160px); transform: translateZ(-160px); -webkit-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-transition: all .3s linear; transition: all .3s linear; width: 100%;
}
div.item div.front { -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 6px; box-shadow: 0 0 0 4px #3f870b; height: 100%; left: 0; position: absolute; -webkit-transition: all 1s linear; transition: all 1s linear; -webkit-transform: rotateX(0) translateZ(160px); transform: rotateX(0) translateZ(160px); top: 0; width: 100%; z-index: 20;
}
div.item div.front h2 { background: #3f870b; box-shadow: 0 0 0 4px #4a9b0e, 0 5px 0 0 #3f870b; color: #fff; font-family: helvetica, arial, sans-serif; font-size: 18px; border-radius: 4px; left: -24px; letter-spacing: 0.05em; padding: 12px 24px; position: absolute; text-transform: uppercase; bottom: 10%; z-index: 30;
}
div.item div.front img { border-radius: 6px; min-height: 100%; min-width: 100%;
}
div.item div.bottom { background: #38790a; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 6px; box-shadow: 0 0 0 4px #3f870b; height: 100%; margin: 0 0 0 0; position: absolute; top: 0; width: 100%; z-index: 10; -webkit-transform: rotateX(-90deg) translateZ(160px); transform: rotateX(-90deg) translateZ(160px);
}
div.item div.bottom p { color: #4a9b0e; font-family: arial; font-weight: bold; font-size: 24px; position: relative; text-align: center; top: 40%;
}
div.item:hover { -webkit-transform: translateZ(-160px) rotateX(90deg); transform: translateZ(-160px) rotateX(90deg);
}
3D cube - hover rotate - Script Codes
3D cube - hover rotate - Script Codes
Home Page Home
Developer Andrew Canham
Username candroo
Uploaded August 23, 2022
Rating 3
Size 2,980 Kb
Views 52,624
Do you need developer help for 3D cube - hover rotate?

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!

Andrew Canham (candroo) 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!