25 lines
870 B
HTML
25 lines
870 B
HTML
<!DOCTYPE html>
|
|
<html lang="en" >
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>CodePen - Flowing Image - How To</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="./style.css">
|
|
|
|
</head>
|
|
<body>
|
|
<!-- partial:index.partial.html -->
|
|
<input type="range" min="1" max="6" step="1" id="step" value="1">
|
|
<section>
|
|
<p>Draw an image and divide it into a grid</p>
|
|
<p>Get the brightness of every cell</p>
|
|
<p>Draw particles moving from left to right</p>
|
|
<p>Update each particle's speed based on the brightness of its position</p>
|
|
<p>Fade each particle based on its speed</p>
|
|
<p>Do not clear your scene on each frame, to let the particles fade out</p>
|
|
</section>
|
|
<!-- partial -->
|
|
<script src='https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/p5.min.js'></script><script src="./script.js"></script>
|
|
|
|
</body>
|
|
</html>
|