mirror of
https://gitee.com/coder-xiaomo/algorithm-visualization
synced 2025-09-09 14:11:39 +08:00
添加水印
This commit is contained in:
@@ -72,6 +72,33 @@ function initArray(elementId, listData) {
|
||||
|
||||
console.log(fragment)
|
||||
workSpace.primaryCanvas.html("")
|
||||
|
||||
// 添加水印 居中
|
||||
var watermarkWidth = settings.outerSize.height * 0.65
|
||||
shape.addWatermark(elementId, {
|
||||
imageSrc: "./assets/image/logo-small.svg",
|
||||
})
|
||||
.attr('id', 'watermark-c-c')
|
||||
.attr('x', settings.outerSize.width / 2)
|
||||
.attr('y', settings.outerSize.height / 2)
|
||||
.style('width', watermarkWidth + 'px')
|
||||
.style('height', watermarkWidth + 'px')
|
||||
.style('transform', `translate(-${watermarkWidth / 2}px, -${watermarkWidth / 2}px)`)
|
||||
.style('opacity', '0.015')
|
||||
.style('transition', '0.2s')
|
||||
|
||||
// 添加水印 右下角
|
||||
var watermarkWidth = 60
|
||||
shape.addWatermark(elementId, {
|
||||
imageSrc: "./assets/image/logo-small.svg",
|
||||
})
|
||||
.attr('id', 'watermark-r-b')
|
||||
.attr('x', settings.outerSize.width)
|
||||
.attr('y', settings.outerSize.height)
|
||||
.style('width', watermarkWidth + 'px')
|
||||
.style('height', watermarkWidth + 'px')
|
||||
.style('transform', 'translate(-80px, -80px)')
|
||||
|
||||
workSpace.primaryCanvas.node().appendChild(fragment)
|
||||
document.getElementById(elementId).customAttr = fragment.customAttr
|
||||
}
|
||||
|
Reference in New Issue
Block a user