Giter Site home page Giter Site logo

1j01 / pixelweaver Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 1.0 605 KB

๐ŸŽจ๐ŸŽฒ Reproducible procedural drawing tool (pre-alpha)

CSS 3.57% JavaScript 71.37% HTML 25.06%
procedural-generation procedural drawing animation codoodle code-doodle doodle programming coding environment

pixelweaver's People

Contributors

1j01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sahwar

pixelweaver's Issues

Add images to README

A screenshot of the GUI, and some example programs, of which I have now a lot:

pixelweaver towards rules sorting by size

(Sorting by size to get a pseudo-random smattering, due to PNG compression, further down there are less complex images (in terms of data or entropy or whatever), especially with single-color backgrounds:)

pixelweaver towards rules sorting by size which measures data complexity or entropy or whatever

I also did some fun tree ones, like this guy, a sort of botanical zebra,
which you can download, import, reanimate and reseed:

export 15

Click off of material dialog to close

I want this to work personally and it's also part of the spec, but the library I'm using doesn't support it:
google/material-design-lite#5030

There's a workaround solution proposed here: google/material-design-lite#5030

document.querySelector('.dialog-show').addEventListener('click', function() {
  document.querySelector('dialog').showModal();
  document.querySelector('dialog').addEventListener('click', outsideDialog);
});


function outsideDialog(event) {
  var dialog = this;
  var rect = dialog.getBoundingClientRect();
  var isInDialog = (
    rect.top <= event.clientY && event.clientY <= rect.top + rect.height &&
    rect.left <= event.clientX && event.clientX <= rect.left + rect.width
  );
  if (!isInDialog) {
    dialog.close();
    dialog.removeEventListener('click', outsideDialog);
  }
}

Run user code in a worker

Use WebGLWorker to proxy WebGL code.

  • User code should be sandboxed. Ideally the WebGL graphics stuff would also run in the worker, but running their code in a worker should be enough to prevent tampering with the UI, e.g. stealing accounts if there were any, or overriding inspection features like View Source to hide a virus, and propagating it via Export.
  • The UI should be kept responsive. You should be able to cancel skipping ahead in time, crucially. Currently it's really easy to jump way ahead in time without realizing what you're doing (it looks like simple video controls), and then the page freezes up and you have to close-and-reopen or kill it.

It will likely still be very easy to cause a page crash. Or freezing, but it shouldn't freeze up for reasonable code not trying to be a nuisance.

Ultimately WebGL stuff is still gonna run on the GPU, and go thru video drivers and such, so there are potential exploits there. But if it can't access the network, hopefully it can't do too too much, i.e. can't report information back to a server, and anyways, we can leave that up to browser vendors (hopefully).

Export/import animations too

GIFs, APNGs, or maybe a video format

Could append a zip file to a GIF, or probably other formats as well

For instance I have this animation:
animation of silly tree growing behavior

But I have to save the PNG alongside it to be able to import the program:
PNG program (PNGram) of silly tree growth behavior

Also saving animations from the UI would be nice just to not have to use an external program.

WebGL context loss messages

I made it reinitialize the WebGL context everytime it resets the state, to make things much simpler.
But I apparently should clean up the WebGL context (explicitly) before discarding it.
(Or maybe go back to trying to reset everything without destroying the context.)

https://stackoverflow.com/questions/37072303/how-to-free-and-garbage-collect-a-webgl-context
https://stackoverflow.com/questions/23598471/how-do-i-clean-up-and-unload-a-webgl-canvas-context-from-gpu-after-use

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.