Spaces:
Runtime error
Runtime error
Update templates/index.html
Browse files- templates/index.html +96 -51
templates/index.html
CHANGED
|
@@ -7,10 +7,12 @@
|
|
| 7 |
<title>File Uploader</title>
|
| 8 |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" />
|
| 9 |
<style>
|
|
|
|
| 10 |
body {
|
| 11 |
background-color: #1c1c1e;
|
| 12 |
font-family: "Poppins", sans-serif;
|
| 13 |
color: #f5f5f7;
|
|
|
|
| 14 |
}
|
| 15 |
|
| 16 |
h1 {
|
|
@@ -20,7 +22,7 @@
|
|
| 20 |
}
|
| 21 |
|
| 22 |
.container {
|
| 23 |
-
margin-top:
|
| 24 |
}
|
| 25 |
|
| 26 |
.file-upload-section {
|
|
@@ -67,7 +69,7 @@
|
|
| 67 |
|
| 68 |
.alert {
|
| 69 |
text-align: center;
|
| 70 |
-
position:
|
| 71 |
top: 0;
|
| 72 |
right: 15%;
|
| 73 |
}
|
|
@@ -94,63 +96,99 @@
|
|
| 94 |
}
|
| 95 |
}
|
| 96 |
|
| 97 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
.tab {
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
left: 10px;
|
| 102 |
}
|
| 103 |
|
| 104 |
.tab button {
|
| 105 |
-
background-color:
|
| 106 |
border: none;
|
| 107 |
-
|
| 108 |
-
margin: 0 5px;
|
| 109 |
-
color: #f5f5f7;
|
| 110 |
cursor: pointer;
|
| 111 |
-
|
| 112 |
-
transition:
|
|
|
|
|
|
|
| 113 |
}
|
| 114 |
|
| 115 |
.tab button:hover {
|
| 116 |
-
background-color: #
|
| 117 |
}
|
| 118 |
-
|
| 119 |
-
.tab button:active,
|
| 120 |
.tab button.active {
|
| 121 |
background-color: #444;
|
| 122 |
}
|
| 123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
</style>
|
| 125 |
</head>
|
| 126 |
|
| 127 |
<body>
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
|
|
|
| 131 |
<div class="tab">
|
| 132 |
-
<button class="
|
| 133 |
-
<button class="
|
| 134 |
</div>
|
|
|
|
| 135 |
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
<
|
| 150 |
-
</
|
| 151 |
-
|
| 152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
</div>
|
|
|
|
| 154 |
|
| 155 |
<div class="container">
|
| 156 |
<!-- Loader -->
|
|
@@ -164,12 +202,12 @@
|
|
| 164 |
{% endif %} {% endwith %}
|
| 165 |
</div>
|
| 166 |
|
| 167 |
-
|
| 168 |
<script>
|
| 169 |
-
// Loader functionality
|
| 170 |
-
document.getElementById('
|
| 171 |
document.getElementById('loader').style.display = 'block';
|
| 172 |
-
};
|
| 173 |
|
| 174 |
// Flash message auto-hide
|
| 175 |
setTimeout(function () {
|
|
@@ -181,16 +219,23 @@
|
|
| 181 |
}
|
| 182 |
}, 3000);
|
| 183 |
|
| 184 |
-
//
|
| 185 |
-
function
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
}
|
|
|
|
|
|
|
|
|
|
| 194 |
</script>
|
| 195 |
</body>
|
| 196 |
|
|
|
|
| 7 |
<title>File Uploader</title>
|
| 8 |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" />
|
| 9 |
<style>
|
| 10 |
+
<style>
|
| 11 |
body {
|
| 12 |
background-color: #1c1c1e;
|
| 13 |
font-family: "Poppins", sans-serif;
|
| 14 |
color: #f5f5f7;
|
| 15 |
+
margin: 0;
|
| 16 |
}
|
| 17 |
|
| 18 |
h1 {
|
|
|
|
| 22 |
}
|
| 23 |
|
| 24 |
.container {
|
| 25 |
+
margin-top: 70px;
|
| 26 |
}
|
| 27 |
|
| 28 |
.file-upload-section {
|
|
|
|
| 69 |
|
| 70 |
.alert {
|
| 71 |
text-align: center;
|
| 72 |
+
position: sticky;
|
| 73 |
top: 0;
|
| 74 |
right: 15%;
|
| 75 |
}
|
|
|
|
| 96 |
}
|
| 97 |
}
|
| 98 |
|
| 99 |
+
/* Top bar styles */
|
| 100 |
+
.top-bar {
|
| 101 |
+
background-color: #333;
|
| 102 |
+
position: fixed;
|
| 103 |
+
top: 0;
|
| 104 |
+
width: 100%;
|
| 105 |
+
z-index: 1000;
|
| 106 |
+
padding: 10px 20px;
|
| 107 |
+
display: flex;
|
| 108 |
+
justify-content: space-between;
|
| 109 |
+
align-items: center;
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
.top-bar h2 {
|
| 113 |
+
color: white;
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
/* Navigation tab styles */
|
| 117 |
.tab {
|
| 118 |
+
display: flex;
|
| 119 |
+
gap: 10px;
|
|
|
|
| 120 |
}
|
| 121 |
|
| 122 |
.tab button {
|
| 123 |
+
background-color: inherit;
|
| 124 |
border: none;
|
| 125 |
+
outline: none;
|
|
|
|
|
|
|
| 126 |
cursor: pointer;
|
| 127 |
+
padding: 10px 16px;
|
| 128 |
+
transition: 0.3s;
|
| 129 |
+
font-size: 17px;
|
| 130 |
+
color: white;
|
| 131 |
}
|
| 132 |
|
| 133 |
.tab button:hover {
|
| 134 |
+
background-color: #575757;
|
| 135 |
}
|
| 136 |
+
|
|
|
|
| 137 |
.tab button.active {
|
| 138 |
background-color: #444;
|
| 139 |
}
|
| 140 |
+
|
| 141 |
+
/* Tab content styles */
|
| 142 |
+
.tabcontent {
|
| 143 |
+
display: none;
|
| 144 |
+
padding: 20px;
|
| 145 |
+
margin-top: 70px;
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
/* Responsive design */
|
| 149 |
+
@media (max-width: 768px) {
|
| 150 |
+
.tab {
|
| 151 |
+
flex-direction: column;
|
| 152 |
+
}
|
| 153 |
+
}
|
| 154 |
</style>
|
| 155 |
</head>
|
| 156 |
|
| 157 |
<body>
|
| 158 |
+
<!-- Locked Top Bar with Tabs -->
|
| 159 |
+
<div class="top-bar">
|
| 160 |
+
<h2>Capture AI</h2>
|
| 161 |
+
<!-- Navigation Tabs -->
|
| 162 |
<div class="tab">
|
| 163 |
+
<button class="tablink" onclick="openPage('ImageExtractor', this, '#ff4d00')" id="defaultOpen">Visiting Card Data Extractor</button>
|
| 164 |
+
<button class="tablink" onclick="openPage('ResumeParserExtractor', this, '#ff4d00')">Resume Data Extractor</button>
|
| 165 |
</div>
|
| 166 |
+
</div>
|
| 167 |
|
| 168 |
+
<!-- Tab Content for Image Extractor -->
|
| 169 |
+
<div id="ImageExtractor" class="tabcontent">
|
| 170 |
+
<div class="container">
|
| 171 |
+
<h1>Visiting Card Data Extractor</h1>
|
| 172 |
+
<div class="file-upload-section">
|
| 173 |
+
<form id="fileUploadFormImageExtractor" action="{{ url_for('upload_file') }}" method="POST" enctype="multipart/form-data">
|
| 174 |
+
<input type="file" name="files" multiple class="form-control" required />
|
| 175 |
+
<input type="submit" value="Upload your Images" class="btn btn-outline-primary" />
|
| 176 |
+
</form>
|
| 177 |
+
|
| 178 |
+
{% if session.get('uploaded_files') %}
|
| 179 |
+
<p class="mt-4">
|
| 180 |
+
Uploaded:
|
| 181 |
+
<span class="text-danger">{{ session.get('uploaded_files') }}</span>
|
| 182 |
+
</p>
|
| 183 |
+
<form action="{{ url_for('remove_file') }}" method="post">
|
| 184 |
+
<button type="submit" class="btn btn-outline-danger">
|
| 185 |
+
<i class="bi bi-trash"></i> Remove Uploaded File
|
| 186 |
+
</button>
|
| 187 |
+
</form>
|
| 188 |
+
{% endif %}
|
| 189 |
+
</div>
|
| 190 |
</div>
|
| 191 |
+
</div>
|
| 192 |
|
| 193 |
<div class="container">
|
| 194 |
<!-- Loader -->
|
|
|
|
| 202 |
{% endif %} {% endwith %}
|
| 203 |
</div>
|
| 204 |
|
| 205 |
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
|
| 206 |
<script>
|
| 207 |
+
// Loader functionality for both forms
|
| 208 |
+
document.getElementById('fileUploadFormImageExtractor').onsubmit = function () {
|
| 209 |
document.getElementById('loader').style.display = 'block';
|
| 210 |
+
};
|
| 211 |
|
| 212 |
// Flash message auto-hide
|
| 213 |
setTimeout(function () {
|
|
|
|
| 219 |
}
|
| 220 |
}, 3000);
|
| 221 |
|
| 222 |
+
// Tab functionality
|
| 223 |
+
function openPage(pageName, elmnt, color) {
|
| 224 |
+
var i, tabcontent, tablinks;
|
| 225 |
+
tabcontent = document.getElementsByClassName("tabcontent");
|
| 226 |
+
for (i = 0; i < tabcontent.length; i++) {
|
| 227 |
+
tabcontent[i].style.display = "none";
|
| 228 |
+
}
|
| 229 |
+
tablinks = document.getElementsByClassName("tablink");
|
| 230 |
+
for (i = 0; i < tablinks.length; i++) {
|
| 231 |
+
tablinks[i].style.backgroundColor = "";
|
| 232 |
+
}
|
| 233 |
+
document.getElementById(pageName).style.display = "block";
|
| 234 |
+
elmnt.style.backgroundColor = color;
|
| 235 |
}
|
| 236 |
+
|
| 237 |
+
// Set default tab
|
| 238 |
+
document.getElementById("defaultOpen").click();
|
| 239 |
</script>
|
| 240 |
</body>
|
| 241 |
|