Răsfoiți Sursa

初步实现git Hello界面

Huan 5 ani în urmă
părinte
comite
6109a1390d
5 a modificat fișierele cu 730 adăugiri și 46 ștergeri
  1. 61 45
      Hello.py
  2. 271 0
      static/Hello.html
  3. BIN
      static/Pic/boat.png
  4. 397 0
      static/hello.css
  5. 1 1
      system/__init__.py

+ 61 - 45
Hello.py

@@ -2,7 +2,7 @@ from multiprocessing import Process, Queue, freeze_support
 import threading
 from _tkinter import TclError
 import tkinter
-from tkinter import ttk
+# from tkinter import ttk
 import tkinter.font as tkfont
 from PIL import ImageTk, Image
 import time
@@ -10,9 +10,11 @@ import os
 import tkinter.messagebox
 import webbrowser
 import random
+import flask
 
 from newtkinter import DragWindow, center_windows
 
+app = flask.Flask(__name__, static_url_path='')
 img = None
 SCREEN = None
 queue_screen = None
@@ -84,6 +86,7 @@ class QueueController:
 
     def add_queue(self, inqueue, outqueue, name):
         self.stop()
+        time.sleep(0.5)
         self.in_dict[name] = inqueue
         self.out_dict[name] = outqueue
         self.queue_list = list(self.in_dict.keys())
@@ -125,52 +128,15 @@ queue_controller = QueueController()
 
 
 def progress_bar(func):
-    def make_bar(*agrs, **kwargs):
-        SCREEN.update()
-        in_queue: Queue
-        out_queue: Queue
+    def run(*agrs, **kwargs):
         in_queue, out_queue = func(*agrs, **kwargs)
         pid = out_queue.get()
         name = func.__name__
         queue_controller.add_queue(in_queue, out_queue, f'{name}_{pid}')
-        progress_screen = tkinter.Toplevel()
-        progress_screen.title('系统持续加载中...')
-        progress_screen.geometry("+10+10")  # 设置所在位置
-        progress = ttk.Progressbar(
-            progress_screen, orient="horizontal", length=300, mode="determinate"
-        )
-        progress.pack()
-        progress_screen.resizable(width=False, height=False)
-        progress["maximum"] = 10
-        progress["value"] = 0
-        i = 0
-        a = 10
-        while out_queue.empty():
-            i += 1
-            a += 1
-            try:
-                progress["value"] = i
-                progress["maximum"] = a
-                progress_screen.update()
-            except TclError:
-                pass
-            SCREEN.update()
-            time.sleep(0.015)
-        try:
-            out_queue.get()
-            t = 0.3
-            for di in range(10):
-                t -= 0.03
-                progress_screen.title(f'检查({round(t,3)})...')
-                progress["value"] = i + di
-                progress_screen.update()
-                time.sleep(0.03)
-            progress_screen.destroy()
-        except TclError:
-            pass
         queue_controller()
-
-    return make_bar
+        time.sleep(1)
+        return 'run success'
+    return run
 
 
 def draftboard_main(in_queue, out_queue):
@@ -181,6 +147,16 @@ def draftboard_main(in_queue, out_queue):
     draw_main(in_queue, out_queue)
 
 
+@app.route('/')
+def hello():
+    return app.send_static_file('Hello.html')
+
+
+@app.route('/draftboard')
+def draftboard():
+    return draftboard_run()
+
+
 @progress_bar
 def draftboard_run():
     in_queue = Queue(10)
@@ -197,6 +173,11 @@ def datascience_main(in_queue, out_queue):
     machine_learning(in_queue, out_queue)
 
 
+@app.route('/datascience')
+def datascience():
+    return datascience_run()
+
+
 @progress_bar
 def datascience_run():
     in_queue = Queue(10)
@@ -213,6 +194,11 @@ def functionmapping_main(in_queue, out_queue):
     function_mapping(in_queue, out_queue)
 
 
+@app.route('/functionmapping')
+def functionmapping():
+    return functionmapping_run()
+
+
 @progress_bar
 def functionmapping_run():
     in_queue = Queue(10)
