Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.






                // -----gemaakt door Jean-Francois Roebers 2018---------
var numberT = 700;
var tekens = new Array(numberT);
var mX=150;
var mY=100;

function setup() {
  createCanvas(240, 180);
  for (var i=0; i<numberT; ++i){
    tekens[i] = new Teken(width/2,height/2,random(height/2-0)+0,random(360));

function draw() {
  background(80, 100, 120);
  for (var i=0; i<numberT; ++i){
  if (frameCount % 30 == 0){
    mX = random(width);
    mY = random(height);

function Teken(cX,cY,r,a){
  this.cX = cX;
  this.cY = cY;
  this.r = r; // radius of circle 
  this.a = a; // angle of rotationPoint = rX and xY
  this.s = 3;
  var s = this.s/2;
  var speed = (height/2/this.r)/4//random(10)/10;// or (height/2/this.r)/4; // or (height/2 - this.r)
  var cG = random(255);
  var cB = random(255);
  var dX = 1;
  var dY = 1; = function(){
    this.a = this.a + speed;
    var rX = Math.cos((Math.PI / 180) * this.a)*this.r;
    var rY = Math.sin((Math.PI / 180) * this.a)*this.r;
    //rect(this.cX-s/2,this.cY-s/2,this.s,this.s); // show center
    // rotation:
    dX += (mX - dX)/(this.r);// mouseX werkt niet op mobile device
    dY += (mY - dY)/(this.r);
    rect(dX + rX, dY + rY, this.s,this.s);