
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
progressive-image.js
Advanced tools
demonstration | GitHub | npm | donate | @craigbuckler | craigbuckler.com
A lazy-loading progressive image system similar to those seen on Facebook and Medium. A very small, blurred image is replaced with the full-resolution equivalent when the element is scrolled into view.
Please use the code as you wish. Tweet me @craigbuckler if you find it useful and donate toward development if you use it commercially.
srcset and sizes attributes)Include the minified CSS and JavaScript anywhere in your page:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/progressive-image.js/dist/progressive-image.css">
<script src="https://cdn.jsdelivr.net/npm/progressive-image.js/dist/progressive-image.js"></script>
CDN URLs are shown above but you can also npm i progressive-image.js to install via npm and use a bundler.
Basic example:
<a href="full.jpg" class="progressive replace">
<img src="tiny.jpg" class="preview" alt="image" />
</a>
Where:
full.jpg is the large image.tiny.jpg is a very small preview image - typically 20px in width saved with high JPEG compression. It be added to the page directly or inlined as a data URI.Both images must have the same aspect ratio.
If image loading or JavaScript fails, a blurred version of the preview image can be clicked to view the full image.
When JavaScript runs successfully, the large image is loaded and revealed when the preview is scrolled into view. The link click is disabled and resulting HTML will be:
<a href="full.jpg" class="progressive">
<img src="full.jpg" alt="image" />
</a>
Responsive images of differing sizes and resolutions can be defined in the link using the data-srcset and data-sizes attributes which map to the standard srcset and sizes attributes, e.g.
<a href="small.jpg"
data-srcset="small.jpg 800w, large.jpg 1200w"
data-sizes="100vw"
class="progressive replace">
<img src="tiny.jpg" class="preview" alt="image" />
</a>
On replacement, the image code becomes:
<img src="small.jpg" srcset="small.jpg 800w, large.jpg 1200w" sizes="100vw" alt="image" />
Modern browsers will load large.jpg on screens of 800px width or greater.
Further examples, options and usage notes can be found on the demonstration page.
FAQs
progressive lazy-loading image system
The npm package progressive-image.js receives a total of 265 weekly downloads. As such, progressive-image.js popularity was classified as not popular.
We found that progressive-image.js 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.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.