|
|
|
@ -18,10 +18,11 @@ |
|
|
|
}} |
|
|
|
out:fade={{ duration: transition ? 130 : 0 }} |
|
|
|
class="indicator" |
|
|
|
class:flipped={top < 20} |
|
|
|
style="top: {top}px; left: {left}px; width: {width}px; height: {height}px; --color: {color}; --zIndex: {zIndex};" |
|
|
|
> |
|
|
|
{#if text} |
|
|
|
<div class="text" class:flipped={top < 22}> |
|
|
|
<div class="text" class:flipped={top < 20}> |
|
|
|
{text} |
|
|
|
</div> |
|
|
|
{/if} |
|
|
|
@ -29,11 +30,17 @@ |
|
|
|
|
|
|
|
<style> |
|
|
|
.indicator { |
|
|
|
position: fixed; |
|
|
|
position: absolute; |
|
|
|
z-index: var(--zIndex); |
|
|
|
border: 2px solid var(--color); |
|
|
|
pointer-events: none; |
|
|
|
border-radius: 4px; |
|
|
|
border-top-right-radius: 4px; |
|
|
|
border-top-left-radius: 0; |
|
|
|
border-bottom-left-radius: 4px; |
|
|
|
border-bottom-right-radius: 4px; |
|
|
|
} |
|
|
|
.indicator.flipped { |
|
|
|
border-top-left-radius: 4px; |
|
|
|
} |
|
|
|
.text { |
|
|
|
background-color: var(--color); |
|
|
|
@ -45,16 +52,17 @@ |
|
|
|
padding: 0 8px 2px 8px; |
|
|
|
transform: translateY(-100%); |
|
|
|
font-size: 11px; |
|
|
|
border-top-left-radius: 2px; |
|
|
|
border-top-right-radius: 2px; |
|
|
|
border-bottom-right-radius: 2px; |
|
|
|
border-top-left-radius: 4px; |
|
|
|
border-top-right-radius: 4px; |
|
|
|
border-bottom-right-radius: 4px; |
|
|
|
white-space: nowrap; |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
justify-content: flex-start; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
.flipped { |
|
|
|
.text.flipped { |
|
|
|
border-top-left-radius: 4px; |
|
|
|
transform: translateY(0%); |
|
|
|
top: -2px; |
|
|
|
} |
|
|
|
|