Rift
How do I make an rift?
Inspired by this Pinterest pin . What is a rift? How do you make a rift? This script and codes were developed by Gabi on 22 August 2022, Monday.
Rift - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Rift</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <canvas id = 'c'></canvas> <script src="js/index.js"></script>
</body>
</html>
Rift - Script Codes CSS Codes
* { margin: 0; overflow: hidden; background-color: #000;
}
Rift - Script Codes JS Codes
var c = document.getElementById("c");
var ctx = c.getContext("2d");
var cw = c.width = window.innerWidth;
var ch = c.height = window.innerHeight;
var cx = cw / 2, cy = ch / 2;
var rad = Math.PI / 180;
var frames = 0;
var requestId = null;
ctx.lineWidth = 3;
ctx.strokeStyle = "white";
ctx.fillStyle = "rgba(0,0,0,1)";
var Amplitude = 50, amplitude;
var step = .5;
var W = 360 * step;
var I = 1 / step;
var offset;
function Draw() { frames += 3; ctx.clearRect(0, 0, cw, ch); for (var Y = -Amplitude; Y < ch + Amplitude; Y += 10) { offset = cx + 100 * Math.sin(Y * rad) - 100; amplitude = Amplitude * Math.sin((frames + Y) * rad); ctx.beginPath(); ctx.moveTo(0, Y + 3 * Amplitude); for (var x = 0; x < cw; x++) { if (x < offset || x > offset + (360 * step)) { y = Y; } else { y = amplitude * Math.cos(rad * (x - offset) * I) + Y - amplitude; } ctx.lineTo(x, y); } ctx.lineTo(cw, Y + 3 * Amplitude); ctx.closePath(); ctx.stroke(); ctx.fill(); } requestId = window.requestAnimationFrame(Draw);
}
function Init() { if (requestId) { window.cancelAnimationFrame(requestId); requestId = null; } cw = c.width = window.innerWidth; ch = c.height = window.innerHeight; cx = cw / 2, cy = ch / 2; frames = 0; Amplitude = 50, amplitude; step = .5; W = 360 * step; I = 1 / step; console.log(I) ctx.lineWidth = 3; ctx.strokeStyle = "white"; ctx.fillStyle = "rgba(0,0,0,1)"; requestId = window.requestAnimationFrame(Draw);
}
window.setTimeout(function() { Init(); window.addEventListener('resize', Init, false);
}, 15);
Developer | Gabi |
Username | enxaneta |
Uploaded | August 22, 2022 |
Rating | 4.5 |
Size | 2,213 Kb |
Views | 42,504 |
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 |
CSS Filters | 4,131 Kb |
Sakura | 3,605 Kb |
Sine wave ice cream | 2,127 Kb |
Conical Helix | 2,196 Kb |
Some flowers | 3,895 Kb |
Circular trail | 2,363 Kb |
GRID table of contents | 2,377 Kb |
Fat worm | 2,695 Kb |
Flexbox playground | 5,418 Kb |
Cube | 3,814 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 |
Algorithm practice | Abensur | 5,620 Kb |
Flat iOS 7 Safari Icon | Rss | 3,332 Kb |
Canvas Background Effect | Sonick | 3,513 Kb |
Wave Lines | Mikehobizal | 4,023 Kb |
Client-side Email Validation | Collizo4sky | 1,538 Kb |
Single element checkbox | Ivijaygupta | 1,996 Kb |
RSW | JordanC | 3,726 Kb |
Resume | Rottingroom | 5,483 Kb |
Haml Calendar | Katydecorah | 5,643 Kb |
Twitch TV | Natester13 | 4,488 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!