Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
A pure logic component for scrolling/zooming. It is independent of any specific kind of rendering or event system. Scroller has been forked from ZyngaScroller to incorporate UMD support. Pull-to-refresh and EasyScroll have been removed from this fork.
The "demo" folder contains examples for usage with DOM and Canvas renderings which works both, on mouse and touch driven devices.
See ZyngaScroller's original demos here: http://popham.github.com/scroller/
These are the available options with their defaults.
Options can be modified using the second constructor parameter or during runtime by modification of scrollerObj.options.optionName
.
true
true
true
250
true
true
false
false
false
0.5
3
Callback (first parameter of constructor) is required. Options are optional.
Defaults are listed above.
The created instance must have proper dimensions using a setDimensions()
call.
Afterwards you can pass in event data or manually control scrolling/zooming via the API.
var scrollerObj = new Scroller(function(left, top, zoom) {
// apply coordinates/zooming
}, {
scrollingY: false
});
// Configure to have an outer dimension of 1000px and inner dimension of 3000px
scrollerObj.setDimensions(1000, 1000, 3000, 3000);
scrollerObj.setDimensions(clientWidth, clientHeight, contentWidth, contentHeight);
scrollerObj.setPosition(clientLeft, clientTop);
snapping
is enabled)scrollerObj.setSnapSize(width, height);
scrollerObj.activatePullToRefresh(height, activate, deactivate, start);
scrollerObj.finishPullToRefresh();
scrollerObj.getValues() => { left, top, zoom }
scrollerObj.zoomTo(level, animate ? false, originLeft ? center, originTop ? center)
zoomTo
but by a relative value.
scrollerObj.zoomBy(factor, animate ? false, originLeft ? center, originTop ? center);
scrollerObj.scrollTo(left, top, animate ? false);
scrollerObj.scrollBy(leftOffset, topOffset, animate ? false);
This API part can be used to pass event data to the scrollerObj
to react on user actions.
doMouseZoom(wheelDelta, timeStamp, pageX, pageY)
doTouchStart(touches, timeStamp)
doTouchMove(touches, timeStamp, scale)
doTouchEnd(timeStamp)
For a touch device just pass the native touches
event data to the doTouch* methods.
On mouse systems one can emulate this data using an array with just one element:
doTouchMove(e.touches, e.timeStamp);
doTouchMove([e], e.timeStamp);
To zoom using the mousewheel
event just pass the data like this:
doMouseZoom(e.wheelDelta, e.timeStamp, e.pageX, e.pageY);
For more information about this please take a look at the demos.
FAQs
Accelerated panning and zooming for HTML and Canvas
The npm package scroller receives a total of 1,506 weekly downloads. As such, scroller popularity was classified as popular.
We found that scroller 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
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.