A lightweight library for embedding Verse artwork iframes on any website.
- Build the library:
npm install
npm run build- Include the built script in your HTML:
<script src="path/to/verse-embedded.js"></script>- Add a container div with the
verse-artwork-idattribute:
<div verse-artwork-id="123"></div>- The library will automatically:
- Find all elements with the
verse-artwork-idattribute - Create an iframe for each artwork
- Show a loading spinner while the iframe is loading
- Replace the spinner with the artwork once loaded
- Find all elements with the
You can customize the base URL by creating a new instance of VerseEmbed:
const verseEmbed = new VerseEmbed({
baseUrl: 'https://custom-verse-url.com/artworks'
});
verseEmbed.initialize();npm run build- Build the librarynpm run dev- Watch for changes and rebuildnpm run type-check- Run TypeScript type checking
- Modern browser with ES2020 support
- TypeScript 5.3.3 or higher (for development)