
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
sample html canvas animation loop wrapper
var wrap = franim('wrapperid', {
config : {
resize: true
},
setup : function setup(ctx) {
ctx.fillStyle = "black";
ctx.fillRect(0,0,this.anim.getWidth(),this.anim.getHeight());
},
update : function update(time) {
this.x = ~~(Math.random()*this.anim.getWidth());
this.y = ~~(Math.random()*this.anim.getHeight());
},
draw : function draw(ctx) {
ctx.fillStyle = "red";
ctx.fillRect(this.x, this.y, 1, 1);
}
});
Table of Contents generated with DocToc
##arguments
###wrapperid
Type: String
required
the id of canvas wrapper where new canvace elemnt will be appened
###context
Type: Object
required
object which contains required functions for animation loop
###context.config.resize
Type: Boolean
Default: false
if true make canvas element resize with its wrapper element
###context.init
Type: Function
optional
it is called once before animation is started and context is passed to it as argument
function setup(ctx)
###context.update
Type: Function
optional
it is called on every frame before draw
and AnimationFrame's time
argument is passed to it as argument
function update(time)
###context.draw
Type: Function
required
it is called on every frame, after update
(if is defined) and context is passed to it as argument
function draw(ctx)
if update
is not defined then context is passed to it as a first argument and AnimationFrame's time
argument as second argument
function draw(ctx,time)
##this.anim here is api to control animation loop and some helper functions
####this.anim.pause() it cancels Animation Frame and stops loop
####this.anim.resume() it request Animation Frame and starts loop
####this.anim.getHeight() returns height of canvas element
####this.anim.getWidth() returns width of canvas element
####this.anim.getDelta() returns delta time in seconds between frames
example:
if you had code like this: x += 1;
in your update, after 1 second it will be different depending on frame rate but if you write x += 100*this.anim.getDelta();
it will be changed by 100 after 1 second on any frame rate
The MIT License
Copyright (c) 2014, Irakli Safareli
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
canvas helper library
The npm package franim receives a total of 1 weekly downloads. As such, franim popularity was classified as not popular.
We found that franim demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.