I wanted to share a small project I’ve been working on - a simple jigsaw puzzle embed that you can add to any website.
What It Does
It’s a straightforward tool that lets you embed customizable jigsaw puzzles into your web pages. You can:
- Use any image as the puzzle
- Choose the background color
- Set the difficulty by adjusting the number of pieces
When someone completes the puzzle, it sends a “puzzleSolved” message that your site can detect.
How to Add It
Just include this iframe in your HTML:
|
|
Detecting When the Puzzle is Solved
Here’s a simple code example to detect when someone completes your puzzle:
|
|
Credits
This is essentially Dillo’s jigsaw puzzle (https://codepen.io/Dillo/pen/QWKLYab) with very minor adaptations to make it work as an embed. I just added the iframe functionality and message event.
The puzzle is hosted at https://jigsaw.ishan.page if you want to check it out.