Spaces:
Running
on
A10G
Running
on
A10G
Zhen Ye
commited on
Commit
·
87e151b
1
Parent(s):
45f9535
ui: Remove glow effects from bounding boxes and aimpoints
Browse files- frontend/js/ui/overlays.js +0 -26
frontend/js/ui/overlays.js
CHANGED
|
@@ -48,15 +48,12 @@ APP.ui.overlays.render = function (canvasId, trackSource) {
|
|
| 48 |
|
| 49 |
function drawAimpoint(ctx, x, y, isSel) {
|
| 50 |
ctx.save();
|
| 51 |
-
ctx.shadowBlur = isSel ? 18 : 12;
|
| 52 |
-
ctx.shadowColor = "rgba(239,68,68,.45)";
|
| 53 |
ctx.strokeStyle = "rgba(239,68,68,.95)";
|
| 54 |
ctx.lineWidth = isSel ? 3 : 2;
|
| 55 |
ctx.beginPath();
|
| 56 |
ctx.arc(x, y, isSel ? 10 : 9, 0, Math.PI * 2);
|
| 57 |
ctx.stroke();
|
| 58 |
|
| 59 |
-
ctx.shadowBlur = 0;
|
| 60 |
ctx.strokeStyle = "rgba(255,255,255,.70)";
|
| 61 |
ctx.lineWidth = 1.5;
|
| 62 |
ctx.beginPath();
|
|
@@ -84,31 +81,8 @@ APP.ui.overlays.render = function (canvasId, trackSource) {
|
|
| 84 |
const isFocus = label.includes("drone") || label.includes("uav");
|
| 85 |
|
| 86 |
ctx.strokeStyle = isSel ? "rgba(34,211,238,.95)" : (isFocus ? "rgba(34,211,238,.70)" : "rgba(124,58,237,.55)");
|
| 87 |
-
ctx.shadowColor = isSel ? "rgba(34,211,238,.40)" : "rgba(124,58,237,.25)";
|
| 88 |
-
ctx.shadowBlur = isSel ? 18 : 10;
|
| 89 |
roundRect(ctx, b.x, b.y, b.w, b.h, 10, false, true);
|
| 90 |
|
| 91 |
-
// Animated pulsing glow for selected box
|
| 92 |
-
if (isSel) {
|
| 93 |
-
const pulse = Math.sin(t * 3) * 0.5 + 0.5; // 0..1 pulsing
|
| 94 |
-
ctx.save();
|
| 95 |
-
ctx.strokeStyle = `rgba(34,211,238,${0.25 + pulse * 0.35})`;
|
| 96 |
-
ctx.lineWidth = 6;
|
| 97 |
-
ctx.shadowColor = `rgba(34,211,238,${0.3 + pulse * 0.4})`;
|
| 98 |
-
ctx.shadowBlur = 28 + pulse * 20;
|
| 99 |
-
roundRect(ctx, b.x, b.y, b.w, b.h, 10, false, true);
|
| 100 |
-
ctx.restore();
|
| 101 |
-
ctx.lineWidth = 3; // restore for subsequent drawing
|
| 102 |
-
}
|
| 103 |
-
|
| 104 |
-
// pseudo mask glow
|
| 105 |
-
ctx.shadowBlur = 0;
|
| 106 |
-
const g = ctx.createRadialGradient(b.x + b.w * 0.5, b.y + b.h * 0.5, 10, b.x + b.w * 0.5, b.y + b.h * 0.5, Math.max(b.w, b.h) * 0.75);
|
| 107 |
-
g.addColorStop(0, isSel ? "rgba(34,211,238,.16)" : "rgba(124,58,237,.10)");
|
| 108 |
-
g.addColorStop(1, "rgba(0,0,0,0)");
|
| 109 |
-
ctx.fillStyle = g;
|
| 110 |
-
ctx.fillRect(b.x, b.y, b.w, b.h);
|
| 111 |
-
|
| 112 |
// Label / Info Text
|
| 113 |
ctx.font = "bold 13px 'Inter', sans-serif";
|
| 114 |
let text = (d.label || "OBJ").toUpperCase();
|
|
|
|
| 48 |
|
| 49 |
function drawAimpoint(ctx, x, y, isSel) {
|
| 50 |
ctx.save();
|
|
|
|
|
|
|
| 51 |
ctx.strokeStyle = "rgba(239,68,68,.95)";
|
| 52 |
ctx.lineWidth = isSel ? 3 : 2;
|
| 53 |
ctx.beginPath();
|
| 54 |
ctx.arc(x, y, isSel ? 10 : 9, 0, Math.PI * 2);
|
| 55 |
ctx.stroke();
|
| 56 |
|
|
|
|
| 57 |
ctx.strokeStyle = "rgba(255,255,255,.70)";
|
| 58 |
ctx.lineWidth = 1.5;
|
| 59 |
ctx.beginPath();
|
|
|
|
| 81 |
const isFocus = label.includes("drone") || label.includes("uav");
|
| 82 |
|
| 83 |
ctx.strokeStyle = isSel ? "rgba(34,211,238,.95)" : (isFocus ? "rgba(34,211,238,.70)" : "rgba(124,58,237,.55)");
|
|
|
|
|
|
|
| 84 |
roundRect(ctx, b.x, b.y, b.w, b.h, 10, false, true);
|
| 85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
// Label / Info Text
|
| 87 |
ctx.font = "bold 13px 'Inter', sans-serif";
|
| 88 |
let text = (d.label || "OBJ").toUpperCase();
|