File size: 1,677 Bytes
633bb91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

class HtmlTemplates:
    """Central place for raw HTML, CSS content."""

    @staticmethod
    def error_bar():
        return """
        <div style='border: 1px solid orange; width: 100%; padding: 8px; color: orange; text-align: center; border-radius: 5px;'>
            ⚠️ No file selected. Please select a file to upload.
        </div>
        """

    @staticmethod
    def progress_bar(percent: int, current: int, total: int):
        return f"""
        <div style='border: 1px solid #ccc; width: 100%; height: 20px; position: relative; border-radius: 5px; overflow: hidden;'>
            <div style='background-color: #4caf50; width: {percent}%; height: 100%; transition: width 0.5s;'></div>
        </div>
        <p style='text-align: center;'>Uploaded {current} / {total} files ({percent}%)</p>
        """

    @staticmethod
    def css():
        return """
            #title {
                margin-top: 8px;
                text-align: center;
                background-color: #2596be; /* blue */
                color: white;
                padding: 12px 20px;
                border-radius: 6px;
                font-weight: bold;
                font-size: 24px;
            }


            #upload-btn {
                background-color: #e28743;      /* orange */
                color: white;                   /* Text color */
                border-radius: 6px;             /* Rounded corners */
                padding: 10px 16px;
                font-weight: bold;
                font-size: 18px;
            }

            #upload-btn:hover {
                background-color: #cb7a3c;      /* Darker on hover */
            }
        """