New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

infinite-turtles

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

infinite-turtles - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

27

dist/turtle.js

@@ -19,2 +19,4 @@ (function() {

return Turtle = (function() {
var blendMode;
function Turtle(canvas) {

@@ -27,3 +29,3 @@ this.canvas = canvas;

this.ctx = this.canvas.getContext('2d');
this.ctx.globalCompositeOperation = "screen";
this.ctx.globalCompositeOperation = "source-over";
this.drawer = new TurtleDrawer(this.canvas);

@@ -33,2 +35,6 @@ this.commands = [];

Turtle.prototype.setBlendMode = function(val) {
return this.ctx.globalCompositeOperation = val;
};
Turtle.prototype.background = function(val) {

@@ -208,2 +214,21 @@ var h, w;

blendMode = {
'NORMAL': 'normal',
'MULTIPLY': 'multiply',
'SCREEN': 'screen',
'OVERLAY': 'overlay',
'DARKEN': 'darken',
'LIGHTEN': 'lighten',
'COLOR-DODGE': 'color-dodge',
'COLOR-BURN': 'color-burn',
'HARD-LIGHT': 'hard-light',
'SOFT-LIGHT': 'soft-light',
'DIFFERENCE': 'difference',
'EXCLUSION': 'exclusion',
'HUE': 'hue',
'SATURATION': 'saturation',
'COLOR': 'color',
'LUMINOSITY': 'luminosity'
};
return Turtle;

@@ -210,0 +235,0 @@

2

dist/turtle.min.js

@@ -1,1 +0,1 @@

(function(){var t,r=function(t,r){return function(){return t.apply(r,arguments)}},i=function(t,r){function i(){this.constructor=t}for(var n in r)o.call(r,n)&&(t[n]=r[n]);return i.prototype=r.prototype,t.prototype=new i,t.__super__=r.prototype,t},o={}.hasOwnProperty,n=[].slice;t=function(t){return"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define([],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.Color=t())},t(function(){var t;return t=t=function(){function t(t,r,i,o){this.r=t,this.g=r,this.b=i,this.opacity=null!=o?o:1}return t.prototype.toString=function(){return"rgba("+this.r+","+this.g+","+this.b+","+this.opacity+")"},t.prototype.setHue=function(t){var r;return t>360&&(t%=360),r=this.toHSL(),r.H=t,this.fromHSL(r.H,r.S,r.L)},t.prototype.getHue=function(){return this.toHSL().H},t.prototype.toHSL=function(){var t,r,i,o,n,e,s,h,u,a,f,p;return p=this.r/255,u=this.g/255,o=this.b/255,a=Math.max(p,u,o),f=Math.min(p,u,o),n=a-f,r=(a+f)/2,0===n?(t=0,i=0):(i=.5>r?n/(a+f):n/(2-a-f),h=((a-p)/6+n/2)/n,s=((a-u)/6+n/2)/n,e=((a-o)/6+n/2)/n,p===a?t=e-s:u===a?t=1/3+h-e:o===a&&(t=2/3+s-h)),0>t&&(t+=1),t>1&&(t-=1),{H:360*t,S:100*i,L:100*r}},t.prototype.fromHSL=function(t,r,i){var o,n,e;return o=function(t,r,i){return 0>i&&(i+=1),i>1&&(i-=1),1>6*i?t+6*(r-t)*i:1>2*i?r:2>3*i?t+(r-t)*(2/3-i)*6:t},t/=360,r/=100,i/=100,0===r?(this.r=255*i,this.g=255*i,this.b=255*i):(e=.5>i?i*(1+r):i+r-r*i,n=2*i-e,this.r=255*o(n,e,t+1/3),this.g=255*o(n,e,t),this.b=255*o(n,e,t-1/3)),[this.r,this.g,this.b]},t}()}),t=function(t){return"object"==typeof exports?module.exports=t(require("../color")):"function"==typeof define&&define.amd?define(["color"],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.TurtleDrawer=t(this.TURTLE.Color))},t(function(t){var i;return i=function(){function i(t){this.canvas=t,this.lineWidth=r(this.lineWidth,this),this.forward=r(this.forward,this),this.ctx=this.canvas.getContext("2d")}return i.prototype.angle=0,i.prototype.x=800,i.prototype.y=200,i.prototype._color=new t(0,0,0,1),i.prototype._lineWidth=1,i.prototype.finish=function(){},i.prototype.forward=function(t,r){return this.ctx.beginPath(),this.ctx.moveTo(this.x,this.y),this.ctx.lineWidth=this._lineWidth,this.ctx.strokeStyle=this._color.toString(),this.x+=(t+r)*Math.cos(this.angle*(Math.PI/180)),this.y+=(t+r)*Math.sin(this.angle*(Math.PI/180)),this.ctx.lineTo(this.x,this.y),this.ctx.stroke(),this},i.prototype.color=function(t){return this._color=t,this},i.prototype.moveX=function(t,r){return null==r&&(r=0),this.x+=t+r,this},i.prototype.moveY=function(t,r){return null==r&&(r=0),this.y+=t+r,this},i.prototype.setX=function(t,r){return null==r&&(r=0),this.x=t+r,this},i.prototype.setY=function(t,r){return null==r&&(r=0),this.y=t+r,this},i.prototype.lineWidth=function(t,r){return null==r&&(r=0),this._lineWidth=t+r,this},i.prototype.turn=function(t,r){return this.angle+=t-1+r,this},i}()}),t=function(t){return"object"==typeof exports?module.exports=t(require("./drawers/turtle-drawer")):"function"==typeof define&&define.amd?define(["turtle-drawer"],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.Turtle=t(this.TURTLE.TurtleDrawer))},t(function(t){var i;return i=function(){function i(i){this.canvas=i,this.keepDrawing=r(this.keepDrawing,this),this.doDraw=r(this.doDraw,this),this.draw=r(this.draw,this),this.job=r(this.job,this),this.ctx=this.canvas.getContext("2d"),this.ctx.globalCompositeOperation="screen",this.drawer=new t(this.canvas),this.commands=[]}return i.prototype.background=function(t){var r,i;return i=this.canvas.width,r=this.canvas.height,this.ctx.fillStyle=t,this.ctx.fillRect(0,0,i,r)},i.prototype.job=function(t){var r,i;return i=this,new(r=function(){function t(t){this.fn=t}return t.prototype.before=function(){},t.prototype.run=function(){return this.beforeEach.apply(i),this.fn.apply(i)},t}())(t)},i.prototype.forward=function(t,r){return null==r&&(r=0),this.commands.push({fn:this.drawer.forward,args:t,mod:r}),this},i.prototype.turn=function(t,r){return null==r&&(r=0),this.commands.push({fn:this.drawer.turn,args:t,mod:r}),this},i.prototype.color=function(t,r){return this.commands.push({fn:this.drawer.color,args:t,mod:r}),this},i.prototype.lineWidth=function(t,r){return this.commands.push({fn:this.drawer.lineWidth,args:t,mod:r}),this},i.prototype.moveX=function(t,r){return this.commands.push({fn:this.drawer.moveX,args:t,mod:r}),this},i.prototype.moveY=function(t,r){return this.commands.push({fn:this.drawer.moveY,args:t,mod:r}),this},i.prototype.setX=function(t,r){return this.commands.push({fn:this.drawer.setX,args:t,mod:r}),this},i.prototype.setY=function(t,r){return this.commands.push({fn:this.drawer.setY,args:t,mod:r}),this},i.prototype.draw=function(t){return this.n=0,this.drawing=!0,t?this.doDraw(t):this.keepDrawing()},i.prototype.stop=function(){return this.drawing=!1,this.drawer.finish()},i.prototype.doDraw=function(t){var r,i,o,n,e,s,h,u;for(i=o=1,h=t;h>=1?h>=o:o>=h;i=h>=1?++o:--o)for(u=this.commands,n=0,e=u.length;e>n;n++)r=u[n],"number"==typeof r.mod?(s=r.mod?r.mod*i:1,r.fn.apply(this.drawer,[r.args,s])):"function"==typeof r.mod?r.fn.apply(this.drawer,[r.args,r.mod(i)]):r.fn.apply(this.drawer,[r.args]);return this.stop()},i.prototype.keepDrawing=function(){var t,r,i,o,n,e,s;if(this.drawing){for(r=i=0;10>=i;r=++i)for(this.n=this.n+1,s=this.commands,o=0,n=s.length;n>o;o++)t=s[o],"number"==typeof t.mod?(e=t.mod?t.mod*this.n:1,t.fn.apply(this.drawer,[t.args,e])):"function"==typeof t.mod?t.fn.apply(this.drawer,[t.args,t.mod(this.n)]):t.fn.apply(this.drawer,[t.args]);return window.requestAnimationFrame(function(t){return function(){return t.keepDrawing()}}(this)),this}},i.prototype.finish=function(){return this.drawer.finish(),this},i}()}),(t=function(t){return"object"==typeof exports?module.exports=t(require("../color","turtle-drawer")):"function"==typeof define&&define.amd?define(["color","turtle-drawer"],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.OffsetColorDrawer=t(this.TURTLE.Color,this.TURTLE.TurtleDrawer))})(function(t,r){var o;return o=function(o){function e(i){var o,e,s,h,u;for(this.offsetX=30,this.offsetY=30,this.drawers=[],e=s=0;2>=s;e=s+=1)this.drawers[e]=new r(i);u=new r(i);for(h in u)o=u[h],"function"==typeof o&&!function(t){return function(r){return t[r]=function(){var t,i,o,e,s,h;for(t=1<=arguments.length?n.call(arguments,0):[],s=this.drawers,h=[],o=0,e=s.length;e>o;o++)i=s[o],h.push(function(i){return i[r].apply(i,t)}(i));return h}}}(this)(h,o);this.color=function(r){return this._color=r,this.drawers[0].color(new t(this._color.r,0,0,this._color.opacity/3)),this.drawers[1].color(new t(0,this._color.g,0,this._color.opacity/3)),this.drawers[2].color(new t(0,0,this._color.b,this._color.opacity/3)),this},this.setX=function(t,r){return null==r&&(r=0),this.drawers[0].setX(t,r),this.drawers[1].setX(t+this.offsetX,r),this.drawers[2].setX(t+2*this.offsetX,r),this},this.moveX=function(t,r){return null==r&&(r=0),this.drawers[0].moveX(t,r),this.drawers[1].moveX(t+this.offsetX,r),this.drawers[2].moveX(t+2*this.offsetX,r),this},this.setY=function(t,r){return null==r&&(r=0),this.drawers[0].setY(t,r),this.drawers[1].setY(t+this.offsetY,r),this.drawers[2].setY(t+2*this.offsetY,r),this},this.moveY=function(t,r){return null==r&&(r=0),this.drawers[0].moveY(t,r),this.drawers[1].moveY(t+this.offsetY,r),this.drawers[2].moveY(t+2*this.offsetY,r),this}}return i(e,o),e}(r)})}).call(this);
(function(){var t,r=function(t,r){return function(){return t.apply(r,arguments)}},o=function(t,r){function o(){this.constructor=t}for(var n in r)i.call(r,n)&&(t[n]=r[n]);return o.prototype=r.prototype,t.prototype=new o,t.__super__=r.prototype,t},i={}.hasOwnProperty,n=[].slice;t=function(t){return"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define([],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.Color=t())},t(function(){var t;return t=t=function(){function t(t,r,o,i){this.r=t,this.g=r,this.b=o,this.opacity=null!=i?i:1}return t.prototype.toString=function(){return"rgba("+this.r+","+this.g+","+this.b+","+this.opacity+")"},t.prototype.setHue=function(t){var r;return t>360&&(t%=360),r=this.toHSL(),r.H=t,this.fromHSL(r.H,r.S,r.L)},t.prototype.getHue=function(){return this.toHSL().H},t.prototype.toHSL=function(){var t,r,o,i,n,e,s,h,u,a,f,c;return c=this.r/255,u=this.g/255,i=this.b/255,a=Math.max(c,u,i),f=Math.min(c,u,i),n=a-f,r=(a+f)/2,0===n?(t=0,o=0):(o=.5>r?n/(a+f):n/(2-a-f),h=((a-c)/6+n/2)/n,s=((a-u)/6+n/2)/n,e=((a-i)/6+n/2)/n,c===a?t=e-s:u===a?t=1/3+h-e:i===a&&(t=2/3+s-h)),0>t&&(t+=1),t>1&&(t-=1),{H:360*t,S:100*o,L:100*r}},t.prototype.fromHSL=function(t,r,o){var i,n,e;return i=function(t,r,o){return 0>o&&(o+=1),o>1&&(o-=1),1>6*o?t+6*(r-t)*o:1>2*o?r:2>3*o?t+(r-t)*(2/3-o)*6:t},t/=360,r/=100,o/=100,0===r?(this.r=255*o,this.g=255*o,this.b=255*o):(e=.5>o?o*(1+r):o+r-r*o,n=2*o-e,this.r=255*i(n,e,t+1/3),this.g=255*i(n,e,t),this.b=255*i(n,e,t-1/3)),[this.r,this.g,this.b]},t}()}),t=function(t){return"object"==typeof exports?module.exports=t(require("../color")):"function"==typeof define&&define.amd?define(["color"],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.TurtleDrawer=t(this.TURTLE.Color))},t(function(t){var o;return o=function(){function o(t){this.canvas=t,this.lineWidth=r(this.lineWidth,this),this.forward=r(this.forward,this),this.ctx=this.canvas.getContext("2d")}return o.prototype.angle=0,o.prototype.x=800,o.prototype.y=200,o.prototype._color=new t(0,0,0,1),o.prototype._lineWidth=1,o.prototype.finish=function(){},o.prototype.forward=function(t,r){return this.ctx.beginPath(),this.ctx.moveTo(this.x,this.y),this.ctx.lineWidth=this._lineWidth,this.ctx.strokeStyle=this._color.toString(),this.x+=(t+r)*Math.cos(this.angle*(Math.PI/180)),this.y+=(t+r)*Math.sin(this.angle*(Math.PI/180)),this.ctx.lineTo(this.x,this.y),this.ctx.stroke(),this},o.prototype.color=function(t){return this._color=t,this},o.prototype.moveX=function(t,r){return null==r&&(r=0),this.x+=t+r,this},o.prototype.moveY=function(t,r){return null==r&&(r=0),this.y+=t+r,this},o.prototype.setX=function(t,r){return null==r&&(r=0),this.x=t+r,this},o.prototype.setY=function(t,r){return null==r&&(r=0),this.y=t+r,this},o.prototype.lineWidth=function(t,r){return null==r&&(r=0),this._lineWidth=t+r,this},o.prototype.turn=function(t,r){return this.angle+=t-1+r,this},o}()}),t=function(t){return"object"==typeof exports?module.exports=t(require("./drawers/turtle-drawer")):"function"==typeof define&&define.amd?define(["turtle-drawer"],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.Turtle=t(this.TURTLE.TurtleDrawer))},t(function(t){var o;return o=function(){function o(o){this.canvas=o,this.keepDrawing=r(this.keepDrawing,this),this.doDraw=r(this.doDraw,this),this.draw=r(this.draw,this),this.job=r(this.job,this),this.ctx=this.canvas.getContext("2d"),this.ctx.globalCompositeOperation="source-over",this.drawer=new t(this.canvas),this.commands=[]}var i;return o.prototype.setBlendMode=function(t){return this.ctx.globalCompositeOperation=t},o.prototype.background=function(t){var r,o;return o=this.canvas.width,r=this.canvas.height,this.ctx.fillStyle=t,this.ctx.fillRect(0,0,o,r)},o.prototype.job=function(t){var r,o;return o=this,new(r=function(){function t(t){this.fn=t}return t.prototype.before=function(){},t.prototype.run=function(){return this.beforeEach.apply(o),this.fn.apply(o)},t}())(t)},o.prototype.forward=function(t,r){return null==r&&(r=0),this.commands.push({fn:this.drawer.forward,args:t,mod:r}),this},o.prototype.turn=function(t,r){return null==r&&(r=0),this.commands.push({fn:this.drawer.turn,args:t,mod:r}),this},o.prototype.color=function(t,r){return this.commands.push({fn:this.drawer.color,args:t,mod:r}),this},o.prototype.lineWidth=function(t,r){return this.commands.push({fn:this.drawer.lineWidth,args:t,mod:r}),this},o.prototype.moveX=function(t,r){return this.commands.push({fn:this.drawer.moveX,args:t,mod:r}),this},o.prototype.moveY=function(t,r){return this.commands.push({fn:this.drawer.moveY,args:t,mod:r}),this},o.prototype.setX=function(t,r){return this.commands.push({fn:this.drawer.setX,args:t,mod:r}),this},o.prototype.setY=function(t,r){return this.commands.push({fn:this.drawer.setY,args:t,mod:r}),this},o.prototype.draw=function(t){return this.n=0,this.drawing=!0,t?this.doDraw(t):this.keepDrawing()},o.prototype.stop=function(){return this.drawing=!1,this.drawer.finish()},o.prototype.doDraw=function(t){var r,o,i,n,e,s,h,u;for(o=i=1,h=t;h>=1?h>=i:i>=h;o=h>=1?++i:--i)for(u=this.commands,n=0,e=u.length;e>n;n++)r=u[n],"number"==typeof r.mod?(s=r.mod?r.mod*o:1,r.fn.apply(this.drawer,[r.args,s])):"function"==typeof r.mod?r.fn.apply(this.drawer,[r.args,r.mod(o)]):r.fn.apply(this.drawer,[r.args]);return this.stop()},o.prototype.keepDrawing=function(){var t,r,o,i,n,e,s;if(this.drawing){for(r=o=0;10>=o;r=++o)for(this.n=this.n+1,s=this.commands,i=0,n=s.length;n>i;i++)t=s[i],"number"==typeof t.mod?(e=t.mod?t.mod*this.n:1,t.fn.apply(this.drawer,[t.args,e])):"function"==typeof t.mod?t.fn.apply(this.drawer,[t.args,t.mod(this.n)]):t.fn.apply(this.drawer,[t.args]);return window.requestAnimationFrame(function(t){return function(){return t.keepDrawing()}}(this)),this}},o.prototype.finish=function(){return this.drawer.finish(),this},i={NORMAL:"normal",MULTIPLY:"multiply",SCREEN:"screen",OVERLAY:"overlay",DARKEN:"darken",LIGHTEN:"lighten","COLOR-DODGE":"color-dodge","COLOR-BURN":"color-burn","HARD-LIGHT":"hard-light","SOFT-LIGHT":"soft-light",DIFFERENCE:"difference",EXCLUSION:"exclusion",HUE:"hue",SATURATION:"saturation",COLOR:"color",LUMINOSITY:"luminosity"},o}()}),(t=function(t){return"object"==typeof exports?module.exports=t(require("../color","turtle-drawer")):"function"==typeof define&&define.amd?define(["color","turtle-drawer"],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.OffsetColorDrawer=t(this.TURTLE.Color,this.TURTLE.TurtleDrawer))})(function(t,r){var i;return i=function(i){function e(o){var i,e,s,h,u;for(this.offsetX=30,this.offsetY=30,this.drawers=[],e=s=0;2>=s;e=s+=1)this.drawers[e]=new r(o);u=new r(o);for(h in u)i=u[h],"function"==typeof i&&!function(t){return function(r){return t[r]=function(){var t,o,i,e,s,h;for(t=1<=arguments.length?n.call(arguments,0):[],s=this.drawers,h=[],i=0,e=s.length;e>i;i++)o=s[i],h.push(function(o){return o[r].apply(o,t)}(o));return h}}}(this)(h,i);this.color=function(r){return this._color=r,this.drawers[0].color(new t(this._color.r,0,0,this._color.opacity/3)),this.drawers[1].color(new t(0,this._color.g,0,this._color.opacity/3)),this.drawers[2].color(new t(0,0,this._color.b,this._color.opacity/3)),this},this.setX=function(t,r){return null==r&&(r=0),this.drawers[0].setX(t,r),this.drawers[1].setX(t+this.offsetX,r),this.drawers[2].setX(t+2*this.offsetX,r),this},this.moveX=function(t,r){return null==r&&(r=0),this.drawers[0].moveX(t,r),this.drawers[1].moveX(t+this.offsetX,r),this.drawers[2].moveX(t+2*this.offsetX,r),this},this.setY=function(t,r){return null==r&&(r=0),this.drawers[0].setY(t,r),this.drawers[1].setY(t+this.offsetY,r),this.drawers[2].setY(t+2*this.offsetY,r),this},this.moveY=function(t,r){return null==r&&(r=0),this.drawers[0].moveY(t,r),this.drawers[1].moveY(t+this.offsetY,r),this.drawers[2].moveY(t+2*this.offsetY,r),this}}return o(e,i),e}(r)})}).call(this);
{
"name": "infinite-turtles",
"version": "0.1.7",
"version": "0.1.8",
"description": "Turtle drawing library",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc