
Security News
Security Community Slams MIT-linked Report Claiming AI Powers 80% of Ransomware
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.
@forward-software/reveal.js-qrcodes
Advanced tools
Custom plugin for Reveal.js to show QR Codes by adding a single class to HTML elements
Custom plugin for Reveal.js to show QR Codes by adding a single class to HTML elements.
Simply include RevealQRCodes plugin
Reveal.initialize({
  // ...
  plugins: [
    // ...,
    RevealQRCodes,
  ],
});
And add the required class and data attributes to HTML elements you'd like to turn into QR Codes
<a href="https://example.com/" class="qrcode" data-size=500></a>
You can configure the plugin with the following options:
// ...
plugins: [ /* ... */ ],
qrcodes: {
    selector: ".qrcode",
    size: 256,
    colorDark: "#000000",
    colorLight: "#ffffff",
    correctionLevel: "H"
}
| Name | Type | Description | Default | 
|---|---|---|---|
| selector | String | CSS selector to use when searching HTML elements to render as QR Codes | ".qrcode" | 
| size | Number | Default size (Width and Height) to render QR Codes | 256 | 
| colorDark | String | Color to use for "dark" segments of QR Codes | "#000000" | 
| colorLight | String | Color to use for "light" segments of QR Codes | "#ffffff" | 
| correctionLevel | String | Correction level to include in the generated QR Codes. Follows this schema: "L"for"Low","M"for"Medium","Q"for"Quartile","H"for"High" | "H" | 
| configurations | Record<String, QRCodeConfiguration> | An object containing keyed custom configurations for specific QR Codes. | {} | 
To configure a specific QR Code properties you can either set data attributes for an HTML element (see HTML Element Configuration section) or use the configurations option (see QR Codes Static Configuration section).
You can customize each QR Code by applying to a specific HTML element the following data attributes
| Name | Default | 
|---|---|
| data-text | QR Code content to be rendered, if not set the plugin will use the hrefattribute value (if available) as content. | 
| data-size | see sizein Global Configuration | 
| data-color-dark | see colorDarkin Global Configuration | 
| data-color-light | see colorLightin Global Configuration | 
| data-correction-level | see correctionLevelin Global Configuration | 
[!TIP] The generated QR Code will contain the value of the
data-textdata attribute or fallback to thehrefattribute one.
You can customize each QR Code by defining a configuration in the configurations option in Global Configuration and adding an ID to a specific HTML element.
Available QRCodeConfiguration parameters are as follow:
| Name | Default | 
|---|---|
| text | QR Code content to be rendered, if not set the plugin will use the hrefattribute value (if available) as content. | 
| size | see sizein Global Configuration | 
| colorDark | see colorDarkin Global Configuration | 
| colorLight | see colorLightin Global Configuration | 
| correctionLevel | see correctionLevelin Global Configuration | 
[!IMPORTANT] Parameters specified in the
configurationsobject will take precedence over HTML element data attributes
Specify a QR Code configuration
// ...
plugins: [ /* ... */ ],
qrcodes: {
    selector: ".qrcode",
    configurations: {
        "example-qr-code": {
            text: "https://example.com/",
            size: 512,
            correctionLevel: 1
        }
    }
}
and set an element ID
<p id="example-qr-code" class="qrcode"></p>
Since Reveal.js will add constraints to max-width and max-height through CSS for img, we suggest adding the following class to revert this behaviour for QR Code images
.qrcode img {
  max-width: 100%;
  max-height: 100%;
}
[!NOTE] Change
.qrcodeselector with the class you chose asselectorin Global Configuration
MIT
Made with ✨ & ❤️ by ForWarD Software and contributors
FAQs
Custom plugin for Reveal.js to show QR Codes by adding a single class to HTML elements
We found that @forward-software/reveal.js-qrcodes demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.