Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

fix: info box showing wrong detail with nsspe #12

Merged
merged 4 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/component/DotMarker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defineProps<{

<template lang="pug">
.cross(:style="{ height: `${size}px`, width: `${size}px`, zIndex }")
svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" :class="int != undefined ? `intensity-${int}` : ''" :height="size" :width="size")
svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" :class="int ? `intensity-${int}` : 'intensity-unknow'" :height="size" :width="size")
circle.outer(cx="38", cy="38", r="28")
circle.inner(cx="38", cy="38", r="20")/
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/component/MapRtsBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ onUnmounted(() => {
});

function filter(box: Box) {
return box
return box;
}
</script>

Expand Down
15 changes: 1 addition & 14 deletions src/components/component/RtsMarker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,6 @@ const getIntensityColor = (rts?: RtsStation) => {
font-size: 14px;
font-weight: 700;
outline: 2px solid #fff;
text-align: center;
}

&::before {
position: absolute;
top: 12px;
width: 8px;
height: 8px;
background-color: hsl(var(--surface-variant-hsl));
transform: rotate(45deg);
}

> .rts-marker-detail {
Expand All @@ -155,6 +145,7 @@ const getIntensityColor = (rts?: RtsStation) => {
background-color: hsl(var(--surface-variant-hsl));
border-radius: 8px;
white-space: nowrap;
color: #fff;
text-rendering: optimizeLegibility;
box-shadow: 0 0 8px 0 hsl(var(--background-hsl) / 0.6);
cursor: default;
Expand Down Expand Up @@ -189,10 +180,6 @@ const getIntensityColor = (rts?: RtsStation) => {
}
}

&:hover::before {
content: "";
}

&:hover > .rts-marker-detail {
display: flex;
}
Expand Down
10 changes: 9 additions & 1 deletion src/components/view/InfoBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ onMounted(() => {});
IntensityBox(:int="eew[currentEewIndex].max == 0 ? -1 : eew[currentEewIndex].max")
.detail
.location {{ eew[currentEewIndex].location || "未知區域" }}
.parameter-container
.parameter-container(v-if="eew[currentEewIndex].detail")
.magnitude.magnitude-6(data-background-text="規模")
.magnitude-value {{ eew[currentEewIndex].magnitude }}
.depth.depth-deep(data-background-text="深度")
.depth-value {{ eew[currentEewIndex].depth }}
.parameter-container(v-else)
.nsspe NSSPE 假設震源參數
.footer
.footer-title 預估最大震度
.time-container
Expand Down Expand Up @@ -291,6 +293,12 @@ onMounted(() => {});
}
}
}

> .nsspe {
font-size: 16px;
font-weight: 400;
line-height: 28px;
}
}
}
}
Expand Down
12 changes: 10 additions & 2 deletions src/styles/intensity.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
--intensity-7: #ff0000;
--intensity-8: #c00000;
--intensity-9: #9600c8;
--intensity-unknow: #202020;
}

.intensity-0 {
Expand Down Expand Up @@ -180,8 +181,15 @@

.intensity-unknow {
color: #fff;
background-color: #202020;
box-shadow: inset 0px 0px 0px 2px #808080;
background-color: var(--intensity-unknow);

.inner {
fill: var(--intensity-unknow);
}

.outer {
fill: #fff;
}

&::after {
content: "?";
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ interface BaseEewEvent {
/**
* 震波半徑
*/
r: { p: number; s: number; };
r: { p: number; s: number };
/**
* 預估震波抵達所在地秒數
*/
t?: { p: number; s: number; };
t?: { p: number; s: number };
/**
* 預估所在地震度
*/
Expand Down