Moirai
How do I make an moirai?
Custom Shaped 3D Object. Personally prefer the view on full screen. . What is a moirai? How do you make a moirai? This script and codes were developed by Tiffany Rayside on 27 July 2022, Wednesday.
Moirai - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>moirai </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> <canvas id="canv"></canvas>
<blockquote> There is a certain fate to the universe
<br>and a certain randomness.
<br><footer> - Harlan Coban
</footer></blockquote> <script src="js/index.js"></script>
</body>
</html>
Moirai - Script Codes CSS Codes
@import url(https://fonts.googleapis.com/css?family=Codystar);
body{ width:100%; margin:0; overflow:hidden; font-family: 'Codystar', cursive; font-size:1.3em; letter-spacing:3px;
}
blockquote{ position:absolute; color:hsla(259, 95%, 85%, .8); width: 100%; bottom:0%; text-align: center;
}
footer{ font-style:italic; font-size:.8em;
}
Moirai - Script Codes JS Codes
/*
Short && Basic, Custom Shaped 3D Particle Object.
*/
var c = document.getElementById('canv'), $ = c.getContext("2d"); c.width = window.innerWidth; c.height = window.innerHeight;
var arr = [], midX = c.width / 2, midY = c.height / 2, rotX = 0, rotY = 0, u = 0, vp = 350, d, currX, currY, x, y, z, g;
var pt = function(x, y, z) { var zpos = z * Math.cos(rotX) - x * Math.sin(rotX), xpos = z * Math.sin(rotX) + x * Math.cos(rotX), ypos = y * Math.cos(rotY) - zpos * Math.sin(rotY), zpos = y * Math.sin(rotY) + zpos * Math.cos(rotY); d = 1 / (zpos / vp + 1); currX = xpos * d + midX; currY = ypos * d + midY;
}
for (var i = -Math.PI; i < Math.PI; i += Math.PI / 20) { for (var j = -Math.PI; j < Math.PI; j += Math.PI / 20) { var px = Math.sin(i) % Math.abs(Math.sqrt(2) + Math.cos(j)), py = Math.sin(i * 2 * Math.PI / 3) / Math.abs(Math.sqrt(2) * Math.cos(j + 2 * Math.PI / 3)), pz = Math.cos(i * 2 * Math.PI / 3) / Math.abs(Math.sqrt(2) * Math.cos(j - 2 * Math.PI / 3)); arr.push(px * c.width * 0.18); arr.push(py * c.width * 0.18); arr.push(pz * c.width * 0.18); }
}
var rnd = function(min, max) { return Math.random() * (max - min) + min;
}
var draw = function() { var g_ = $.createLinearGradient(c.width + c.width, c.height + c.height * 1.5, c.width + c.width, 1); g_.addColorStop(0, 'hsla(253, 5%, 95%, 1)'); g_.addColorStop(0.5, 'hsla(314, 95%, 25%, 1)'); g_.addColorStop(0.8, 'hsla(259, 95%, 15%, 1)'); g_.addColorStop(1, 'hsla(0, 0%, 5%, 1)'); $.clearRect(0, 0, c.width, c.height); $.fillStyle = g_; $.fillRect(0, 0, c.width, c.height); var a = arr.length; rotX += 0.02; rotY += 0.02; u -= .2; for (var i = 0; i < a; i += 3) { pt(arr[i], arr[i + 1], arr[i + 2]); $.globalCompositeOperation = 'lighter'; $.fillStyle = 'hsla(' + u * i / 100 + ',85%,70%,.8)'; //performance boost w fillRect() instead of arc() $.fillRect(currX, currY, rnd(1, 5), rnd(1, 5)); $.fill(); }
}
//animate && resize
window.requestAnimFrame = (function() { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60); };
})();
var run = function() { window.requestAnimFrame(run); draw();
}
run();
window.addEventListener('resize', function() { c.width = window.innerWidth; c.height = window.innerHeight;
}, false);
Developer | Tiffany Rayside |
Username | tmrDevelops |
Uploaded | July 27, 2022 |
Rating | 4.5 |
Size | 2,855 Kb |
Views | 48,576 |
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 |
Gradiance 2 | 3,931 Kb |
The Underground | 2,696 Kb |
Deliquescent | 3,211 Kb |
3D Pyramid | 3,057 Kb |
Detour | 4,004 Kb |
Labyrinth | 3,387 Kb |
Shattered | 3,037 Kb |
Life Of Tree | 3,644 Kb |
Legions | 3,557 Kb |
Curvature | 2,809 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 |
Simple, flat contact form | Zeaklous | 2,719 Kb |
Greyscale image with filter in CSS3 | NickyCDK | 1,562 Kb |
Display properties | Hamzaerbay | 1,886 Kb |
Weird glowy CSS3 game | Toneworm | 3,684 Kb |
Drag in vanilla js using dotval math instead of translate | Paulq | 2,662 Kb |
Blog Concept - Single Post | Marionebl | 9,603 Kb |
Gradient-ui-button-mark-fx | Tabspace | 1,881 Kb |
Delete Hover | Chungman93 | 2,557 Kb |
Ripples in water | Nobitagit | 2,704 Kb |
Improved Page Flipping Effect | Usaphp | 5,201 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!