File size: 1,536 Bytes
66dbebd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
52
53
# mobile_components.py
import gradio as gr

class MobileComponents:
    """
    Mobile-specific UI components and utilities
    """
    
    @staticmethod
    def create_touch_friendly_button(text, icon=None, variant="secondary", size="sm"):
        return gr.Button(
            value=f"{icon} {text}" if icon else text,
            variant=variant,
            size=size,
            min_width=44,
            min_height=44
        )
    
    @staticmethod
    def create_mobile_textarea(placeholder, max_lines=3, **kwargs):
        return gr.Textbox(
            placeholder=placeholder,
            max_lines=max_lines,
            show_label=False,
            container=False,
            **kwargs
        )
    
    @staticmethod
    def mobile_loading_indicator():
        return gr.HTML("""
        <div class="loading-indicator">
            <div style="display: flex; align-items: center; gap: 10px;">
                <div class="spinner" style="
                    width: 20px;
                    height: 20px;
                    border: 2px solid #f3f3f3;
                    border-top: 2px solid #3498db;
                    border-radius: 50%;
                    animation: spin 1s linear infinite;
                "></div>
                <span>Processing...</span>
            </div>
            <style>
                @keyframes spin {
                    0% { transform: rotate(0deg); }
                    100% { transform: rotate(360deg); }
                }
            </style>
        </div>
        """)