@@ -229,6 +215,11 @@ def functionfactory_main(in_queue, out_queue):
     function_factory_main(in_queue, out_queue)
 
 
+@app.route('/functionfactory')
+def functionfactory():
+    return functionfactory_run()
+
+
 @progress_bar
 def functionfactory_run():
     in_queue = Queue(10)
@@ -245,6 +236,11 @@ def algebraicfactory_main(in_queue, out_queue):
     algebraic_factory_main(in_queue, out_queue)
 
 
+@app.route('/algebraicfactory')
+def algebraicfactory():
+    return algebraicfactory_run()
+
+
 @progress_bar
 def algebraicfactory_run():
     in_queue = Queue(10)
@@ -261,6 +257,11 @@ def machinelearner_main(in_queue, out_queue):
     machine_learning(in_queue, out_queue)
 
 
+@app.route('/machinelearner')
+def machinelearner():
+    return machinelearner_run()
+
+
 @progress_bar
 def machinelearner_run():
     in_queue = Queue(10)
@@ -277,6 +278,11 @@ def git_main(in_queue, out_queue):
     git_main(in_queue, out_queue)
 
 
+@app.route('/git')
+def git():
+    return git_run()
+
+
 @progress_bar
 def git_run():
     in_queue = Queue(10)
@@ -293,8 +299,13 @@ def crawler_main(in_queue, out_queue):
     crawler_main(in_queue, out_queue)
 
 
+@app.route('/crawler')
+def crawler():
+    return crawler_run()
+
+
 @progress_bar
-def crawlef_run():
+def crawler_run():
     in_queue = Queue(10)
     out_queue = Queue(10)
     Process(target=crawler_main, args=(in_queue, out_queue)).start()
@@ -309,6 +320,11 @@ def system_main(in_queue, out_queue):
     system_main(in_queue, out_queue)
 
 
+@app.route('/system')
+def system():
+    return system_run()
+
+
 @progress_bar
 def system_run():  # 不需要进度条
     in_queue = Queue(10)
@@ -454,7 +470,7 @@ def cotan_main():
         frame,
         text='自动化网页',
         cursor=button_cursor,
-        command=crawlef_run,
+        command=crawler_run,
         height=2,
         font=font3,
         bg=button_color,
@@ -719,4 +735,4 @@ def cotan_main():
 
 if __name__ == "__main__":
     freeze_support()
-    cotan_main()
+    app.run()

+ 271 - 0
static/Hello.html

