Giter Club home page Giter Club logo

p5js-opepen's Introduction

p5.js Opepen Starter

Demo

p5opepen.netlify.app

Quick Overview

This p5.js project will create an Opepen using the Opepen framework's grid. Each cell is a random color.

Run index.html to test.

You are free to use and modify this for whatever you want.

Canvas Size

When this project loads and when the window is resized, it will read the width and height and resize to the largest square possible. Although the canvas is square, there's a line in the code that extends the background color to whatever size the screen is. To see the true square, comment out line 70 (document.body.style.backgroundColor = backgroundColor;).

The p5.js canvas itself is set to 1970 x 1970. The dimensions of the Opepen are based on this, so don't change it. The canvas will resize based on the logic above anyway. Also, I wish I chose a better number than 1970, but that's how I made it.

Simulated token hash

This code uses a random hash to generate the random colors. In practice, you'll use a platform's unique token hash, but to test specific hashes, you can append them as a url parameter, like this: index.html?hash=0xbead17f78577f01ec6d5638e96d7e0343fdafeb893fdd3123ffacf900adb386b. You can find the hash for any output as a console log.

Save png

Press s to save a png file.

p5js-opepen's People

Contributors

drewbrolik avatar

Stargazers

su007 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.