Coder Social home page Coder Social logo

abdulhasani / template-fxhash Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 219 KB

Fxhash merupakan platform untuk create dan collect seni Generative Art yang berbasis blockchain.

JavaScript 42.07% HTML 25.42% CSS 5.46% TypeScript 27.05%
fxhash generative-art p5js processing

template-fxhash's Introduction

template-fxhash

Template ini dibuat untuk membuat project generative art menggunakan p5js, bahasa pemrogaman basic dari p5js adalah javascript namun pada project ini pembuatan generative art bisa menggunakan typescript, untuk kemudahan distribusi ke fxhash digunakanlah webpack.
Fxhash merupakan platform untuk create dan collect seni Generative Art yang berbasis blockchain, untuk penjelasan penejelasan lebih detailnya anda bisa mengunjungi https://www.fxhash.xyz

Supaya template-fxhash berjalan pada local anda, pastikan sudah menginstall requirement berikut :

  • nvm
  • npm
  • nodejs

Setelah clone atau donwload repo ini, jangan lupa jalankan : npm install atau npm i

Pada file index.ts dalam directory src digunakan sebagai canvas utama untuk membuat seni generative art menggunakan p5js, pada project ini index.ts berisi code sederhana untuk menampilkan movement tulisan / typography dari atas ke tengah-tengah canvas.

import * as p5 from 'p5';
export const sketch = (p: p5) => {
    let xC = 0, xO = 0, xD = 0, xI = 0, xN = 0, xG = 0;
    let yC = 45, yO = 45, yD = 45, yI = 45, yN = 45, yG = 45;
    const wi = p.displayWidth / 2;
    const he = p.displayHeight;
    const maxPosition = (he / 2) + 100;
    let finG = "PROCESS";

    p.setup = () => {
        p.createCanvas(wi, he);
        xO = 135;
        xD = xO + 165;
        xI = xD + 169;
        xN = xI + 30;
        xG = xN + 125;
        p.textSize(250);

    }

    p.draw = () => {
        p.background(0);
        if (finG === "RESET") {
            p.textSize(250);
            finG = "PROCESS";
            yC = 45;
            yO = 45;
            yD = 45;
            yI = 45;
            yN = 45;
            yG = 45;
            delay(2000);
        }

        if (yC % 2 == 0) {
            p.textSize(100);
            delay(95);
        } else {
            p.textSize(250);
            delay(95);
        }


        p.fill(255);
        p.text("C", xC, yC);
        if (yC < maxPosition) yC += 15;

        p.text("O", xO, yO);
        if (yO < maxPosition) yO += 15;

        p.text("D", xD, yD);
        if (yD < maxPosition) yD += 15;

        p.text("i", xI, yI);
        if (yI < maxPosition) yI += 15;

        p.text("n",xN,yN);
        if(yN < maxPosition) yN += 15;

        p.text("g",xG,yG);
        if(yG < maxPosition){
            yG += 15
        }else{
            if(finG === "PROCESS") finG = "RESET";
        }

    }


    function delay(milliseconds: number) {
        var start = new Date().getTime();
        var stop = false;
        while (!stop) {
            if ((new Date().getTime() - start) > milliseconds) {
                stop = true;
            }
        }
    }

}
export const myp5 = new p5(sketch, document.body);

Jalankan project npm start

Build project npm run build

template-fxhash's People

Contributors

abdulhasani 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.