TODO: figure out screen capture API

This commit is contained in:
ari melody 2026-01-24 11:53:54 +00:00
parent d74ddc5524
commit 2df26b8ce0
Signed by: ari
GPG key ID: CF99829C92678188

13
main.js
View file

@ -1,5 +1,3 @@
// import html2canvas from '/html2canvas-pro.min.js';
const scheduleDOM = document.getElementById('schedule'); const scheduleDOM = document.getElementById('schedule');
const VERSION = "v1.0.0"; const VERSION = "v1.0.0";
@ -117,18 +115,11 @@ function altText() {
} }
function copyClipboard() { function copyClipboard() {
html2canvas(scheduleDOM).then(/** @typeof HTMLCanvasElement */ canvas => { // TODO: screen capture API: https://developer.mozilla.org/en-US/docs/Web/API/Screen_Capture_API
canvas.toBlob(blob => {
const item = new ClipboardItem({ 'image/png': blob });
navigator.clipboard.write([item]);
})
});
} }
function saveImage() { function saveImage() {
html2canvas(scheduleDOM).then(canvas => { // TODO: screen capture API: https://developer.mozilla.org/en-US/docs/Web/API/Screen_Capture_API
document.body.appendChild(canvas);
});
} }
function exportJSON() { function exportJSON() {