瀏覽代碼

:art: 进度条美化

visuddhinanda 5 年之前
父節點
當前提交
62e42ffd9b
共有 2 個文件被更改,包括 24 次插入4 次删除
  1. 4 4
      app/term/note.js
  2. 20 0
      app/term/term.css

+ 4 - 4
app/term/note.js

@@ -361,9 +361,9 @@ function render_channal_list(channalinfo) {
 
 
       if (iterator.final == true) {
       if (iterator.final == true) {
         allFinal += stroke_width;
         allFinal += stroke_width;
-        output += ' style="stroke-width: 0; fill: rgb(0, 128, 6);"';
+        output += ' class="progress_bar_done" ';
       } else {
       } else {
-        output += ' style="stroke-width: 0; fill: rgb(230, 230, 230);"';
+        output += ' class="progress_bar_undone" ';
       }
       }
       output += "/>";
       output += "/>";
 
 
@@ -374,13 +374,13 @@ function render_channal_list(channalinfo) {
       svg_width +
       svg_width +
       "' height='" +
       "' height='" +
       svg_height / 5 +
       svg_height / 5 +
-      "'  style='stroke-width: 0; fill: rgb(230, 230, 230);'/>";
+      "' class='progress_bar_bg' />";
     output +=
     output +=
       "<rect  x='0' y='0'  width='" +
       "<rect  x='0' y='0'  width='" +
       allFinal +
       allFinal +
       "' height='" +
       "' height='" +
       svg_height / 5 +
       svg_height / 5 +
-      "'  style='stroke-width: 0; fill: rgb(100, 228, 100);'/>";
+      "' class='progress_bar_percent' style='stroke-width: 0; fill: rgb(100, 228, 100);'/>";
     output +=
     output +=
       '<text x="0" y="' +
       '<text x="0" y="' +
       svg_height +
       svg_height +

+ 20 - 0
app/term/term.css

@@ -190,3 +190,23 @@ note .ref {
 .tran_div:last-child {
 .tran_div:last-child {
   border-bottom: none;
   border-bottom: none;
 }
 }
+
+.progress_bar_done {
+  stroke-width: 0;
+  fill: royalblue;
+}
+
+.progress_bar_undone {
+  stroke-width: 0;
+  fill: #c0c0c052;
+}
+
+.progress_bar_bg {
+  stroke-width: 0;
+  fill: #ffffff;
+}
+
+.progress_bar_percent {
+  stroke-width: 0;
+  fill: limegreen;
+}