@@ -0,0 +1,271 @@
+<!DOCTYPE html>
+<html lang="zh">
+    <head>
+        <link rel="stylesheet" type="text/css" href="hello.css">
+        <meta charset="UTF-8">
+        <title>Hello</title>
+    </head>
+    <body>
+        <script>
+            let host = 'http://127.0.0.1:5000/'
+        </script>
+        <canvas id="canvas" class="bg_canvas"></canvas>
+        <div class="screen">
+            <div id='cotanTitle' class="cotan_title">
+            </div>
+            <div id="method" class="mode">
+                <h1 class="mode">CoTan<br>科学计算系统</h1>
+                <h2 class="mode">CoTan工具</h2>
+                <script>
+                    function start(mode_url){
+                        current_circle.add();
+                        let xhr = new XMLHttpRequest();
+                        xhr.onloadend = function () {
+                            console.log('run');
+                            if (xhr.status === 200) {
+                                current_circle.remove();
+                            }};
+                        xhr.open('get',host + mode_url,true);
+                        xhr.send();
+                    }
+                </script>
+                <button type="button" id="board" class="button white big" onclick="start('draftboard')">CoTan草稿板</button>
+                <div class="nothing"></div>
+                <button type="button" id="selenium" class="button white big" onclick="start('crawler')">自动化网页</button>
+
+                <div class="nothing"></div>
+                <button type="button" id="git" class="button white small" onclick="start('git')">git仓库控制器</button>
+
+                <div class="nothing"></div>
+                <button type="button" id="website" class="button white small" onclick="window.open('https://cotan.songzh.website');">CoTan社区</button>
+
+                <h2 class="mode">数学系统</h2>
+
+                <button type="button" id="alg" class="button white big" onclick="start('algebraicfactory')">代数工厂</button>
+
+                <div class="nothing"></div>
+                <button type="button" id="machine" class="button white big" onclick="start('machinelearner')">机器学习</button>
+
+                <div class="nothing"></div>
+                <button type="button" id="data" class="button white big" onclick="start('datascience')">数据科学</button>
+
+                <div class="nothing"></div>
+                <button type="button" id="func" class="button white small" onclick="start('functionfactory')">函数工厂</button>
+
+                <div class="nothing"></div>
+                <button type="button" id="geometric" class="button white small" onclick="start('functionmapping')">函数实验室</button>
+
+                <h2 class="mode">物化系统</h2>
+
+                <button type="button" id="physical" class="button white big">几何车间</button>
+
+                <div class="nothing"></div>
+                <button type="button" id="chemistry" class="button white big">物理车间</button>
+
+                <div class="nothing"></div>
+                <button type="button" id="laboratory" class="button white small">化学车间</button>
+
+                <h2 class="mode">系统工具</h2>
+
+                <button type="button" id="plugin" class="button white small" onclick="start('system')">系统管理</button>
+
+                <div class="nothing"></div>
+                <button type="button" id="process" class="button white small">通信管理器</button>
+            </div>
+            <script>
+                let screen_width = 1200;
+                let screen_height = 800;
+                console.log(screen_height);
+                document.getElementById("cotanTitle").style.width = String(screen_width -
+                    document.getElementById("method").offsetWidth - 1) + 'px';
+
+                // 背景系统
+                class Circle {
+                    constructor(x, y) {
+                        this.x = x;
+                        this.y = y;
+                        this.r = Math.random() * 10 ;
+                        this._mr = Math.random();
+                        this._mx = (Math.random() - 0.5) * 2;
+                        this._my = (Math.random() - 0.5) * 2 ;
+                        this.ax = 0;
+                        this.ay = 0;
+
+                    }
+
+                    drawCircle(ctx) {
+                        ctx.beginPath();  // 开始绘制
+                        ctx.arc(this.x, this.y, this.r, 0, 2 * Math.PI);  // 画弧线
+                        ctx.closePath();  // 结束绘制
+                        ctx.fillStyle = 'rgba(204, 204, 204, 0.3)';
+                        ctx.fill();
+                    }
+
+                    drawLine(ctx, _circle) {
+                        let dx = this.x - _circle.x;  // 差距
+                        let dy = this.y - _circle.y;  // 差距
+                        let d = Math.sqrt(dx * dx + dy * dy);  // 勾股距离
+                        if (d < 180) {
+                            ctx.beginPath();
+                            //开始一条路径,移动到位置 this.x,this.y。创建到达位置 _circle.x,_circle.y 的一条线:
+                            ctx.moveTo(this.x, this.y);   //起始点
+                            ctx.lineTo(_circle.x, _circle.y);   //终点
+                            ctx.closePath();
+                            ctx.strokeStyle = 'rgba(204, 204, 204, ' + String(1 - (d/180)) + ')';
+                            ctx.stroke();
+                        }
+                    }
+
+                    set_a(ax, ay){
+                        this.ax += ax;
+                        this.ax /= 2;
+                        this.ay += ay;
+                        this.ay /= 2;
+                    }
+
+                    set_a_first(){
+                        if (Math.abs(this._mx) > 3) {
+                            this.ax = 0;
+                            this._mx = (Math.random() - 0.5) * 2;
+                        }
+                        if (Math.abs(this._my) > 3) {
+                            this.ay = 0;
+                            this._my = (Math.random() - 0.5) * 2;
+                        }
+                    }
+
+                        // 圆圈移动
+                        // 圆圈移动的距离必须在屏幕范围内
+                    move(w, h) {
+                        this._mx += this.ax;
+                        this._my += this.ay;
+
+                        this._mx = (this.x < w && this.x > 1) ? this._mx : (-this._mx);
+                        this._my = (this.y < h && this.y > 1) ? this._my : (-this._my);
+                        this._mr = (this.r < 10 && this.r > 1) ? this._mr : (-this._mr);
+                        this.x += this._mx / 2;
+                        this.y += this._my / 2;
+                        this.r += this._mr / 2;
+                        if (this.r <= 0){
+                            this._mr = -this._mr;
+                            this.r = -this.r;
+                        }
+                        }}
+            //鼠标点画圆闪烁变动
+                class currentCirle extends Circle {
+                    constructor(x, y) {
+                        super(x, y);
+                        this.r = 8;
+                        this.R = 30;
+                        this.rad = 0;
+                        this.circle = [];
+                    }
+
+                    add() {
+                        console.log('add');
+                        document.getElementsByTagName('title').item(0).innerHTML = 'loading...';
+                        this.circle.push('rgba(204, 204, 204, 0.8)');
+                    }
+
+                    remove() {
+                        console.log('remove');
+                        this.circle.shift();
+                        if (this.circle.length === 0){
+                            document.getElementsByTagName('title').item(0).innerHTML = 'Hello';
+                        }
+                    }
+
+                    drawLine(ctx, _circle) {
+                        let dx = this.x - _circle.x;  // 差距
+                        let dy = this.y - _circle.y;  // 差距
+                        let d = Math.sqrt(dx * dx + dy * dy);  // 勾股距离
+                        if (d < 180){
+                            ctx.beginPath();
+                            ctx.moveTo(this.x, this.y);   //起始点
+                            ctx.lineTo(_circle.x, _circle.y);   //终点
+                            ctx.closePath();
+                            ctx.strokeStyle = 'rgba(204, 0, 0, ' + String(1 - (d / 180)) + ')';
+                            ctx.stroke();
+                            _circle.set_a(dx / 1800, dy / 1800);
+                        }else{
+                            _circle.set_a_first()
+                        }
+                    }
+
+                    drawCircle(ctx) {
+                        let l = this.circle.length;
+                        for (let i of this.circle){
+                            let dx = this.R * Math.cos(this.rad);
+                            let dy = this.R * Math.sin(this.rad);
+                            ctx.beginPath();  // 开始绘制
+                            ctx.arc(this.x + dx, this.y + dy, this.r, 0, 2 * Math.PI);  // 画弧线
+                            ctx.closePath();  // 结束绘制
+                            ctx.fillStyle = i;
+                            ctx.fill();
+                            this.rad += 2 * Math.PI * (1 / l);
+                            if (this.rad >= 2 * Math.PI){
+                                this.rad -= 2 * Math.PI}
+                        }
+                        this.rad += Math.PI * (15 / 180);
+                    }
+                }
+                //更新页面用requestAnimationFrame替代setTimeout
+                window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
+
+                let canvas = document.getElementById('canvas');
+                let ctx = canvas.getContext('2d');
+                let w = canvas.width = canvas.offsetWidth;
+                let h = canvas.height = canvas.offsetHeight;
+                let circles = [];
+                let current_circle = new currentCirle(0, 0);  // 鼠标位置
+                let update_times = 0;
+                let draw = function () {
+                    ctx.clearRect(0, 0, w, h);  // 清空
+                    for (let i = 0; i < circles.length; i++) {
+                        circles[i].move(w, h);
+                        circles[i].drawCircle(ctx);
+                        for (j = i + 1; j < circles.length; j++) {
+                            circles[i].drawLine(ctx, circles[j])
+                        }
+                    }
+                    if (current_circle.x) {
+                        current_circle.drawCircle(ctx);
+                        for (let k = 1; k < circles.length; k++) {
+                            current_circle.drawLine(ctx, circles[k])
+                        }
+                    }else{
+                        for (let k = 1; k < circles.length; k++) {
+                            current_circle.set_a_first()
+                        }
+                    }
+                    update_times += 1;
+                    if (update_times >= 100) {
+                        circles.push(new Circle(Math.random() * w, Math.random() * h));
+                        circles.shift();
+                        update_times = 0
+                    }
+                    requestAnimationFrame(draw)
+                };
+
+                let init = function (num) {
+                    for (var i = 0; i < num; i++) {
+                        circles.push(new Circle(Math.random() * w, Math.random() * h));
+                    }
+                    draw();
+                };
+                window.addEventListener('load', init(220));
+                window.onmousemove = function (e) {  // 鼠标进入范围
+                    // e = e || window.event;
+                    current_circle.x = e.clientX;
+                    current_circle.y = e.clientY;
+                };
+                window.onmouseout = function () {  // 鼠标移出反围
+                    current_circle.x = null;
+                    current_circle.y = null;
+
+                };
+
+            </script>
+        </div>
+    </body>
+</html>

