Skip to content

STRd6/pixel-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ebc8852 Β· Sep 10, 2018
Mar 1, 2016
Dec 8, 2017
Oct 26, 2017
Apr 8, 2017
Aug 9, 2015
Sep 28, 2013
Feb 27, 2016
Mar 10, 2016
Dec 9, 2017
Mar 3, 2016
Aug 17, 2015
Mar 5, 2017
Mar 5, 2017
Feb 22, 2016
Dec 8, 2017
Aug 9, 2015
Aug 10, 2015
Feb 22, 2016
Dec 8, 2017
Dec 8, 2017
Feb 21, 2016
Sep 10, 2018
Mar 4, 2016
Aug 12, 2015
Dec 8, 2017
Dec 31, 2015
Dec 8, 2017
Dec 8, 2017
Sep 10, 2018

Repository files navigation

Pixel Editor

It edits pixels

Live Demo

Embedding Instructions

The editor will send a postMessage to its parent window when "Save" is clicked.

One thing to note is that this is pointing to the latest version of https://danielx.net/pixel-editor/ so it might break out from under you. You'd probably want to host a stable version of the editor on your own service after you get it working if you care about that kind of thing.

    <html>
    <body>
    </body>
    <iframe src="https://danielx.net/pixel-editor/" width="100%" height="100%"></iframe>
    <script>
    window.addEventListener("message", receiveMessage, false);
    function receiveMessage(event) {
      var origin = event.origin;

      if (origin !== "https://danielx.net") {
        return;
      }

      var data = event.data;
      if (data.method === "save") {
        var image = data.image; // HTML5 Blob object
        var width = data.width;
        var height = data.height;

        // Post to your server, etc
        console.log(data);
      }
    }
    <\/script>
    </html>

Developer Instructions

Fork on Github https://github.com/STRd6/pixel-editor/fork

Go to http://danielx.net/editor

Load your fork by clicking "Load Repo" and typing in "/pixel-editor"

When it loads click "Run" to make sure it works

Click "New Feature" to start working on a feature branch

Modify the code and click "Run" to see your changes.

Click "Save" to push the code to your feature branch

Review your branch on Github to make a pull request.

Hopefully that works, but if not open an issue at https://github.com/STRd6/editor/issues/ and let me know what's not working.