mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-06 17:57:42 +02:00
Make usage indicator more contrast (#10188)
* Make usage indicator more contrast Signed-off-by: Artem Savchenko <armisav@gmail.com> * Use old warning threshold Signed-off-by: Artem Savchenko <armisav@gmail.com> --------- Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -135,6 +135,6 @@
|
||||
border-radius: var(--small-BorderRadius);
|
||||
transition: background-color 0.2s ease;
|
||||
position: relative;
|
||||
border: 1px solid var(--button-secondary-BorderColor);
|
||||
border: 1px solid var(--theme-trans-color);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
|
||||
$: clampedPercent = Math.min(Math.max(percent, 0), 1)
|
||||
|
||||
// Calculate color based on current percentage
|
||||
$: fillColor = clampedPercent >= 0.9 ? '#e53935' : clampedPercent >= 0.7 ? '#fbc02d' : '#43a047'
|
||||
// Calculate style class based on current percentage
|
||||
$: fillClass = clampedPercent >= 0.9 ? 'critical' : clampedPercent >= 0.7 ? 'warning' : 'normal'
|
||||
</script>
|
||||
|
||||
<div class="progress-bar" style="width: {width}; height: {height};">
|
||||
<div class="progress-track">
|
||||
<div class="progress-fill" style="width: {clampedPercent * 100}%; background-color: {fillColor};"></div>
|
||||
<div class="progress-fill {fillClass}" style="width: {clampedPercent * 100}%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -49,5 +49,17 @@
|
||||
transition:
|
||||
width 0.3s ease,
|
||||
background-color 0.3s ease;
|
||||
|
||||
&.normal {
|
||||
background-color: var(--theme-won-color);
|
||||
}
|
||||
|
||||
&.warning {
|
||||
background-color: var(--theme-warning-color);
|
||||
}
|
||||
|
||||
&.critical {
|
||||
background-color: var(--theme-error-color);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user