BIN
static/Pic/boat.png


+ 397 - 0
static/hello.css

@@ -0,0 +1,397 @@
+/*h style*/
+
+body{
+    /*background: url("Pic/boat.png");*/
+    /*position: relative;*/
+}
+
+canvas.bg_canvas{
+    background: #000000;
+    display: block;
+    width: 99%;
+    height: 99%;
+    position:absolute;
+    z-index: 1;}
+
+
+h1.mode{
+    font-size: 35px;
+    text-align:center
+}
+
+h2.mode{
+    font-size: 25px;
+    text-align:center
+}
+
+/*div style*/
+
+div.progressbar{
+    background: #00adee;
+    width:100px;
+    height:100px;
+    position:absolute;
+    z-index:20;
+}
+
+div.screen{
+    background: url("Pic/boat.png") repeat;
+    width:1200px;
+    height:800px;
+    position:absolute;
+    left:50%;
+    top:50%;
+    margin:-400px 0 0 -600px;
+    z-index:10;
+}
+
+div.nothing{
+    height: 5px;
+    width: 0;
+}
+
+div.cotan_title{
+    height: 30px;
+    width: 50%;
+    float:right;
+}
+
+div.mode{
+    background: #ffffff;
+    float:right;
+    height: 100%;
+    overflow: auto;
+}
+
+/*button style*/
+
+button.button {
+
+    display: inline-block;
+
+    zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */
+
+    *display: inline;
+
+    vertical-align: baseline;
+
+    margin: 0 2px;
+
+    outline: none;
+
+    cursor: pointer;
+
+    text-align: center;
+
+    text-decoration: none;
+
+    padding: .5em 2em .55em;
+
+    text-shadow: 0 1px 1px rgba(0,0,0,.3);
+
+    -webkit-border-radius: .5em;
+
+    -moz-border-radius: .5em;
+
+    border-radius: .5em;
+
+    -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
+
+    -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
+
+    box-shadow: 0 1px 2px rgba(0,0,0,.2);
+
+}
+
+.button:hover {
+
+    text-decoration: none;
+
+}
+
+.button:active {
+
+    position: relative;
+
+    top: 1px;
+
+}
+
+.big {
+    font: 18px/100% Arial, Helvetica, sans-serif;
+    height: 50px;
+    width: 300px;
+}
+
+.small {
+    font: 15px/100% Arial, Helvetica, sans-serif;
+    height: 40px;
+    width: 300px;
+}
+
+/* color styles
+
+---------------------------------------------- */
+
+
+/* white */
+
+.white {
+
+    color: #606060;
+
+    border: solid 1px #b7b7b7;
+
+    background: #fff;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
+
+    background: -moz-linear-gradient(top,  #fff,  #ededed);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed');
+
+}
+
+.white:hover {
+
+    background: #ededed;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc));
+
+    background: -moz-linear-gradient(top,  #fff,  #dcdcdc);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc');
+
+}
+
+.white:active {
+
+    color: #999;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff));
+
+    background: -moz-linear-gradient(top,  #ededed,  #fff);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff');
+
+}
+
+/* red */
+
+.red {
+
+    color: #faddde;
+
+    border: solid 1px #980c10;
+
+    background: #d81b21;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#ed1c24), to(#aa1317));
+
+    background: -moz-linear-gradient(top,  #ed1c24,  #aa1317);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ed1c24', endColorstr='#aa1317');
+
+}
+
+.red:hover {
+
+    background: #b61318;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#c9151b), to(#a11115));
+
+    background: -moz-linear-gradient(top,  #c9151b,  #a11115);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#c9151b', endColorstr='#a11115');
+
+}
+
+.red:active {
+
+    color: #de898c;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#aa1317), to(#ed1c24));
+
+    background: -moz-linear-gradient(top,  #aa1317,  #ed1c24);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#aa1317', endColorstr='#ed1c24');
+
+}
+
+
+
+/* blue */
+
+.blue {
+
+    color: #d9eef7;
+
+    border: solid 1px #0076a3;
+
+    background: #0095cd;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#00adee), to(#0078a5));
+
+    background: -moz-linear-gradient(top,  #00adee,  #0078a5);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#00adee', endColorstr='#0078a5');
+
+}
+
+.blue:hover {
+
+    background: #007ead;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#0095cc), to(#00678e));
+
+    background: -moz-linear-gradient(top,  #0095cc,  #00678e);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#0095cc', endColorstr='#00678e');
+
+}
+
+.blue:active {
+
+    color: #80bed6;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#0078a5), to(#00adee));
+
+    background: -moz-linear-gradient(top,  #0078a5,  #00adee);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#0078a5', endColorstr='#00adee');
+
+}
+
+
+
+/* rosy */
+
+.rosy {
+
+    color: #fae7e9;
+
+    border: solid 1px #b73948;
+
+    background: #da5867;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#f16c7c), to(#bf404f));
+
+    background: -moz-linear-gradient(top,  #f16c7c,  #bf404f);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#f16c7c', endColorstr='#bf404f');
+
+}
+
+.rosy:hover {
+
+    background: #ba4b58;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#cf5d6a), to(#a53845));
+
+    background: -moz-linear-gradient(top,  #cf5d6a,  #a53845);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#cf5d6a', endColorstr='#a53845');
+
+}
+
+.rosy:active {
+
+    color: #dca4ab;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#bf404f), to(#f16c7c));
+
+    background: -moz-linear-gradient(top,  #bf404f,  #f16c7c);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#bf404f', endColorstr='#f16c7c');
+
+}
+
+
+
+/* green */
+
+.green {
+
+    color: #e8f0de;
+
+    border: solid 1px #538312;
+
+    background: #64991e;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#7db72f), to(#4e7d0e));
+
+    background: -moz-linear-gradient(top,  #7db72f,  #4e7d0e);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#7db72f', endColorstr='#4e7d0e');
+
+}
+
+.green:hover {
+
+    background: #538018;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#6b9d28), to(#436b0c));
+
+    background: -moz-linear-gradient(top,  #6b9d28,  #436b0c);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#6b9d28', endColorstr='#436b0c');
+
+}
+
+.green:active {
+
+    color: #a9c08c;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#4e7d0e), to(#7db72f));
+
+    background: -moz-linear-gradient(top,  #4e7d0e,  #7db72f);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#4e7d0e', endColorstr='#7db72f');
+
+}
+
+
+
+/* pink */
+
+.pink {
+
+    color: #feeef5;
+
+    border: solid 1px #d2729e;
+
+    background: #f895c2;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#feb1d3), to(#f171ab));
+
+    background: -moz-linear-gradient(top,  #feb1d3,  #f171ab);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#feb1d3', endColorstr='#f171ab');
+
+}
+
+.pink:hover {
+
+    background: #d57ea5;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#f4aacb), to(#e86ca4));
+
+    background: -moz-linear-gradient(top,  #f4aacb,  #e86ca4);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#f4aacb', endColorstr='#e86ca4');
+
+}
+
+.pink:active {
+
+    color: #f3c3d9;
+
+    background: -webkit-gradient(linear, left top, left bottom, from(#f171ab), to(#feb1d3));
+
+    background: -moz-linear-gradient(top,  #f171ab,  #feb1d3);
+
+    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#f171ab', endColorstr='#feb1d3');
+
+}
+
+

+ 1 - 1
system/__init__.py

@@ -58,7 +58,7 @@ def exception_catch(*args_catch, **kwargs_catch):
             except BaseException as e:
                 back = '\n[ERROR]' + traceback.format_exc().replace('\n', '\n[ERROR]')
                 logging.error(f'{e}  {func.__name__} args:{args}  kwargs:{kwargs}'.replace('\n', '\\n') + back)
-                assert not func.__name__.endswith('_gui'), str(e)
+                assert not func.__name__.endswith('_gui'), str(e)  # gui程序的错误重新丢回去
         return adorner
     return catch