Code Monkey home page Code Monkey logo

eba-template's Introduction

ethblockart blockstyle advanced template

optimized for DX:

  • you do not need to use react*
  • bring your own library
  • live reloading
  • block number + parameters persist across reloads**
  • controls for changing dimensions
  • you have access to blocks from api so you can test any block without testing on ethblock.art
  • blocks from api are optimistically loaded so you can quickly browse without waiting for api requests
  • attributes update immediately (official template currently doesn't)
  • light/dark theme based on system settings :)

*Blockstyles are required to be React components, but this template is designed so you can avoid dealing with React. Just keep everything contained in CustomRenderer

**Did you come across a block or parameter value that keeps crashing everything? Enter sessionStorage.clear() to manually reset persisted state!

getting started

  • npm i
  • npm start
  • edit src/CustomRenderer.js
  • check the preset blocks in public to see what block data is available for your style

If you want to use React for your style, you will instead edit src/CustomStyle.js and update webpack.config.js.

building

  • npm run build
  • this will output the component bundle main.js

top bar block selection

  • <: previous block
  • >: next block
  • >>: latest block
  • R: random block
  • G: go to block...

Choose api to select blocks from api (see above). The rest of the options (b0-b7) are local presets stored in public.

You can add more local presets by getting the block json from ethblock.art (inspect network requests to see api calls), adding the file to public, and updating localBlocks in src/index.js. Or just directly edit the json to create special test cases.

ethblockart caveats

  • square aspect ratio is default on eba but fullscreen/embed views may not be square, this is why there are controls for testing different aspect ratio
  • not sure of the behavior of animate

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.