cleanup: remove pin locator

This commit is contained in:
hypercross 2026-02-26 23:26:45 +08:00
parent bd2e7ac5a5
commit 3f2e8c786b
1 changed files with 2 additions and 10 deletions

View File

@ -7,8 +7,6 @@ customElement("md-pin", { x: 0, y: 0 }, (props, { element }) => {
const [position, setPosition] = createSignal<{ top: string; left: string }>({ top: "0", left: "0" });
const [visible, setVisible] = createSignal(false);
const [transformStyle, setTransformStyle] = createSignal<string>("");
const [showToast, setShowToast] = createSignal(false);
const [toastMessage, setToastMessage] = createSignal("");
let pinContainer: HTMLSpanElement | undefined;
let targetImage: HTMLImageElement | undefined;
let resizeObserver: ResizeObserver | undefined;
@ -110,24 +108,18 @@ customElement("md-pin", { x: 0, y: 0 }, (props, { element }) => {
>
<Show when={visible() && targetImage}>
<span
class="md-pin absolute transform -translate-x-1/2 -translate-y-1/2 pointer-events-auto cursor-pointer
class="md-pin absolute transform -translate-x-1/2 -translate-y-1/2 pointer-events-auto
bg-red-500 text-white text-xs font-bold rounded-full w-6 h-6
flex items-center justify-center shadow-lg
hover:bg-red-600 hover:scale-110 transition-all z-10"
z-10"
style={{
left: position().left,
top: position().top
}}
title={label || '点击复制坐标'}
>
{label || '📍'}
</span>
</Show>
<Show when={showToast()}>
<div class="fixed bottom-4 left-1/2 transform -translate-x-1/2 bg-gray-800 text-white px-4 py-2 rounded shadow-lg text-sm z-50">
{toastMessage()}
</div>
</Show>
</div>
);
});