gemini solution
This commit is contained in:
@@ -474,21 +474,41 @@ data:
|
||||
.disk-row { display: flex; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
|
||||
.disk-row:last-child { border-bottom: none; }
|
||||
.disk-name { font-weight: 500; width: 42px; font-size: 0.95em; flex-shrink: 0; }
|
||||
.disk-bar { flex: 1; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; margin: 0 10px; overflow: hidden; min-width: 0; }
|
||||
/* Set the track as a reference container */
|
||||
.disk-bar {
|
||||
flex: 1;
|
||||
height: 8px;
|
||||
background: rgba(255,255,255,0.1);
|
||||
border-radius: 4px;
|
||||
margin: 0 10px;
|
||||
overflow: hidden;
|
||||
min-width: 0;
|
||||
container-type: inline-size; /* <--- KEY CHANGE: Enables width measurement */
|
||||
}
|
||||
/* The fill acts as a "mask" or window */
|
||||
.disk-fill {
|
||||
height: 100%;
|
||||
width: 100%; /* important */
|
||||
transform-origin: left center; /* important */
|
||||
border-radius: 4px;
|
||||
/* background: ... <--- REMOVED from here */
|
||||
position: relative; /* Required for the pseudo-element positioning */
|
||||
overflow: hidden; /* Clips the gradient to the current progress percentage */
|
||||
box-shadow: 0 0 0 1px rgba(0,0,0,0.10) inset;
|
||||
}
|
||||
/* The gradient is applied here, locked to the full track width */
|
||||
.disk-fill::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0; left: 0; bottom: 0;
|
||||
width: 100cqw; /* <--- KEY CHANGE: 100% of the parent .disk-bar width */
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
#60a5fa 0%,
|
||||
#60a5fa 70%,
|
||||
#a78bfa 88%,
|
||||
#fb7185 95%,
|
||||
#ef4444 100%
|
||||
#60a5fa 0%, /* blue */
|
||||
#60a5fa 70%, /* keep blue until 70% of the full scale */
|
||||
#a78bfa 88%, /* purple transition */
|
||||
#fb7185 95%, /* pink transition */
|
||||
#ef4444 100% /* red at 100% */
|
||||
);
|
||||
box-shadow: 0 0 0 1px rgba(0,0,0,0.10) inset;
|
||||
z-index: -1;
|
||||
}
|
||||
.disk-info { font-size: 0.9em; opacity: 0.85; text-align: right; width: 125px; flex-shrink: 0; }
|
||||
</style>
|
||||
@@ -537,7 +557,7 @@ data:
|
||||
<div class="disk-row">
|
||||
<span class="disk-name">Root</span>
|
||||
<div class="disk-bar">
|
||||
<div class="disk-fill" style="transform: scaleX({{ if eq (printf "%.0f" $rootPct) "100" }}1{{ else }}0.{{ if lt $rootPct 10.0 }}0{{ end }}{{ printf "%.0f" $rootPct }}{{ end }});"></div>
|
||||
<div class="disk-fill" style="width: {{ printf "%.0f" $rootPct }}%"></div>
|
||||
</div>
|
||||
<span class="disk-info">{{ printf "%.0f" $rootUsed }} / {{ printf "%.0f" $rootTotal }} GB ({{ printf "%.0f" $rootPct }}%)</span>
|
||||
</div>
|
||||
@@ -548,7 +568,7 @@ data:
|
||||
<div class="disk-row">
|
||||
<span class="disk-name">SSD2</span>
|
||||
<div class="disk-bar">
|
||||
<div class="disk-fill" style="transform: scaleX({{ if eq (printf "%.0f" $ssd2Pct) "100" }}1{{ else }}0.{{ if lt $ssd2Pct 10.0 }}0{{ end }}{{ printf "%.0f" $ssd2Pct }}{{ end }});"></div>
|
||||
<div class="disk-fill" style="width: {{ printf "%.0f" $ssd2Pct }}%"></div>
|
||||
</div>
|
||||
<span class="disk-info">{{ printf "%.0f" $ssd2Used }} / {{ printf "%.0f" $ssd2Total }} GB ({{ printf "%.0f" $ssd2Pct }}%)</span>
|
||||
</div>
|
||||
@@ -559,7 +579,7 @@ data:
|
||||
<div class="disk-row">
|
||||
<span class="disk-name">HDD1</span>
|
||||
<div class="disk-bar">
|
||||
<div class="disk-fill" style="transform: scaleX({{ if eq (printf "%.0f" $hdd1Pct) "100" }}1{{ else }}0.{{ if lt $hdd1Pct 10.0 }}0{{ end }}{{ printf "%.0f" $hdd1Pct }}{{ end }});"></div>
|
||||
<div class="disk-fill" style="width: {{ printf "%.0f" $hdd1Pct }}%"></div>
|
||||
</div>
|
||||
<span class="disk-info">{{ printf "%.1f" $hdd1Used }} / {{ printf "%.1f" $hdd1Total }} TB ({{ printf "%.0f" $hdd1Pct }}%)</span>
|
||||
</div>
|
||||
@@ -570,7 +590,7 @@ data:
|
||||
<div class="disk-row">
|
||||
<span class="disk-name">HDD2</span>
|
||||
<div class="disk-bar">
|
||||
<div class="disk-fill" style="transform: scaleX({{ if eq (printf "%.0f" $hdd2Pct) "100" }}1{{ else }}0.{{ if lt $hdd2Pct 10.0 }}0{{ end }}{{ printf "%.0f" $hdd2Pct }}{{ end }});"></div>
|
||||
<div class="disk-fill" style="width: {{ printf "%.0f" $hdd2Pct }}%"></div>
|
||||
</div>
|
||||
<span class="disk-info">{{ printf "%.1f" $hdd2Used }} / {{ printf "%.1f" $hdd2Total }} TB ({{ printf "%.0f" $hdd2Pct }}%)</span>
|
||||
</div>
|
||||
@@ -581,7 +601,7 @@ data:
|
||||
<div class="disk-row">
|
||||
<span class="disk-name">HDD3</span>
|
||||
<div class="disk-bar">
|
||||
<div class="disk-fill" style="transform: scaleX({{ if eq (printf "%.0f" $hdd3Pct) "100" }}1{{ else }}0.{{ if lt $hdd3Pct 10.0 }}0{{ end }}{{ printf "%.0f" $hdd3Pct }}{{ end }});"></div>
|
||||
<div class="disk-fill" style="width: {{ printf "%.0f" $hdd3Pct }}%"></div>
|
||||
</div>
|
||||
<span class="disk-info">{{ printf "%.1f" $hdd3Used }} / {{ printf "%.1f" $hdd3Total }} TB ({{ printf "%.0f" $hdd3Pct }}%)</span>
|
||||
</div>
|
||||
@@ -592,7 +612,7 @@ data:
|
||||
<div class="disk-row">
|
||||
<span class="disk-name">HDD4</span>
|
||||
<div class="disk-bar">
|
||||
<div class="disk-fill" style="transform: scaleX({{ if eq (printf "%.0f" $hdd4Pct) "100" }}1{{ else }}0.{{ if lt $hdd4Pct 10.0 }}0{{ end }}{{ printf "%.0f" $hdd4Pct }}{{ end }});"></div>
|
||||
<div class="disk-fill" style="width: {{ printf "%.0f" $hdd4Pct }}%"></div>
|
||||
</div>
|
||||
<span class="disk-info">{{ printf "%.1f" $hdd4Used }} / {{ printf "%.1f" $hdd4Total }} TB ({{ printf "%.0f" $hdd4Pct }}%)</span>
|
||||
</div>
|
||||
@@ -603,7 +623,7 @@ data:
|
||||
<div class="disk-row">
|
||||
<span class="disk-name">HDD5</span>
|
||||
<div class="disk-bar">
|
||||
<div class="disk-fill" style="transform: scaleX({{ if eq (printf "%.0f" $hdd5Pct) "100" }}1{{ else }}0.{{ if lt $hdd5Pct 10.0 }}0{{ end }}{{ printf "%.0f" $hdd5Pct }}{{ end }});"></div>
|
||||
<div class="disk-fill" style="width: {{ printf "%.0f" $hdd5Pct }}%"></div>
|
||||
</div>
|
||||
<span class="disk-info">{{ printf "%.1f" $hdd5Used }} / {{ printf "%.1f" $hdd5Total }} TB ({{ printf "%.0f" $hdd5Pct }}%)</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user