Text in a 3D Space

Developer
Size
2,627 Kb
Views
20,240

How do I make an text in a 3d space?

What is a text in a 3d space? How do you make a text in a 3d space? This script and codes were developed by Juwan Petty on 12 October 2022, Wednesday.

Text in a 3D Space Previews

Text in a 3D Space - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Text in a 3D Space</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="card"> <div class="card-content"> <h1>Just hover around</h1> </div> <div class="back"></div>
</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Text in a 3D Space - Script Codes CSS Codes

html, body { width: 100%; height: 100%; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center;
}
.card { pointer-events: none; -webkit-transform: translateZ(0px); transform: translateZ(0px); padding: 30px; width: 400px; height: 200px; margin: auto; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-perspective: 1000px; perspective: 1000px; -webkit-backface-visibility: hidden; backface-visibility: hidden; display: -webkit-box; display: -ms-flexbox; display: flex;
}
.card-content { position: relative; z-index: 3; margin: auto; text-align: center; -webkit-transform-style: preserve-3d; transform-style: preserve-3d;
}
.card-content h1 { -webkit-transform: translateZ(100px); transform: translateZ(100px); color: blue;
}
.back { position: absolute; z-index: 2; left: 30%; width: 200px; height: 200px; border-radius: 3px; background: orange;
}

Text in a 3D Space - Script Codes JS Codes

var cardContent = $(".card-content");
$(document).on("mousemove",function(e) { var ax = ($(window).innerWidth()/2 - e.pageX)/10; var ay = ($(window).innerHeight()/2 - e.pageY)/10; cardContent.attr("style", "transform: translateX("+ax+"%) translateY("+ay+"%);-webkit-transform: translateX("+ax+"%) translateY("+ay+"%);-moz-transform: translateX("+ax+"%) translateY("+ay+"%)");
});
var background = $(".back");
$(document).on("mousemove",function(e) { var ax = -($(window).innerWidth()/2 - e.pageX)/20; var ay = ($(window).innerHeight()/2 - e.pageY)/20; background.attr("style", "transform: rotateY("+ax+"deg) rotateX("+ay+"deg);-webkit-transform: rotateY("+ax+"deg) rotateX("+ay+"deg);-moz-transform: rotateY("+ax+"deg) rotateX("+ay+"deg)");
});
Text in a 3D Space - Script Codes
Text in a 3D Space - Script Codes
Home Page Home
Developer Juwan Petty
Username juwanpetty
Uploaded October 12, 2022
Rating 3
Size 2,627 Kb
Views 20,240
Do you need developer help for Text in a 3D Space?

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!

Juwan Petty (juwanpetty) Script Codes
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!