Boxes p2

Developer
Size
2,562 Kb
Views
4,048

How do I make an boxes p2?

Messing with 3d boxes. What is a boxes p2? How do you make a boxes p2? This script and codes were developed by James on 25 January 2023, Wednesday.

Boxes p2 Previews

Boxes p2 - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>boxes p2</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="info">
</div>
<section class="container"> <div class="case show-left-zero" onclick="toggleShelf(this)" onmouseover="inRange(this)" onmouseout="outRange(this)"> <figure class="front"><img src="https://h3local.com/movies/images/coverart/Batman-Begins-2005-front.png" height="401px" width="283px"></figure> <figure class="back"><img src="https://h3local.com/movies/images/coverart/Batman-Begins-2005-back.png" width="283px" height="401px"></figure> <figure class="right"></figure> <figure class="left"><img src="https://h3local.com/movies/images/coverart/Batman-Begins-2005-title.png" width="31px" height="401px"></figure> <figure class="top"></figure> <figure class="bottom"></figure> </div>
</section>
<section class="container"> <div class="case show-left-zero" onclick="toggleShelf(this)" onmouseover="inRange(this)" onmouseout="outRange(this)"> <figure class="front"><img src="https://h3local.com/movies/images/coverart/300-2007-front.png" height="401px" width="283px"></figure> <figure class="back"><img src="https://h3local.com/movies/images/coverart/300-2007-back.png" width="283px" height="401px"></figure> <figure class="right"></figure> <figure class="left"><img src="https://h3local.com/movies/images/coverart/300-2007-title.png" width="31px" height="401px"></figure> <figure class="top"></figure> <figure class="bottom"></figure> </div>
</section>
</section>
<section class="container"> <div class="case show-left-zero" onclick="toggleShelf(this)" onmouseover="inRange(this)" onmouseout="outRange(this)"> <figure class="front"><img src="https://h3local.com/movies/images/coverart/16-Blocks-2006-front.png" height="401px" width="283px"></figure> <figure class="back"><img src="https://h3local.com/movies/images/coverart/16-Blocks-2006-back.png" width="283px" height="401px"></figure> <figure class="right"></figure> <figure class="left"><img src="https://h3local.com/movies/images/coverart/16-Blocks-2006-title.png" width="31px" height="401px"></figure> <figure class="top"></figure> <figure class="bottom"></figure> </div>
</section> <script src="js/index.js"></script>
</body>
</html>

Boxes p2 - Script Codes CSS Codes

#info { margin: auto; padding: 10%; background-color: #222222; opacity: 0.5; display: none; position: fixed; vertical-align: middle; width: 80%; height: 80%;
}
.container { margin: 0; width: 283px; height: 401px; position: relative; float: left; perspective: 800px; border: 1px solid blue;
}
.case { margin: 0; padding: 0; width: 100%; height: 100%; disply: block; position: absolute; transition: transform 1500ms; transform-origin: center bottom; transform-style: preserve-3d;
}
figure { margin: 0; padding: 0; position: absolute; border: 1px solid black;
}
.case .front,
.case .back { width: 283px; height: 401px;
}
.case .right,
.case .left { width: 31px; height: 401px; left: 126px; background-color: black;
}
.case .top,
.case .bottom { width: 283px; height: 31px; top: 185px; background-color: black;
}
.front { transform: rotateY( 0deg ) translateZ( 16px ); }
.back { transform: rotateY( -180deg ) translateZ( 16px ); }
.right { transform: rotateY( 90deg ) translateZ( 142px ); }
.left { transform: rotateY( -90deg ) translateZ( 142px ); }
.top { transform: rotateX( 90deg ) translateZ( 200px ); }
.bottom { transform: rotateX( -90deg ) translateZ( 200px ); }
.case.show-front { transform: translateZ( -16px ) rotateY( 0deg ); }
.case.show-back { transform: translateZ( -16px ) rotateY( 180deg ); }
.case.show-left { transform: rotateY( 90deg );}
.case.show-left-zero { transform: translateZ( -142px ) rotateY( 90deg );}
.case.show-left-tilt { transform: translateZ( -142px ) rotateX( -25deg ) rotateY( 90deg );
}

Boxes p2 - Script Codes JS Codes

var caseState = 0;
function inRange(obj){ if (caseState == 0){ obj.className = "case show-left-tilt"; } else if (caseState == 1){ obj.className = "case show-back"; }
}
function outRange(obj){ if (caseState == 0){ obj.className = "case show-left-zero"; } else if (caseState == 1){ obj.className = "case show-front"; }
}
function toggleShelf(obj){ if (caseState == 0) { caseState = 2; obj.className = "case show-left"; setTimeout(function(){ obj.className = "case show-front";}, 1500 ); setTimeout(function(){ caseState = 1; document.getElementById("info").style.display = "block"; document.getElementById("info").style.zIndex = "1"; obj.parentNode.style.zIndex = "2"; obj.style.zIndex = "2";}, 3000 ); } else if (caseState == 1){ caseState = 2; obj.className = "case show-left"; setTimeout(function(){ obj.className = "case show-left-zero"}, 1500 ); setTimeout(function(){ caseState = 0; document.getElementById("info").style.display = "none"; document.getElementById("info").style.zIndex = "initial"; obj.parentNode.style.zIndex = "initial"; obj.style.zIndex = "initial";}, 3000 ); }
}
Boxes p2 - Script Codes
Boxes p2 - Script Codes
Home Page Home
Developer James
Username h3l1um
Uploaded January 25, 2023
Rating 3
Size 2,562 Kb
Views 4,048
Do you need developer help for Boxes p2?

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!

James (h3l1um) Script Codes
Name
Boxes
Create amazing web content 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!