Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@duccanhole/lightbox
Advanced tools
The fast and simple lightbox package, support multiple type of file, with no dependency.
The fast and simple lightbox package, support multiple type of file, with no dependency.
npm install @duccanhole/lightbox
yarn add @duccanhole/lightbox
pnpm install @duccanhole/lightbox
index.js
and css file from style/index.css
to your project<head>
<link type="text/css" rel="stylesheet" href="/** link your css file here */" />
</head>
<body>
<script type="module">
import Lightbox from "/** link your js file here */"
const lightbox = new Lightbox()
lightbox.open({
type: 'image',
src: 'https://picsum.photos/800/800',
downloadUrl: 'https://picsum.photos/200/300'
})
</script>
</body>
interface IData {
type: "image" | "video" | "audio" | "iframe" | "custom"
src: string // the source link of file
sources: Array<ISource> // the data for source tag, need for "audio" & "video" type
template: string // the html string template to render, need for "custom" type
downloadUrl?: string // the link to download file
}
interface ISource {
src: string
type: string
}
interface IGalleryItem extends IData {
thumnail: string // the display thumbnail link
}
import Lightbox from "@duccanhole/lightbox";
const lightbox = new Lightbox();
lightbox.open({
type: "image",
src: "https://picsum.photos/800/800",
downloadUrl: "https://picsum.photos/200/300"
})
import "@duccanhole/lightbox/style/index.css";
import Lightbox from "@duccanhole/lightbox";
import { useEffect, useState } from "react";
export default function LightboxComponent() {
const [lightbox, setLightbox] = useState<any>(null);
const openLightbox = () => {
lightbox?.open({
type: "image",
src: "https://picsum.photos/800/800",
downloadUrl: "https://picsum.photos/200/300",
});
};
useEffect(() => {
const initLightbox = () => {
setLightbox(new Lightbox());
};
initLightbox();
}, []);
return (
<div className="w-full h-screen bg-white">
<button onClick={openLightbox}>Open lightbox</button>
</div>
);
}
main.ts
import './assets/main.css'
import '@duccanhole/lightbox/style/index.css'
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
const app = createApp(App)
app.use(router)
app.mount('#app')
<template>
<div>
<button @click="openLightbox">Open lightbox</button>
</div>
</template>
<script lang="ts" setup>
import Lighbox from 'lightbox-js'
const lighbox = new Lighbox()
function openLightbox() {
lighbox.open({
type: 'image',
src: 'https://picsum.photos/800/800',
downloadUrl: 'https://picsum.photos/200/300'
})
}
</script>
app.css
@import '@duccanhole/lightbox/style/index.css';
<div>
<button on:click={openLightbox}>Open lightbox</button>
</div>
<script>
import Lightbox from '@duccanhole/lightbox'
import { onMount } from 'svelte';
let lightbox = null
function openLightbox() {
lightbox.open({
type: 'image',
src: 'https://picsum.photos/800/800',
downloadUrl: 'https://picsum.photos/200/300'
})
}
onMount(() => {
lightbox = new Lightbox()
})
</script>
Your can view the demo here
FAQs
The fast and simple lightbox package, support multiple type of file, with no dependency.
We found that @duccanhole/lightbox demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.