A Pen by Andrey Shchekin
How do I make an a pen by andrey shchekin?
What is a a pen by andrey shchekin? How do you make a a pen by andrey shchekin? This script and codes were developed by Andrey Shchekin on 15 November 2022, Tuesday.
A Pen by Andrey Shchekin - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>A Pen by Andrey Shchekin</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
A Pen by Andrey Shchekin - Script Codes CSS Codes
html, body { margin: 0; padding: 0; height: 100%; width: 100%;
}
canvas.main { position: absolute; opacity: 0.5; top: 0; left: 0;
}
canvas.trail { position: absolute; top: 0; left: 0; opacity: 0.5;
}
A Pen by Andrey Shchekin - Script Codes JS Codes
$(function() { var width = window.innerWidth; var height = window.innerHeight; var radius = 20; var spheres = [ { x: 0, y: 0, vx: 4, vy: 4, color: '#4684EE' }, { x: 30, y: 0, vx: 3, vy: 6, color: '#DC3912' }, { x: 60, y: 0, vx: 2, vy: 8, color: '#FF9900' }, { x: 90, y: 0, vx: 1, vy: 10, color: '#008000' } ]; var drawSphere = function(canvas, x, y, color) { var context = canvas.getContext('2d'); context.beginPath(); context.arc(x, y, radius, 0, 2 * Math.PI, false); context.fillStyle = color; context.fill(); }; spheres.forEach(function(sphere, index) { var trail = $('<canvas></canvas>').addClass('trail').appendTo($('.container'))[0]; trail.width = width; trail.height = height; /*var main = $('<canvas></canvas>').addClass('main') .appendTo($('.container'))[0]; main.width = radius * 2; main.height = radius * 2; drawSphere(main, radius, radius, sphere.color);*/ sphere.canvas = { /*main: main,*/ trail: trail }; }); var drawAndMove = function drawAndMove() { spheres.forEach(function(sphere) { if (sphere.stopped) return; /*sphere.canvas.main.style.webkitTransform = 'translateX(' + (sphere.x - radius) + 'px) translateY(' + (height - sphere.y - radius) + 'px)';*/ drawSphere(sphere.canvas.trail, sphere.x, height - sphere.y, sphere.color); sphere.vy -= 0.05; if (sphere.y + sphere.vy < 0) { sphere.vy = -(3/4*sphere.vy); return; } if (sphere.x + sphere.vx > width) { sphere.stopped = true; return; } sphere.x += sphere.vx; sphere.y += sphere.vy; }); window.requestAnimationFrame(drawAndMove); } drawAndMove();
});
Developer | Andrey Shchekin |
Username | ashmind |
Uploaded | November 15, 2022 |
Rating | 3 |
Size | 2,336 Kb |
Views | 12,144 |
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 |
Click to Shutdown | 2,487 Kb |
Wait what | 3,977 Kb |
Code Loader | 2,153 Kb |
Simple CORS test UI | 4,033 Kb |
Diamond-Square Terrain II | 2,928 Kb |
Text Effect 2.1 | 4,363 Kb |
Labyrinth 1 | 2,777 Kb |
TV Fall | 3,293 Kb |
Hexagons | 4,360 Kb |
CSS | 2,419 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 |
Matrix | Stathisnikolaidis | 1,922 Kb |
My Interests | Anshusaxenaarora | 2,015 Kb |
RequestAnimationFrame | Martin-banks | 2,541 Kb |
Header | Er40 | 1,542 Kb |
Preloader | Rikki_Sixx | 2,815 Kb |
Playing with transition timing | Mattgrosswork | 1,993 Kb |
RollOver Effect 2 | Lmack90 | 2,162 Kb |
Nice responsive team page | Infomiho | 3,139 Kb |
A Pen by Xand0r | Xand0r | 1,928 Kb |
Project -Show the Local Weather | Luciano_Britis | 2,583 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!