Skip to content

Commit 5e27754

Browse files
committed
chore: sub info style
1 parent 39b4daf commit 5e27754

File tree

1 file changed

+67
-27
lines changed

1 file changed

+67
-27
lines changed

luci-app-openclash/luasrc/view/openclash/sub_info_show.htm

+67-27
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,73 @@
2424
}
2525

2626
.sub_setting{
27-
display: inline-block;
28-
white-space: nowrap;
29-
margin: 0 auto;
30-
opacity: 1;
31-
vertical-align: middle;
27+
display: inline-block;
28+
white-space: nowrap;
29+
margin: 0 auto;
30+
opacity: 1;
31+
vertical-align: middle;
32+
line-height: 0; /* 消除行高影响 */
3233
}
3334

34-
.sub_div{
35-
white-space: nowrap;
35+
.sub_setting img {
36+
vertical-align: middle; /* 确保图标垂直居中 */
37+
display: inline-block;
3638
}
3739

40+
/* 日间模式样式 */
3841
.text_show{
39-
color: #000000;
40-
text-shadow:
41-
-0.7px -0.7px 0 #ffffff,
42-
0.7px -0.7px 0 #ffffff,
43-
-0.7px 0.7px 0 #ffffff,
44-
0.7px 0.7px 0 #ffffff;
42+
color: #333333;
4543
}
4644

47-
:root[data-darkmode="true"] {
45+
.progress_bar_bg {
46+
border: 1px solid #999999;
47+
background-color: #f5f5f5;
48+
}
4849

49-
#icon_wrench {
50-
-webkit-filter: invert(1);
51-
filter: invert(1);
52-
}
53-
54-
#icon_arrow {
55-
-webkit-filter: invert(1);
56-
filter: invert(1);
57-
}
50+
.progress_bar_high {
51+
background-color: #9edd9e;
52+
}
53+
54+
.progress_bar_medium {
55+
background-color: #ffc99f;
56+
}
57+
58+
.progress_bar_low {
59+
background-color: #ffb9b9;
60+
}
61+
62+
/* 夜间模式样式 */
63+
:root[data-darkmode="true"] {
64+
#icon_wrench {
65+
-webkit-filter: invert(1);
66+
filter: invert(1);
67+
}
68+
69+
#icon_arrow {
70+
-webkit-filter: invert(1);
71+
filter: invert(1);
72+
}
73+
74+
.text_show{
75+
color: #e0e0e0;
76+
}
77+
78+
.progress_bar_bg {
79+
border: 1px solid #666666;
80+
background-color: #333333;
81+
}
82+
83+
.progress_bar_high {
84+
background-color: #5da05d;
85+
}
86+
87+
.progress_bar_medium {
88+
background-color: #cc8550;
89+
}
90+
91+
.progress_bar_low {
92+
background-color: #cc6262;
93+
}
5894
}
5995

6096
</style>
@@ -105,10 +141,14 @@
105141

106142
function progressbar_<%=idname%>(v, m, pc, np, f, t, tr) {
107143
return String.format(
108-
'<div style="width:250px; max-width:500px; position:relative; border:1px solid #999999; border-radius: 6px">' +
109-
(pc >= 50 ? '<div style="background-color:#9edd9e; width:%d%%; height:36px; border-radius: 6px">' : (pc < 50 && pc >= 20 ? '<div style="background-color:#ffc99f; width:%d%%; height:35px">' : '<div style="background-color:#ffb9b9; width:%d%%; height:35px">')) +
110-
'<div style="position:absolute; left:0;' + (tr == "null" ? 'top:12px;' : 'top:0;') + 'text-align:center; width:100%%">' +
111-
'<small class="text_show">%s '+ (f ? f : '/') +' %s ' + (np ? "" : '(%s%%)') + (tr == "null" ? '<div style="visibility: hidden;">' : '<div style="visibility: visible;">') + '%s (<%:Remaining%> %s <%:days%>)</small>' +
144+
'<div class="progress_bar_bg" style="width:250px; max-width:500px; position:relative; border-radius: 6px">' +
145+
(pc >= 50 ? '<div class="progress_bar_high" style="width:%d%%; height:36px; border-radius: 6px">' :
146+
(pc < 50 && pc >= 20 ? '<div class="progress_bar_medium" style="width:%d%%; height:36px; border-radius: 6px">' :
147+
'<div class="progress_bar_low" style="width:%d%%; height:36px; border-radius: 6px">')) +
148+
'<div style="position:absolute; left:0;' + (tr == "null" ? 'top:12px;' : 'top:-2px;') + 'text-align:center; width:100%%">' +
149+
'<small class="text_show">%s '+ (f ? f : '/') +' %s ' + (np ? "" : '(%s%%)') +
150+
(tr == "null" ? '<div style="visibility: hidden;">' : '<div style="visibility: visible;">') +
151+
'%s (<%:Remaining%> %s <%:days%>)</small>' +
112152
'</div>' +
113153
'</div>' +
114154
'</div>', pc, v, m, pc, t, tr

0 commit comments

Comments
 (0)