JavaScript implementation screenshot,There are two libraries used:
I mainly made two demos and one NPM package:
Open
index.html
directly in your browser.
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
The original html is like this:
This is the element node:
This is after converting to canvas:
This is the element node:
This is after converting to img:
This is the element node:
This is the final result:
npm install --save js_screen_shots
For details, see the document README.md.