Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
polythene-utilities
Advanced tools
* `easing`: Easing functions * `FastClick`: eliminates the 300ms delay on mobile * `scrollTo`: Animated scroll to a position * `Timer`: Simple start/stop/pause/resume timer * `Layout classes`: Provides common and flexbox classes
easing
: Easing functionsFastClick
: eliminates the 300ms delay on mobilescrollTo
: Animated scroll to a positionTimer
: Simple start/stop/pause/resume timerLayout classes
: Provides common and flexbox classesSimple easing functions - inspired from http://gizma.com/easing/
Example:
import { easing } from "polythene-utilities";
// ...
const val = start + change * easing.easeInOutCubic(percentage);
Wrapper around FT Lab's FastClick.
FastClick is a simple, easy-to-use library for eliminating the 300ms delay between a physical tap and the firing of a click event on mobile browsers. The aim is to make your application feel less laggy and more responsive while avoiding any interference with your current logic.
Because FastClick has an unresolved issue with tap events while scrolling on iOS, it is better to use the convenience wrapper provided by this component. This temporarily removes the FastClick event when an element is being scrolled.
To simply add FastClick to your app:
import { addFastClick } "polythene-utilities";
addFastClick();
Animated scroll to a position.
Signature:
scrollTo({element, to, duration, direction}) => Promise
Options:
element
: (HTML Element) Scrolling elementto
: (Number) Position in pixelsduration
: (Number) Scroll animation duration in secondsdirection
: (String) "vertical" or "horizontal"easing
: (Function) Easing function (default: easing.easeInOutCubic
)Example:
import { scrollTo, easing } from "polythene-utilities";
scrollTo({
element: scrollingElement,
to: 0,
duration: .5,
direction: "horizontal",
easing: easing.easeOutCubic
}).then(() => {
console.log("Done")
});
Simple start/stop/pause/resume timer.
Signature:
new Timer(callback, duration)
Options:
callback
: (Function) Callback function to be called when the timer expiresduration
: (Number) Duration in secondsExample:
import { Timer } from "polythene-utilities";
const timer = new Timer(() => {
hide();
}, timeoutSeconds);
// This starts the timer
timer.pause();
timer.resume();
timer.stop();
Provides common and flexbox classes. Note that these are extra and not required for Polythene apps.
import { addLayoutStyles } frmo "polythene-utilities";
addLayoutStyles();
Use in Mithril elements:
m(".layout.vertical", ...)
.pe-block
.pe-inline-block
.pe-hidden
.pe-relative
.pe-absolute
.pe-fit
.pe-fullbleed
/* flex */
.flex
.flex.auto
.flex.auto-vertical
.flex.none
.flex.one
.flex.two
.flex.three
.flex.four
.flex.five
.flex.six
.flex.seven
.flex.eight
.flex.nine
.flex.ten
.flex.eleven
.flex.twelve
/* layout */
.layout
.layout.horizontal
.layout.horizontal.inline
.layout.vertical.inline
.layout.horizontal
.layout.horizontal.reverse
.layout.vertical
.layout.vertical.reverse
.layout.wrap
.layout.wrap.reverse
/* alignment in cross axis */
.layout.start
.layout.center,
.layout.center-center
.layout.end
/* alignment in main axis */
.layout.start-justified
.layout.center-justified
.layout.center-center
.layout.end-justified
.layout.around-justified
.layout.justified
/* self alignment */
.self-start
.self-center
.self-end
.self-stretch
FAQs
Polythene utility package.
The npm package polythene-utilities receives a total of 10 weekly downloads. As such, polythene-utilities popularity was classified as not popular.
We found that polythene-utilities 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 threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.