Compare commits

...

3 Commits

Author SHA1 Message Date
Zzc
972e35f278 Merge branch 'dev' of http://222.212.85.86:8222/bdzl2/bxztApp into dev 2025-11-16 14:39:05 +08:00
Zzc
d6c242c540 feat(cockpit): 为提示和警告组件添加背景图像和图标
- 更新 EmergencyForceTooltip 以使用三部分可拉伸的背景图像(顶部、中间、底部)和用于尺寸的 CSS 变量,取代纯色背景和边框
- 修改关闭按钮为透明点击区域,并添加 focus-visible 轮廓以提高可访问性
- 为 WeatherWarning 级别徽章添加警告图标,并调整徽章高度和对齐方式以实现更好的视觉整合
2025-11-14 18:19:04 +08:00
Zzc
045d362723 feat(cockpit): 添加图标 2025-11-14 18:18:09 +08:00
10 changed files with 74 additions and 33 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -136,6 +136,13 @@ const handleClose = () => {
@use '@/styles/mixins.scss' as *; @use '@/styles/mixins.scss' as *;
.emergency-force-tooltip { .emergency-force-tooltip {
// CSS
// PNG
--tooltip-top-height: 68px;
--tooltip-bottom-height: 68px;
--tooltip-side-padding: 24px;
--tooltip-body-padding: 16px;
position: absolute; position: absolute;
z-index: 9999; z-index: 9999;
pointer-events: auto; pointer-events: auto;
@ -145,14 +152,42 @@ const handleClose = () => {
min-width: 200px; min-width: 200px;
max-width: 300px; max-width: 300px;
padding: 1rem;
// // padding +
background: rgba(9, 22, 45, 0.95); // padding
border: 1px solid rgba(71, 186, 255, 0.4); padding: calc(var(--tooltip-top-height))
border-radius: 0.5rem; var(--tooltip-side-padding)
backdrop-filter: blur(12px); calc(var(--tooltip-bottom-height));
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
//
background-image:
url('@/views/cockpit/assets/emergencyForceTooltip/top.png'),
url('@/views/cockpit/assets/emergencyForceTooltip/bottom.png'),
url('@/views/cockpit/assets/emergencyForceTooltip/middle.png');
// // background-size
background-repeat: no-repeat, no-repeat, no-repeat;
//
// 1px +2px 1px
background-position:
center top,
center bottom,
center calc(var(--tooltip-top-height) - 1px);
// /
// 2px 1px
background-size:
100% var(--tooltip-top-height),
100% var(--tooltip-bottom-height),
100% calc(100% - var(--tooltip-top-height) - var(--tooltip-bottom-height) + 2px);
// border border-radius使
border: none;
//
// backdrop-filter: blur(12px);
// box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
color: #fff; color: #fff;
font-size: 14px; font-size: 14px;
@ -173,31 +208,28 @@ const handleClose = () => {
} }
} }
// // -
.close-button { .close-button {
position: absolute; position: absolute;
top: 0.5rem; top: 18px;
right: 0.5rem; right: 2px;
width: 24px; width: 24px;
height: 24px; height: 24px;
padding: 0; padding: 0;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2); //
border-radius: 50%; border: none;
color: #fff; background: transparent;
font-size: 18px; color: transparent;
font-size: 0;
line-height: 1; line-height: 1;
box-shadow: none;
cursor: pointer; cursor: pointer;
transition: all 0.2s ease;
&:hover { //
background: rgba(255, 255, 255, 0.2); &:focus-visible {
border-color: rgba(71, 186, 255, 0.6); outline: 2px solid rgba(255, 255, 255, 0.8);
transform: scale(1.1); outline-offset: 2px;
}
&:active {
transform: scale(0.95);
} }
} }
@ -241,8 +273,9 @@ const handleClose = () => {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 0.5rem; gap: 0.5rem;
background: rgba(9, 22, 45, 0.95);
border-radius: 0.5rem; // 使
background: rgba(0, 0, 0, 1);
backdrop-filter: blur(12px); backdrop-filter: blur(12px);
span { span {

View File

@ -14,7 +14,7 @@
<!-- 六边形徽章容器 --> <!-- 六边形徽章容器 -->
<div class="badge-container"> <div class="badge-container">
<!-- 六边形徽章 --> <!-- 六边形徽章 -->
<div class="level-badge"> <div class="level-badge" :style="{ backgroundImage: `url(${level.warningIcon})` }">
<!-- <img <!-- <img
src="../assets/img/weather-badge-hexagon.png" src="../assets/img/weather-badge-hexagon.png"
alt="badge" alt="badge"
@ -70,6 +70,10 @@ import { ref } from 'vue'
// //
import glowTopIcon from '../assets/img/weather-badge-glow-top.png' import glowTopIcon from '../assets/img/weather-badge-glow-top.png'
import glowBottomIcon from '../assets/img/weather-badge-glow-bottom.png' import glowBottomIcon from '../assets/img/weather-badge-glow-bottom.png'
import blueWarningIcon from '../assets/img/weather-badge-blue-warning.png'
import yellowWarningIcon from '../assets/img/weather-badge-yellow-warning.png'
import orangeWarningIcon from '../assets/img/weather-badge-orange-warning.png'
import redWarningIcon from '../assets/img/weather-badge-red-warning.png'
const warningLevels = ref([ const warningLevels = ref([
{ {
@ -78,7 +82,8 @@ const warningLevels = ref([
count: 320, count: 320,
color: 'rgba(132, 199, 255, 1)', color: 'rgba(132, 199, 255, 1)',
glowTopIcon: glowTopIcon, glowTopIcon: glowTopIcon,
glowBottomIcon: glowBottomIcon glowBottomIcon: glowBottomIcon,
warningIcon: blueWarningIcon
}, },
{ {
id: 2, id: 2,
@ -86,7 +91,8 @@ const warningLevels = ref([
count: 36, count: 36,
color: 'rgba(215, 209, 38, 1)', color: 'rgba(215, 209, 38, 1)',
glowTopIcon: glowTopIcon, glowTopIcon: glowTopIcon,
glowBottomIcon: glowBottomIcon glowBottomIcon: glowBottomIcon,
warningIcon: yellowWarningIcon
}, },
{ {
id: 3, id: 3,
@ -94,7 +100,8 @@ const warningLevels = ref([
count: 2, count: 2,
color: 'rgba(255, 114, 0, 1)', color: 'rgba(255, 114, 0, 1)',
glowTopIcon: glowTopIcon, glowTopIcon: glowTopIcon,
glowBottomIcon: glowBottomIcon glowBottomIcon: glowBottomIcon,
warningIcon: orangeWarningIcon
}, },
{ {
id: 4, id: 4,
@ -102,7 +109,8 @@ const warningLevels = ref([
count: 1, count: 1,
color: 'rgba(255, 32, 0, 1)', color: 'rgba(255, 32, 0, 1)',
glowTopIcon: glowTopIcon, glowTopIcon: glowTopIcon,
glowBottomIcon: glowBottomIcon glowBottomIcon: glowBottomIcon,
warningIcon: redWarningIcon
} }
]) ])
@ -171,9 +179,9 @@ const districts = ref([
.level-badge { .level-badge {
position: relative; position: relative;
width: vw(80); width: vw(80);
height: vh(90); height: vh(70);
display: flex; display: flex;
align-items: center; align-items: flex-start;
justify-content: center; justify-content: center;
z-index: 2; z-index: 2;
background: url(../assets/img/weather-badge-bg.png) center center / 100% 100% no-repeat; background: url(../assets/img/weather-badge-bg.png) center center / 100% 100% no-repeat;