From c355a87b71fa6a9acd0e83cc4912a8380f323475 Mon Sep 17 00:00:00 2001 From: vilmibm Date: Fri, 4 Aug 2023 02:40:22 +0000 Subject: [PATCH] tweak fix for screenshot --- templates/index.tmpl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/templates/index.tmpl b/templates/index.tmpl index 430c191..1173e83 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -64,6 +64,9 @@ #paper span { cursor: help; + } + + .shifted { /* hack for the image download. without this, thin white artifacting at span margins */ margin-left:-1px; } @@ -79,14 +82,10 @@ @media (hover: hover) { #paper span:hover { background-color: white; - /* hack for the image download. without this, thin white artifacting at span margins */ - margin-left:-1px; } #paper span.black:hover { background-color: grey; - /* hack for the image download. without this, thin white artifacting at span margins */ - margin-left:-1px; } } @@ -174,7 +173,13 @@ const downloadImgButton = document.querySelector("#downloadImage"); downloadImgButton.addEventListener("animationend", () => downloadImgButton.classList.remove("rainbow"), false); downloadImgButton.addEventListener("click", () => { + document.querySelectorAll("#paper span").forEach(span => { + span.classList.add("shifted"); + }) html2canvas(document.querySelector("#paper")).then((canvas) => { + document.querySelectorAll("#paper span").forEach(span => { + span.classList.remove("shifted"); + }) canvas.toBlob((blob) => { /* // can't use this because ff doesn't have support by default for clipboard.write()