Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Automatically generate pixelated gradient between two block elements. Written in Typescript.
Download this plugin from the Github repository or install it through this command:
$ npm install pixer --save
This library is also available through Bower package manager:
$ bower install pixer --save
Set some CSS rules for the canvas elements we are going to use. These are some suggested classes:
.js-pixer {
width: 100%;
height: 80px;
}
.js-pixer--big {
width: 100%;
height: 120px;
}
.js-pixer--small {
width: 100%;
height: 40px;
}
Import the Pixer library:
<script src="path/to/dist/pixer.js"></script>
Just put a canvas element having the data-pixer attribute in between the two block elements you want to apply the pixelated border to. It's mandatory to set a CSS property for the background of the two target elements:
<!-- target 1 -->
<div style="background:<COLOR>"></div>
<!-- the pixelated gradient border will be generated inside this canvas -->
<canvas data-pixer class="js-pixer"></canvas>
<!-- target 2 -->
<div style="background:<ANOTHER COLOR>"></div>
This Javascript library is UMD compliant, so you can consume it even like this:
var pixer = require('pixer');
// Call the init function which returns the API object handler
var pixerApi = pixer();
Or just get the global object bound to the window:
var pixer = window.pixer;
// Call the init function which returns the API object handler
var pixerApi = pixer();
At the moment the only customizable setting is the number of stripes that the pixelated border will be formed of. The default amount of stripes is 4.
You can set the custom amount of stripes by passing a valid JSON object into the data-pixer attribute:
<div id="target-1" style="background:<COLOR>"></div>
<canvas data-pixer='{"stripes":"4"}' class="js-pixer"></canvas>
<div id="target-2" style="background:<ANOTHER COLOR>"></div>
Available methods:
var pixerApi = pixer();
// Reflow all the pixelated borders in the page
pixerApi.reflow();
Giancarlo Soverini giancarlosoverini@gmail.com
AGPL-3.0
v 0.1.0-beta.1 - 2016-12-6
FAQs
add pixelated canvas gradient between html elements
The npm package pixer receives a total of 0 weekly downloads. As such, pixer popularity was classified as not popular.
We found that pixer 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.