mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
dbd3719736
commit
df0e273a50
3 changed files with 10 additions and 3 deletions
|
|
@ -12,5 +12,10 @@
|
||||||
border: 1px solid var(--b3-list-hover);
|
border: 1px solid var(--b3-list-hover);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.table th,
|
||||||
|
.table td {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,10 +111,11 @@ export const exportImage = (id: string) => {
|
||||||
} else if (window.siyuan.config.export.imageWatermarkStr) {
|
} else if (window.siyuan.config.export.imageWatermarkStr) {
|
||||||
addScript("/stage/protyle/js/html2canvas.min.js?v=1.4.1", "protyleHtml2canvas").then(() => {
|
addScript("/stage/protyle/js/html2canvas.min.js?v=1.4.1", "protyleHtml2canvas").then(() => {
|
||||||
const width = Math.max(exportDialog.element.querySelector('.export-img').clientWidth / 3, 150);
|
const width = Math.max(exportDialog.element.querySelector('.export-img').clientWidth / 3, 150);
|
||||||
watermarkPreviewElement.setAttribute("style", `width: ${width}px;height: ${width}px;display: flex;justify-content: center;align-items: center;color: var(--b3-border-color);font-size: 12px;`)
|
watermarkPreviewElement.setAttribute("style", `width: ${width}px;height: ${width}px;display: flex;justify-content: center;align-items: center;color: var(--b3-border-color);font-size: 14px;`)
|
||||||
watermarkPreviewElement.innerHTML = `<div style="transform: rotate(-45deg)">${window.siyuan.config.export.imageWatermarkStr}</div>`;
|
watermarkPreviewElement.innerHTML = `<div style="transform: rotate(-45deg)">${window.siyuan.config.export.imageWatermarkStr}</div>`;
|
||||||
window.html2canvas(watermarkPreviewElement, {
|
window.html2canvas(watermarkPreviewElement, {
|
||||||
useCORS: true
|
useCORS: true,
|
||||||
|
scale: 1,
|
||||||
}).then((canvas) => {
|
}).then((canvas) => {
|
||||||
watermarkPreviewElement.innerHTML = "";
|
watermarkPreviewElement.innerHTML = "";
|
||||||
watermarkPreviewElement.setAttribute("style", `background-image: url(${canvas.toDataURL("image/png")});background-repeat: repeat;position: absolute;top: 0;left: 0;width: 100%;height: 100%;border-radius: var(--b3-border-radius-b);`)
|
watermarkPreviewElement.setAttribute("style", `background-image: url(${canvas.toDataURL("image/png")});background-repeat: repeat;position: absolute;top: 0;left: 0;width: 100%;height: 100%;border-radius: var(--b3-border-radius-b);`)
|
||||||
|
|
|
||||||
3
app/src/types/index.d.ts
vendored
3
app/src/types/index.d.ts
vendored
|
|
@ -157,7 +157,8 @@ interface Window {
|
||||||
siyuan: ISiyuan
|
siyuan: ISiyuan
|
||||||
webkit: any
|
webkit: any
|
||||||
html2canvas: (element: Element, opitons: {
|
html2canvas: (element: Element, opitons: {
|
||||||
useCORS: boolean
|
useCORS: boolean,
|
||||||
|
scale?: number
|
||||||
}) => Promise<any>;
|
}) => Promise<any>;
|
||||||
JSAndroid: {
|
JSAndroid: {
|
||||||
returnDesktop(): void
|
returnDesktop(): void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue