Tesla

Developer
Size
2,356 Kb
Views
50,600

How do I make an tesla?

Electric.. What is a tesla? How do you make a tesla? This script and codes were developed by Tristan on 25 August 2022, Thursday.

Tesla Previews

Tesla - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Tesla</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Tesla - Script Codes CSS Codes

*{margin:0;padding:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}
body{font-size:75%;background:#222;font-family:arial;padding:20px 0 0 20px}
canvas{border:1px solid #181818;display:block;box-shadow:0 0 10px #111}

Tesla - Script Codes JS Codes

var canvas, c, w, h, twoPI = Math.PI * 2, mX, mY, resize = true, styles = [ { c: "rgba(0, 128,255,0.02)", w: 55 }, { c: "rgba(0, 128,255,0.05)", w: 25 }, { c: "rgba(0, 255,255,0.10)", w: 10 }, { c: "rgba(255,128,255,0.20)", w: 5 }, { c: "rgba(255,255,255,1.00)", w: 1 } ];
window.onload = function(){ canvas = document.createElement('canvas') w = canvas.width = window.innerWidth - 40; h = canvas.height = window.innerHeight - 40; c = canvas.getContext('2d'); document.body.appendChild(canvas); !resize || window.addEventListener('resize', function(e){ w = canvas.width = window.innerWidth - 40; h = canvas.height = window.innerHeight - 40; }); c.globalCompositeOperation = "lighter"; window.setInterval(animate, 1000/33);
}
function animate(){ c.save(); c.globalCompositeOperation = "source-over"; c.fillStyle = "rgba(0,0,0,0.3)"; c.fillRect(0,0,w,h); c.restore(); drawBolt(w/2,h-20);
}
function drawBolt(x,y){ c.beginPath(); var direction = twoPI*0.75; new Bolt(x, y, h/2, 20, direction, 0); c.closePath(); c.lineCap = "round"; for(var i = 0; i < styles.length; i++){ c.strokeStyle = styles[i].c; c.lineWidth = styles[i].w; c.stroke(); }
}
function Bolt(ox, oy, length, segments, direction, fork){ var x = ox, y = oy, x2, y2; for(var i = 0; i < segments; i++){ c.moveTo(x,y); x += Math.cos(direction) * (length/segments); y += Math.sin(direction) * (length/segments); c.lineTo(x,y); var branch = (Math.random() * 15) + fork; if(fork < 3 && branch > 12){ new Bolt(x, y, h/5, 5, direction, fork + 1); } direction += (Math.random() * (twoPI/16)) * Math.round(Math.random()*2-1); }
}
Tesla - Script Codes
Tesla - Script Codes
Home Page Home
Developer Tristan
Username sinthetyc
Uploaded August 25, 2022
Rating 3
Size 2,356 Kb
Views 50,600
Do you need developer help for Tesla?

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!

Tristan (sinthetyc) 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!