Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
scratchcard-js
Advanced tools
ScratchCard is a js lib to simulate a scratchcard in browser with html5 and canvas.
You can see the demo page.
You can install ScratchCard with npm:
npm install --save scratchcard-js
or just clone this repo:
git clone https://github.com/Masth0/ScratchCard.git
and pick in the folder ./build the file scratchard.min.js
import {ScratchCard, SCRATCH_TYPE} from 'scratchcard-js'
const scContainer = document.getElementById('js--sc--container')
// You also can pass HTML Element or a string for querySelector
// new ScratchCard(htmlElement...
const sc = new ScratchCard('#js--sc--container', {
scratchType: SCRATCH_TYPE.SPRAY,
containerWidth: scContainer.offsetWidth,
containerHeight: 300,
imageForwardSrc: '/images/scratchcard.jpg',
imageBackgroundSrc: '/images/result.png',
htmlBackground: '<p class="test"><strong>Hello i am HTML content !</strong></p>',
clearZoneRadius: 50,
nPoints: 30,
pointSize: 4,
callback: function () {
alert('Now the window will reload !')
window.location.reload()
}
})
// Init
sc.init().then(() => {
sc.canvas.addEventListener('scratch.move', () => {
let percent = sc.getPercent().toFixed(2)
console.log(percent)
})
}).catch((error) => {
// image not loaded
alert(error.message);
});
'scratch.move'
sc.canvas.addEventListener('scratch.move', function() {
let percent = sc.getPercent();
console.log(percent);
});
FAQs
Create scratch card in browser.
The npm package scratchcard-js receives a total of 2,457 weekly downloads. As such, scratchcard-js popularity was classified as popular.
We found that scratchcard-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.
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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.