style(PdfViewer): 优化加载进度环样式,使用锥形渐变背景
添加锥形渐变背景来显示加载进度,并调整百分比文本的层级
Showing
1 changed file
with
21 additions
and
1 deletions
| ... | @@ -97,7 +97,7 @@ | ... | @@ -97,7 +97,7 @@ |
| 97 | <div class="wrapper" @click.stop> | 97 | <div class="wrapper" @click.stop> |
| 98 | <div class="loading-content"> | 98 | <div class="loading-content"> |
| 99 | <!-- 进度环形图 --> | 99 | <!-- 进度环形图 --> |
| 100 | - <div class="progress-circle"> | 100 | + <div class="progress-circle" :style="{ '--progress': loadingProgress }"> |
| 101 | <div class="progress-percent">{{ loadingProgress }}%</div> | 101 | <div class="progress-percent">{{ loadingProgress }}%</div> |
| 102 | </div> | 102 | </div> |
| 103 | 103 | ||
| ... | @@ -962,12 +962,32 @@ const applyPinchZoom = (newZoom, centerX, centerY, container) => { | ... | @@ -962,12 +962,32 @@ const applyPinchZoom = (newZoom, centerX, centerY, container) => { |
| 962 | justify-content: center; | 962 | justify-content: center; |
| 963 | margin: 0 auto 20px; | 963 | margin: 0 auto 20px; |
| 964 | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | 964 | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
| 965 | + position: relative; | ||
| 966 | + background: conic-gradient( | ||
| 967 | + #4caf50 0deg, | ||
| 968 | + #4caf50 calc(var(--progress, 0) * 3.6deg), | ||
| 969 | + #e0e0e0 calc(var(--progress, 0) * 3.6deg), | ||
| 970 | + #e0e0e0 360deg | ||
| 971 | + ); | ||
| 972 | +} | ||
| 973 | + | ||
| 974 | +.progress-circle::before { | ||
| 975 | + content: ''; | ||
| 976 | + position: absolute; | ||
| 977 | + top: 4px; | ||
| 978 | + left: 4px; | ||
| 979 | + right: 4px; | ||
| 980 | + bottom: 4px; | ||
| 981 | + background-color: white; | ||
| 982 | + border-radius: 50%; | ||
| 965 | } | 983 | } |
| 966 | 984 | ||
| 967 | .progress-percent { | 985 | .progress-percent { |
| 968 | font-size: 18px; | 986 | font-size: 18px; |
| 969 | font-weight: bold; | 987 | font-weight: bold; |
| 970 | color: #4caf50; | 988 | color: #4caf50; |
| 989 | + position: relative; | ||
| 990 | + z-index: 1; | ||
| 971 | } | 991 | } |
| 972 | 992 | ||
| 973 | .loading-text { | 993 | .loading-text { | ... | ... |
-
Please register or login to post a comment