A pixel art painter geared specifically at NES pixel art. Includes export for .chr binary file as well as palette and namespace data.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

36 rindas
1000B

  1. const utils = {
  2. isElement:function(el){
  3. // Code based on...
  4. // https://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object
  5. try {
  6. // Using W3 DOM2 (works for FF, Opera and Chrome)
  7. return el instanceof HTMLElement;
  8. } catch(e) {
  9. // Browsers not supporting W3 DOM2 don't have HTMLElement and
  10. // an exception is thrown and we end up here. Testing some
  11. // properties that all elements have (works on IE7)
  12. return (typeof(el) === "object") &&
  13. (el.nodeType === 1) &&
  14. (typeof(el.style) === "object") &&
  15. (typeof(el.ownerDocument) === "object");
  16. }
  17. },
  18. debounce:function(func, delay){
  19. var timeout = null;
  20. return function(){
  21. var context = this;
  22. var args = arguments;
  23. clearTimeout(timeout);
  24. timeout = setTimeout(function(){
  25. func.apply(context, args);
  26. }, delay);
  27. };
  28. }
  29. };
  30. Object.freeze(utils);
  31. export default utils;