Processing.js Playground

Size
2,392 Kb
Views
28,336

How do I make an processing.js playground?

Testing…. What is a processing.js playground? How do you make a processing.js playground? This script and codes were developed by Christian Fleschhut on 11 August 2022, Thursday.

Processing.js Playground Previews

Processing.js Playground - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Processing.js Playground</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <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='c1'></canvas> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.1/processing-api.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Processing.js Playground - Script Codes CSS Codes

@import "bourbon";

Processing.js Playground - Script Codes JS Codes

function sketchProc(p) { p.setup = function() { p.size(200, 200); p.stroke(255); }; // Override draw function, by default it will be called 60 times per second p.draw = function() { // determine center and max clock arm length var centerX = p.width / 2, centerY = p.height / 2; var maxArmLength = Math.min(centerX, centerY); function drawArm(position, lengthScale, weight) { p.strokeWeight(weight); p.line(centerX, centerY, centerX + Math.sin(position * 2 * Math.PI) * lengthScale * maxArmLength, centerY - Math.cos(position * 2 * Math.PI) * lengthScale * maxArmLength); } // erase background p.background(51); var now = new Date(); // Moving hours arm by small increments var hoursPosition = (now.getHours() % 12 + now.getMinutes() / 60) / 12; drawArm(hoursPosition, 0.5, 3); // Moving minutes arm by small increments var minutesPosition = (now.getMinutes() + now.getSeconds() / 60) / 60; drawArm(minutesPosition, 0.8, 2); // Moving hour arm by second increments var secondsPosition = now.getSeconds() / 60; drawArm(secondsPosition, 0.9, 1); };
}
var canvas = document.getElementById("c1");
var processingInstance = new Processing(canvas, sketchProc);
Processing.js Playground - Script Codes
Processing.js Playground - Script Codes
Home Page Home
Developer Christian Fleschhut
Username cfleschhut
Uploaded August 11, 2022
Rating 3
Size 2,392 Kb
Views 28,336
Do you need developer help for Processing.js Playground?

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!

Christian Fleschhut (cfleschhut) Script Codes
Create amazing art & images 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!