Skip to content

Commit

Permalink
Process CSS before/after image converting
Browse files Browse the repository at this point in the history
  • Loading branch information
HU-Lee committed Dec 17, 2024
1 parent c77045d commit 11784ac
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/atoms/button/Download.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const DownloadButton: React.FC<DownloadProps> = ({ tag }) => {
if (!element) return;
setModal(ModalType.loading);
try {
element.querySelectorAll(".shadow").forEach((element) => {
element.classList.remove("shadow");
element.classList.add("temporary");
});
const canvas = await html2canvas(element, {
scale: 1.1,
allowTaint: true,
Expand All @@ -44,6 +48,11 @@ const DownloadButton: React.FC<DownloadProps> = ({ tag }) => {
ignoreElements: (element) => element.id === "downloader",
});

element.querySelectorAll(".temporary").forEach((element) => {
element.classList.remove("temporary");
element.classList.add("shadow");
});

if (navigator.userAgent.match(/NAVER|KAKAOTALK/i)) {
Swal.fire({
title: "Data Migration",
Expand Down

0 comments on commit 11784ac

Please sign in to comment.