'commit'
@@ -18,4 +18,30 @@ body { margin: 0; padding: 0; height: 100vh; display: flex; overflow: hidden; }
|
||||
.menu-item { padding: 3px 10px; cursor: pointer; }
|
||||
.menu-item:hover { background-color: #f0f0f0; }
|
||||
.check-mark { display: inline-block; width: 16px; text-align: center; }
|
||||
.center-dot { position: absolute; width: 8px; height: 8px; background: red; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 5; }
|
||||
.center-dot { position: absolute; width: 8px; height: 8px; background: red; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 5; }
|
||||
|
||||
.center-dot {
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background-color: #ff0000; /* 保持中心红色 */
|
||||
border-radius: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
cursor: pointer;
|
||||
/* 将红色阴影改为黄色阴影 */
|
||||
box-shadow: 0 0 5px rgba(255, 215, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.6);
|
||||
animation: pulse 2s infinite ease-in-out;
|
||||
}
|
||||
|
||||
/* 修改发光动画关键帧颜色 */
|
||||
@keyframes pulse {
|
||||
0% {
|
||||
box-shadow: 0 0 5px rgba(255, 215, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.6);
|
||||
}
|
||||
50% {
|
||||
box-shadow: 0 0 10px rgba(255, 215, 0, 1), 0 0 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.6);
|
||||
}
|
||||
100% {
|
||||
box-shadow: 0 0 5px rgba(255, 215, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.6);
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 198 KiB After Width: | Height: | Size: 198 KiB |
Before Width: | Height: | Size: 886 KiB After Width: | Height: | Size: 886 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
@@ -44,47 +44,24 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
});
|
||||
}
|
||||
|
||||
// 添加偏移量输入框事件处理
|
||||
|
||||
// 修改全局偏移量输入框事件监听
|
||||
const globalStopDistanceInput = document.getElementById('global-stop-distance');
|
||||
|
||||
function updateStopDistanceInput() {
|
||||
if (selectedArrow) {
|
||||
globalStopDistanceInput.value = selectedArrow.dataset.stopDistance || 20;
|
||||
globalStopDistanceInput.disabled = false;
|
||||
} else {
|
||||
globalStopDistanceInput.value = 20;
|
||||
globalStopDistanceInput.disabled = true;
|
||||
}
|
||||
|
||||
// 初始化全局偏移量(从localStorage加载或使用默认值)
|
||||
const savedGlobalStopDistance = localStorage.getItem('globalStopDistance');
|
||||
if (savedGlobalStopDistance) {
|
||||
globalStopDistanceInput.value = savedGlobalStopDistance;
|
||||
}
|
||||
|
||||
|
||||
// 全局偏移量变更事件 - 保存到localStorage无需选中箭头
|
||||
globalStopDistanceInput.addEventListener('input', function() {
|
||||
if (selectedArrow) {
|
||||
selectedArrow.dataset.stopDistance = this.value;
|
||||
console.log(`[设置] 箭头停止距离: ${this.value}px`);
|
||||
saveAllElements();
|
||||
}
|
||||
const globalValue = this.value;
|
||||
localStorage.setItem('globalStopDistance', globalValue);
|
||||
console.log(`[全局设置] 箭头停止距离: ${globalValue}px`);
|
||||
});
|
||||
|
||||
|
||||
function selectArrow(arrow) {
|
||||
document.querySelectorAll('.arrow-container').forEach(el => {
|
||||
el.style.outline = 'none';
|
||||
});
|
||||
selectedArrow = arrow;
|
||||
if (selectedArrow) {
|
||||
selectedArrow.style.outline = '2px solid blue';
|
||||
}
|
||||
updateStopDistanceInput();
|
||||
}
|
||||
|
||||
// 点击空白处取消选择
|
||||
document.addEventListener('click', function() {
|
||||
selectedArrow = null;
|
||||
document.querySelectorAll('.arrow-container').forEach(el => {
|
||||
el.style.outline = 'none';
|
||||
});
|
||||
updateStopDistanceInput();
|
||||
contextMenu.style.display = 'none';
|
||||
});
|
||||
|
||||
// 单个箭头动画函数
|
||||
function animateArrow(arrow, targetX, targetY) {
|
||||
@@ -92,8 +69,9 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
const arrowHeight = ARROW_HEIGHT;
|
||||
const centerOffsetX = arrowWidth / 2;
|
||||
const centerOffsetY = arrowHeight / 2;
|
||||
const stopDistance = parseInt(arrow.dataset.stopDistance) || STOP_DISTANCE;
|
||||
|
||||
// 使用全局偏移量替换单个箭头的stopDistance
|
||||
const stopDistance = parseInt(document.getElementById('global-stop-distance').value) || STOP_DISTANCE;
|
||||
|
||||
const rect = arrow.getBoundingClientRect();
|
||||
const containerRect = backgroundContainer.getBoundingClientRect();
|
||||
let currentX = rect.left - containerRect.left + centerOffsetX;
|
||||
@@ -353,7 +331,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
localStorage.removeItem('centerPoint');
|
||||
}
|
||||
|
||||
// 保存箭头
|
||||
// 保存箭头(移除stopDistance属性)
|
||||
document.querySelectorAll('.arrow-container').forEach(arrow => {
|
||||
elements.push({
|
||||
type: 'arrow',
|
||||
@@ -361,8 +339,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
left: arrow.style.left,
|
||||
top: arrow.style.top,
|
||||
text: arrow.dataset.text || '',
|
||||
referencePoint: arrow.dataset.referencePoint || 'top-left',
|
||||
stopDistance: arrow.dataset.stopDistance || 20
|
||||
referencePoint: arrow.dataset.referencePoint || 'top-left'
|
||||
// 删除stopDistance属性
|
||||
});
|
||||
});
|
||||
|
@@ -4,6 +4,9 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>箭头动画</title>
|
||||
<link rel="stylesheet" href="../layui/css/layui.css">
|
||||
<!--引入layui layer-->
|
||||
<script src="../layui/layui.all.js" charset="utf-8"></script>
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
@@ -24,7 +27,7 @@
|
||||
<div class="offset-control" style="margin-top: 15px; padding: 10px; border: 1px solid #eee; border-radius: 4px;">
|
||||
<label for="global-stop-distance" style="display: block; margin-bottom: 5px;">箭头停止距离 (px):</label>
|
||||
<input type="number" id="global-stop-distance" min="0" max="100" value="20" style="width: 100%; padding: 8px;">
|
||||
<p style="font-size: 12px; color: #666; margin: 5px 0 0 0;">* 选择箭头后设置生效</p>
|
||||
<p style="font-size: 12px; color: #666; margin: 5px 0 0 0;">* 全局设置,所有箭头生效</p>
|
||||
</div>
|
||||
<button class="save-btn" id="markCenterBtn" style="margin-top: 10px;">标记中心点</button>
|
||||
<button class="save-btn" id="startAnimationBtn" style="margin-top: 10px;">开始</button>
|
||||
@@ -42,7 +45,4 @@
|
||||
|
||||
<script src="js/script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
</html>
|
2
dsLightRag/static/layui/css/layui.mobile.css
Normal file
1
dsLightRag/static/layui/css/layui_dist.css
Normal file
2
dsLightRag/static/layui/css/modules/code.css
Normal file
@@ -0,0 +1,2 @@
|
||||
/** layui-v2.5.6 MIT License By https://www.layui.com */
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}
|
BIN
dsLightRag/static/layui/css/modules/layer/default/icon-ext.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
dsLightRag/static/layui/css/modules/layer/default/icon.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
dsLightRag/static/layui/css/modules/layer/default/loading-0.gif
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
dsLightRag/static/layui/css/modules/layer/default/loading-1.gif
Normal file
After Width: | Height: | Size: 701 B |
BIN
dsLightRag/static/layui/css/modules/layer/default/loading-2.gif
Normal file
After Width: | Height: | Size: 1.7 KiB |
1
dsLightRag/static/layui/dist/css/layui.css
vendored
Normal file
1
dsLightRag/static/layui/dist/css/modules/code.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#FAFAFA;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view .layui-code-ol li:first-child{padding-top:10px}.layui-code-view .layui-code-ol li:last-child{padding-bottom:10px}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none}
|
1
dsLightRag/static/layui/dist/css/modules/laydate/default/laydate.css
vendored
Normal file
BIN
dsLightRag/static/layui/dist/css/modules/layer/default/icon-ext.png
vendored
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
dsLightRag/static/layui/dist/css/modules/layer/default/icon.png
vendored
Normal file
After Width: | Height: | Size: 11 KiB |
1
dsLightRag/static/layui/dist/css/modules/layer/default/layer.css
vendored
Normal file
BIN
dsLightRag/static/layui/dist/css/modules/layer/default/loading-0.gif
vendored
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
dsLightRag/static/layui/dist/css/modules/layer/default/loading-1.gif
vendored
Normal file
After Width: | Height: | Size: 701 B |
BIN
dsLightRag/static/layui/dist/css/modules/layer/default/loading-2.gif
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dsLightRag/static/layui/dist/font/iconfont.eot
vendored
Normal file
554
dsLightRag/static/layui/dist/font/iconfont.svg
vendored
Normal file
After Width: | Height: | Size: 299 KiB |
BIN
dsLightRag/static/layui/dist/font/iconfont.ttf
vendored
Normal file
BIN
dsLightRag/static/layui/dist/font/iconfont.woff
vendored
Normal file
BIN
dsLightRag/static/layui/dist/font/iconfont.woff2
vendored
Normal file
5
dsLightRag/static/layui/dist/layui.js
vendored
Normal file
Before Width: | Height: | Size: 326 KiB After Width: | Height: | Size: 299 KiB |
BIN
dsLightRag/static/layui/images/face/0.gif
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
dsLightRag/static/layui/images/face/1.gif
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
dsLightRag/static/layui/images/face/10.gif
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
dsLightRag/static/layui/images/face/11.gif
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
dsLightRag/static/layui/images/face/12.gif
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
dsLightRag/static/layui/images/face/13.gif
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
dsLightRag/static/layui/images/face/14.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
dsLightRag/static/layui/images/face/15.gif
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
dsLightRag/static/layui/images/face/16.gif
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
dsLightRag/static/layui/images/face/17.gif
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
dsLightRag/static/layui/images/face/18.gif
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
dsLightRag/static/layui/images/face/19.gif
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
dsLightRag/static/layui/images/face/2.gif
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
dsLightRag/static/layui/images/face/20.gif
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
dsLightRag/static/layui/images/face/21.gif
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
dsLightRag/static/layui/images/face/22.gif
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
dsLightRag/static/layui/images/face/23.gif
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
dsLightRag/static/layui/images/face/24.gif
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
dsLightRag/static/layui/images/face/25.gif
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
dsLightRag/static/layui/images/face/26.gif
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
dsLightRag/static/layui/images/face/27.gif
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
dsLightRag/static/layui/images/face/28.gif
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
dsLightRag/static/layui/images/face/29.gif
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
dsLightRag/static/layui/images/face/3.gif
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
dsLightRag/static/layui/images/face/30.gif
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
dsLightRag/static/layui/images/face/31.gif
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
dsLightRag/static/layui/images/face/32.gif
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
dsLightRag/static/layui/images/face/33.gif
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
dsLightRag/static/layui/images/face/34.gif
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
dsLightRag/static/layui/images/face/35.gif
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
dsLightRag/static/layui/images/face/36.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
dsLightRag/static/layui/images/face/37.gif
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
dsLightRag/static/layui/images/face/38.gif
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
dsLightRag/static/layui/images/face/39.gif
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
dsLightRag/static/layui/images/face/4.gif
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
dsLightRag/static/layui/images/face/40.gif
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
dsLightRag/static/layui/images/face/41.gif
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
dsLightRag/static/layui/images/face/42.gif
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
dsLightRag/static/layui/images/face/43.gif
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
dsLightRag/static/layui/images/face/44.gif
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
dsLightRag/static/layui/images/face/45.gif
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
dsLightRag/static/layui/images/face/46.gif
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
dsLightRag/static/layui/images/face/47.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
dsLightRag/static/layui/images/face/48.gif
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
dsLightRag/static/layui/images/face/49.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
dsLightRag/static/layui/images/face/5.gif
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
dsLightRag/static/layui/images/face/50.gif
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
dsLightRag/static/layui/images/face/51.gif
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
dsLightRag/static/layui/images/face/52.gif
Normal file
After Width: | Height: | Size: 777 B |
BIN
dsLightRag/static/layui/images/face/53.gif
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
dsLightRag/static/layui/images/face/54.gif
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
dsLightRag/static/layui/images/face/55.gif
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
dsLightRag/static/layui/images/face/56.gif
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
dsLightRag/static/layui/images/face/57.gif
Normal file
After Width: | Height: | Size: 2.6 KiB |