File size: 5,426 Bytes
ec9b21e
 
 
 
 
 
c876d97
b68a64d
ec9b21e
 
 
 
 
 
 
c876d97
 
ec9b21e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b611352
ec9b21e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c876d97
ec9b21e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c876d97
ec9b21e
 
 
b611352
 
 
 
 
 
a5fbd1a
 
eaa8d81
347f4ed
 
 
 
 
 
 
 
ec9b21e
347f4ed
 
 
 
 
 
 
 
 
b68a64d
ec9b21e
 
 
 
b68a64d
ec9b21e
 
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Screenshot to HTML - Control Panel</title>
    <link href="https://cdn.tailwindcss.com" rel="stylesheet">
    <link rel="stylesheet" href="/static/style.css">
</head>
<body class="ssth_container">
    <div class="container mx-auto p-6">
        <h1 class="ssth_title">Screenshot to HTML Control Panel</h1>

        <!-- Tabs -->
        <div class="ssth_tab_container">
            <button class="ssth_tab_button active" data-tab="url">URL to Files</button>
            <button class="ssth_tab_button" data-tab="image">Image Upload</button>
        </div>

        <!-- URL Tab Content -->
        <div id="url" class="tab-content active">
            <form id="url-form" class="ssth_form_card">
                <div class="mb-4">
                    <label class="ssth_form_label" for="url">Webpage URL</label>
                    <input type="text" id="url" name="url" class="ssth_form_input" placeholder="Enter URL here..." required>
                </div>
                <div class="grid grid-cols-2 gap-4 mb-4">
                    <div>
                        <label class="ssth_form_label" for="max_height">Max Height (pixels)</label>
                        <input type="number" id="max_height" name="max_height" min="100" max="2000" value="1000" class="ssth_form_input">
                    </div>
                    <div>
                        <label class="ssth_form_label" for="timeout">Timeout (ms)</label>
                        <input type="number" id="timeout" name="timeout" min="1000" max="60000" step="1000" value="30000" class="ssth_form_input">
                    </div>
                </div>
                <div class="mb-4">
                    <label class="ssth_form_label">Image Format</label>
                    <div class="ssth_form_radio_group">
                        <label class="ssth_form_radio_label"><input type="radio" name="image_format" value="PNG" checked>PNG</label>
                        <label class="ssth_form_radio_label"><input type="radio" name="image_format" value="JPEG">JPEG</label>
                    </div>
                </div>
                <div class="mb-4">
                    <label class="ssth_form_label" for="model">Gemini Model</label>
                    <select id="model" name="model_name" class="ssth_form_select">
                        {% for model in models %}
                            <option value="{{ model }}" {% if model == default_model %}selected{% endif %}>{{ model }}</option>
                        {% endfor %}
                    </select>
                </div>
                <button type="button" class="ssth_form_submit_button" id="url-submit">Extract Files from URL</button>
            </form>
        </div>

        <!-- Image Tab Content -->
        <div id="image" class="tab-content">
            <form id="image-form" enctype="multipart/form-data" class="ssth_form_card">
                <div class="mb-4">
                    <label class="ssth_form_label" for="image">Upload Screenshot</label>
                    <input type="file" id="image" name="image" accept="image/*" class="ssth_form_input" required>
                </div>
                <div class="mb-4">
                    <label class="ssth_form_label" for="model_upload">Gemini Model</label>
                    <select id="model_upload" name="model_name" class="ssth_form_select">
                        {% for model in models %}
                            <option value="{{ model }}" {% if model == default_model %}selected{% endif %}>{{ model }}</option>
                        {% endfor %}
                    </select>
                </div>
                <button type="button" class="ssth_form_submit_button" id="image-submit">Extract Files from Image</button>
            </form>
        </div>

        <!-- Status Messages and Progress Bar -->
        <div id="status-area" class="ssth_status_area">
            <div id="status-messages" class="ssth_status_messages"></div>
            <div id="progress-bar-container" class="ssth_progress_bar_container">
                <div id="progress-bar" class="ssth_progress_bar"></div>
            </div>
        </div>

        <!-- Results Layout -->
        <div class="ssth_results_layout">
            <div class="ssth_preview_area">
                <div class="ssth_website_preview_section">
                    <h2 class="ssth_section_title">Website Preview</h2>
                    <div id="preview" class="ssth_preview_container">
                        <iframe id="preview-iframe" style="width: 100%; height: 100%; border: none;"></iframe>
                    </div>
                </div>
            </div>

            <div class="ssth_code_area">
                <div class="ssth_files_section">
                    <h2 class="ssth_section_title">Generated Files</h2>
                    <div id="files" class="space-y-4"></div>
                </div>
                <div class="ssth_combined_code_section">
                    <h2 class="ssth_section_title">Combined HTML (All Code in One File)</h2>
                    <div class="ssth_combined_code_container" id="combined-code"></div>
                </div>
            </div>
        </div>
    </div>

    <script src="/static/script.js"></script>
</body>
</html>