
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@bicycle-codes/blur-image
Advanced tools
Use the blur-up technique with images, as a web component.
This depends on having some inline base64 code for a small, blurry image. See @bicycle-codes/stringify for help with that.
npm i -S @bicycle-codes/blur-image
See a demonstration here: substrate-system.github.io/blur-image.
[!TIP] Throttle the internet speed with the dev tools.
Import this module, then use the tag in your HTML. It should work with all contemporary image attributes.
Just import the module; it will call the global customElements.define
function. Also, import the styles.
import '@bicycle-codes/blur-image'
import '@bicycle-codes/blur-image/style.css'
Then use the tag in your HTML:
<body>
<blur-image
src="/100.jpg"
placeholder="data:image/jpeg;base64,/9j/2wBDAAYEBQY..."
></blur-image>
</body>
This package includes minified CSS and JS files, suitable for linking to directly from your HTML.
First make sure the files are accessible by your web server:
cp ./node_modules/@bicycle-codes/blur-image/dist/index.min.js ./public/blur-image.js
cp ./node_modules/@bicycle-codes/blur-image/dist/style.min.css ./public/blur-image.css
Then link to it in your HTML:
<head>
<!-- include the style -->
<link rel="stylesheet" href="/blur-image.css">
</head>
<body>
<blur-image
src="/100.jpg"
placeholder="data:image/jpeg;base64,/9j/2wBDAAYEBQYFBAYGBQY..."
></blur-image>
<!-- include the JS -->
<script src="./blur-image.js"></script>
</body>
Start a local dev server:
npm start
sizes
attribute
tldr; = "It’s actually not that bad to just leave it off. In that case, it assumes sizes='100vw'."<picture>
(most of the time)FAQs
A webcomponent that uses the 'blur up' technique
We found that @bicycle-codes/blur-image demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.