Adventure Interactive Time in 2.75D
How do I make an adventure interactive time in 2.75d?
Move your mouse around to change camera's perspective. Exported from After Effects with bodymovin. . What is a adventure interactive time in 2.75d? How do you make a adventure interactive time in 2.75d? This script and codes were developed by Kittons on 09 September 2022, Friday.
Adventure Interactive Time in 2.75D - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Adventure Interactive Time in 2.75D</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="bodymovin"></div> <script src='https://labs.nearpod.com/bodymovin/demo/adventure_time/bodymovin.min.js'></script>
<script src='https://labs.nearpod.com/bodymovin/demo/adventure_time/data.js'></script> <script src="js/index.js"></script>
</body>
</html>
Adventure Interactive Time in 2.75D - Script Codes CSS Codes
body,
html { background-color: #ddd; margin: 0px; height: 100%; overflow: hidden;
}
#bodymovin { background-color: #000; width: 100%; height: 100%; display: block; transform: translate3d(0, 0, 0); margin: auto;
}
Adventure Interactive Time in 2.75D - Script Codes JS Codes
var anim; var elem = document.getElementById('bodymovin') var animationParams = { container: elem, renderer: 'html', loop: true, autoplay: true, rendererSettings: { progressiveLoad:false }, animationData: animData }; anim = bodymovin.loadAnimation(animationParams); var lockeds = { 2: false, 3: false, 4: false, 5: false } var currentLayerNum = -1; var currentPos = [500.5, 400, -2666.667]; var mousePos = [500.5, 400, -2666.667]; function moveCamera(){ currentPos[0] = currentPos[0] + (mousePos[0] - currentPos[0])*0.25; currentPos[1] = currentPos[1] + (mousePos[1] - currentPos[1])*0.25; currentPos[2] = currentPos[2] + (mousePos[2] - currentPos[2])*0.25; anim.animationData.layers[0].ks.p.k[0].s[0] = currentPos[0]; anim.animationData.layers[0].ks.p.k[0].e[0] = currentPos[0]; anim.animationData.layers[0].ks.p.k[0].s[1] = currentPos[1]; anim.animationData.layers[0].ks.p.k[0].e[1] = currentPos[1]; anim.animationData.layers[0].ks.p.k[0].s[2] = currentPos[2]; anim.animationData.layers[0].ks.p.k[0].e[2] = currentPos[2]; requestAnimationFrame(moveCamera); } anim.addEventListener('DOMLoaded', function(){ moveCamera(); window.addEventListener('mousemove', function(ev){ mouseCoords.x = ev.clientX || ev.pageX; mouseCoords.y = ev.clientY || ev.pageY; theta = Math.atan2( windowH/2 - mouseCoords.y, windowW/2 - mouseCoords.x ); var layerNum = 0; if(theta <= Math.PI && theta > Math.PI/2){ layerNum = 2; } else if(theta <= Math.PI/2 && theta > 0){ layerNum = 3; } else if(theta <= 0 && theta > -Math.PI/2){ layerNum = 4; } else{ layerNum = 5; } if(!lockeds[layerNum] && anim.currentFrame > 50){ lockeds[layerNum] = true; //if(currentLayerNum !== layerNum){ currentLayerNum = layerNum; anim.animationData.layers[layerNum].ip = Math.ceil(anim.currentRawFrame); anim.animationData.layers[layerNum].st = Math.ceil(anim.currentRawFrame); //} setTimeout(function(){ lockeds[layerNum] = false; },6000); } dist = Math.sqrt(Math.pow(mouseCoords.x - windowW/2, 2) + Math.pow(mouseCoords.y - windowH/2, 2)); mousePos[0] = 500.5 + Math.cos(theta)*dist; mousePos[1] = 400 + Math.sin(theta)*dist; }) window.addEventListener('mousewheel', function(ev){ //-2666.667 mousePos[2] += ev.wheelDelta; ev.preventDefault(); ev.stopImmediatePropagation(); }) }) var windowW, windowH, dist; var mouseCoords = { x:0, y:0 } function calculateSize(){ windowW = window.innerWidth; windowH = window.innerHeight; } window.addEventListener('resize', function(){ calculateSize(); anim.resize(); }) calculateSize();
Developer | Kittons |
Username | airnan |
Uploaded | September 09, 2022 |
Rating | 4.5 |
Size | 2,716 Kb |
Views | 20,240 |
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!
Name | Size |
Animated form validation | 3,760 Kb |
Curved warp | 3,581 Kb |
Perricorn. a dog that was a unicorn | 1,893 Kb |
Tribute to white stripes | 4,748 Kb |
SVG Animated icons | 3,819 Kb |
Bug Industries - The Lady | 1,924 Kb |
Don dalek | 1,830 Kb |
Shapes | 1,817 Kb |
Bacon Pancakes | 2,266 Kb |
IK from After Effects to svg | 1,949 Kb |
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!
Name | Username | Size |
Factorial | KeithleySLHS | 1,158 Kb |
Heatmap Color Scales | Stevepepple | 2,331 Kb |
A Pen by Malith Hettiarachchi | MalZiiirA | 5,531 Kb |
NgEasyModal | Lorenzodianni | 4,159 Kb |
CSSOff 2013 Submission | Codewunder | 14,766 Kb |
Vertically rotating text with CSS | Nopr | 2,141 Kb |
Fun animations with CSS3 | Minimalmonkey | 2,360 Kb |
Hamburger Menu Animation | Salmanraza | 2,580 Kb |
Matrix | Stathisnikolaidis | 1,922 Kb |
CSS Piano | Dannystyle | 5,138 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!