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="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>FastAPI App</title>
|
| 7 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/katex.min.css">
|
| 8 |
+
<link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@100&display=swap" rel="stylesheet">
|
| 9 |
+
<style>
|
| 10 |
+
html, body {
|
| 11 |
+
margin: 0;
|
| 12 |
+
padding: 0;
|
| 13 |
+
box-sizing: border-box;
|
| 14 |
+
overflow-x: hidden !important;
|
| 15 |
+
}
|
| 16 |
+
body {
|
| 17 |
+
background-color: #000000;
|
| 18 |
+
margin: 0;
|
| 19 |
+
}
|
| 20 |
+
#cont {
|
| 21 |
+
border: 2px solid blue;
|
| 22 |
+
width: 265px;
|
| 23 |
+
height: 50px;
|
| 24 |
+
display: flex;
|
| 25 |
+
flex-direction: column;
|
| 26 |
+
overflow-y: scroll;
|
| 27 |
+
margin: auto;
|
| 28 |
+
margin-top: 30px;
|
| 29 |
+
padding-bottom: 7px;
|
| 30 |
+
gap: 14px;
|
| 31 |
+
background: linear-gradient(black , black) padding-box,
|
| 32 |
+
linear-gradient(to right, red, blue) border-box;
|
| 33 |
+
border-radius: 20px;
|
| 34 |
+
border: 2.5px solid transparent;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
#prompt {
|
| 38 |
+
flex-grow: 1;
|
| 39 |
+
padding: 10px;
|
| 40 |
+
margin: 10px;
|
| 41 |
+
background: transparent;
|
| 42 |
+
border: none;
|
| 43 |
+
border-radius: 8px;
|
| 44 |
+
box-shadow: linear-gradient(145deg, rgb(0, 249, 153), #ff002b);
|
| 45 |
+
color: #fff;
|
| 46 |
+
outline: none;
|
| 47 |
+
}
|
| 48 |
+
#generatePrompts {
|
| 49 |
+
background-image: linear-gradient(
|
| 50 |
+
45deg,
|
| 51 |
+
hsl(240deg 75% 29%) 0%,
|
| 52 |
+
hsl(254deg 78% 28%) 6%,
|
| 53 |
+
hsl(264deg 82% 27%) 13%,
|
| 54 |
+
hsl(272deg 87% 26%) 19%,
|
| 55 |
+
hsl(278deg 93% 25%) 25%,
|
| 56 |
+
hsl(284deg 98% 24%) 31%,
|
| 57 |
+
hsl(289deg 100% 23%) 37%,
|
| 58 |
+
hsl(294deg 100% 23%) 44%,
|
| 59 |
+
hsl(299deg 100% 22%) 50%,
|
| 60 |
+
hsl(303deg 100% 23%) 56%,
|
| 61 |
+
hsl(307deg 100% 24%) 63%,
|
| 62 |
+
hsl(311deg 100% 25%) 69%,
|
| 63 |
+
hsl(313deg 100% 26%) 75%,
|
| 64 |
+
hsl(316deg 95% 28%) 81%,
|
| 65 |
+
hsl(320deg 88% 30%) 87%,
|
| 66 |
+
hsl(323deg 81% 32%) 94%,
|
| 67 |
+
hsl(326deg 75% 33%) 100%
|
| 68 |
+
);
|
| 69 |
+
border: none;
|
| 70 |
+
color: white;
|
| 71 |
+
padding: 10px 20px;
|
| 72 |
+
text-align: center;
|
| 73 |
+
text-decoration: none;
|
| 74 |
+
display: inline-block;
|
| 75 |
+
font-size: 16px;
|
| 76 |
+
margin-top: 10px;
|
| 77 |
+
cursor: pointer;
|
| 78 |
+
border-radius: 5px;
|
| 79 |
+
display: block;
|
| 80 |
+
margin: 0 auto;
|
| 81 |
+
width: 200px;
|
| 82 |
+
}
|
| 83 |
+
#generatePrompts:hover {
|
| 84 |
+
/* Hover effect for the button */
|
| 85 |
+
|
| 86 |
+
background-color: #45a049;
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
.container {
|
| 90 |
+
text-align: center;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
h1 {
|
| 94 |
+
text-align: center;
|
| 95 |
+
margin-bottom: 20px;
|
| 96 |
+
font-family: 'Barlow Condensed';
|
| 97 |
+
color: pink;
|
| 98 |
+
font-size: 40px; /* Adjust the font size as needed */
|
| 99 |
+
}
|
| 100 |
+
#inputs {
|
| 101 |
+
flex-grow: 1;
|
| 102 |
+
padding: 10px;
|
| 103 |
+
margin: 10px;
|
| 104 |
+
background: transparent;
|
| 105 |
+
border: none;
|
| 106 |
+
border-radius: 8px;
|
| 107 |
+
box-shadow: linear-gradient(145deg, rgb(0, 249, 153), #ff002b);
|
| 108 |
+
color: #fff;
|
| 109 |
+
outline: none;
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
.image-container {
|
| 114 |
+
display: flex;
|
| 115 |
+
justify-content: center;
|
| 116 |
+
align-items: center;
|
| 117 |
+
flex-wrap: wrap;
|
| 118 |
+
gap: 10px;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
.image-box {
|
| 122 |
+
width: 100px; /* Adjust the width as needed */
|
| 123 |
+
height: 200px; /* Adjust the height as needed */
|
| 124 |
+
border: 2px solid #ffffff; /* Set the border color to white */
|
| 125 |
+
border-radius: 10px;
|
| 126 |
+
overflow: hidden; /* Ensure the image does not overflow the box */
|
| 127 |
+
position: relative; /* Positioning context for absolute positioning of image */
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
.spinner {
|
| 131 |
+
border: 3px solid rgba(255, 255, 255, 0.3);
|
| 132 |
+
border-radius: 50%;
|
| 133 |
+
border-top: 3px solid #ffffff;
|
| 134 |
+
width: 20px;
|
| 135 |
+
height: 20px;
|
| 136 |
+
animation: spin 2s linear infinite;
|
| 137 |
+
position: absolute;
|
| 138 |
+
top: 50%;
|
| 139 |
+
left: 50%;
|
| 140 |
+
transform: translate(-50%, -50%);
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
@keyframes spin {
|
| 144 |
+
0% { transform: rotate(0deg); }
|
| 145 |
+
100% { transform: rotate(360deg); }
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
.image-box img {
|
| 149 |
+
position: absolute;
|
| 150 |
+
top: 0;
|
| 151 |
+
left: 0;
|
| 152 |
+
width: 100%;
|
| 153 |
+
height: 100%;
|
| 154 |
+
object-fit: cover; /* Maintain aspect ratio and cover the entire box */
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
|
| 158 |
+
|
| 159 |
+
#noise_level {
|
| 160 |
+
flex-grow: 1;
|
| 161 |
+
padding: 10px;
|
| 162 |
+
margin: 10px;
|
| 163 |
+
background: transparent;
|
| 164 |
+
border: none;
|
| 165 |
+
border-radius: 8px;
|
| 166 |
+
box-shadow: linear-gradient(145deg, rgb(0, 249, 153), #ff002b);
|
| 167 |
+
color: #fff;
|
| 168 |
+
outline: none;
|
| 169 |
+
}
|
| 170 |
+
#image-box {
|
| 171 |
+
border: 2px solid blue;
|
| 172 |
+
width: 265px;
|
| 173 |
+
height: 300px;
|
| 174 |
+
display: flex;
|
| 175 |
+
flex-direction: column;
|
| 176 |
+
overflow-y: scroll;
|
| 177 |
+
margin: auto;
|
| 178 |
+
margin-top: 30px;
|
| 179 |
+
padding-bottom: 7px;
|
| 180 |
+
gap: 14px;
|
| 181 |
+
background: linear-gradient(black, black) padding-box,
|
| 182 |
+
linear-gradient(to right, red, blue) border-box;
|
| 183 |
+
border-radius: 20px;
|
| 184 |
+
border: 2.5px solid transparent;
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
#image-box p {
|
| 188 |
+
|
| 189 |
+
font-size: 20px;
|
| 190 |
+
color: white;
|
| 191 |
+
text-align :center ;
|
| 192 |
+
}
|
| 193 |
+
#showadv {
|
| 194 |
+
padding: 10px 20px;
|
| 195 |
+
/* Auto margin for centering horizontally */
|
| 196 |
+
background-image: linear-gradient(
|
| 197 |
+
45deg,
|
| 198 |
+
hsl(240deg 75% 29%) 0%,
|
| 199 |
+
hsl(254deg 78% 28%) 6%,
|
| 200 |
+
hsl(264deg 82% 27%) 13%,
|
| 201 |
+
hsl(272deg 87% 26%) 19%,
|
| 202 |
+
hsl(278deg 93% 25%) 25%,
|
| 203 |
+
hsl(284deg 98% 24%) 31%,
|
| 204 |
+
hsl(289deg 100% 23%) 37%,
|
| 205 |
+
hsl(294deg 100% 23%) 44%,
|
| 206 |
+
hsl(299deg 100% 22%) 50%,
|
| 207 |
+
hsl(303deg 100% 23%) 56%,
|
| 208 |
+
hsl(307deg 100% 24%) 63%,
|
| 209 |
+
hsl(311deg 100% 25%) 69%,
|
| 210 |
+
hsl(313deg 100% 26%) 75%,
|
| 211 |
+
hsl(316deg 95% 28%) 81%,
|
| 212 |
+
hsl(320deg 88% 30%) 87%,
|
| 213 |
+
hsl(323deg 81% 32%) 94%,
|
| 214 |
+
hsl(326deg 75% 33%) 100%
|
| 215 |
+
);
|
| 216 |
+
border: none;
|
| 217 |
+
border-radius: 8px;
|
| 218 |
+
cursor: pointer;
|
| 219 |
+
color: #fff;
|
| 220 |
+
text-align: center;
|
| 221 |
+
display: inline-block;
|
| 222 |
+
margin: 0 auto;
|
| 223 |
+
width: 200px;
|
| 224 |
+
border: none;
|
| 225 |
+
color: white;
|
| 226 |
+
padding: 10px 20px;
|
| 227 |
+
text-align: center;
|
| 228 |
+
text-decoration: none;
|
| 229 |
+
display: inline-block;
|
| 230 |
+
font-size: 16px;
|
| 231 |
+
margin-top: 10px;
|
| 232 |
+
cursor: pointer;
|
| 233 |
+
border-radius: 5px;
|
| 234 |
+
display: block;
|
| 235 |
+
margin: 0 auto;
|
| 236 |
+
width: 200px;
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
#advanced-options {
|
| 240 |
+
flex-grow: 1;
|
| 241 |
+
padding: 10px;
|
| 242 |
+
margin: 10px;
|
| 243 |
+
background: transparent;
|
| 244 |
+
border: none;
|
| 245 |
+
border-radius: 8px;
|
| 246 |
+
box-shadow: linear-gradient(145deg, rgb(0, 249, 153), #ff002b);
|
| 247 |
+
color: #fff;
|
| 248 |
+
outline: none;
|
| 249 |
+
background-color: #030303;
|
| 250 |
+
padding: 0px;
|
| 251 |
+
border-radius: 12px;
|
| 252 |
+
box-shadow: 8px 8px 16px #050505, -8px -8px 16px #080808;
|
| 253 |
+
display: none;
|
| 254 |
+
align-items: center;
|
| 255 |
+
border: 2px solid rgb(247, 6, 187);
|
| 256 |
+
text-align :center ;
|
| 257 |
+
}
|
| 258 |
+
#advanced-options label, #advanced-options input {
|
| 259 |
+
margin: 10px;
|
| 260 |
+
color: #fff;
|
| 261 |
+
}
|
| 262 |
+
#advanced-options input[type="number"] {
|
| 263 |
+
width: 50px;
|
| 264 |
+
padding: 5px;
|
| 265 |
+
|
| 266 |
+
}
|
| 267 |
+
#advanced-options button {
|
| 268 |
+
padding: 10px 20px;
|
| 269 |
+
/* Auto margin for centering horizontally */
|
| 270 |
+
background-image: linear-gradient(
|
| 271 |
+
45deg,
|
| 272 |
+
hsl(240deg 75% 29%) 0%,
|
| 273 |
+
hsl(254deg 78% 28%) 6%,
|
| 274 |
+
hsl(264deg 82% 27%) 13%,
|
| 275 |
+
hsl(272deg 87% 26%) 19%,
|
| 276 |
+
hsl(278deg 93% 25%) 25%,
|
| 277 |
+
hsl(284deg 98% 24%) 31%,
|
| 278 |
+
hsl(289deg 100% 23%) 37%,
|
| 279 |
+
hsl(294deg 100% 23%) 44%,
|
| 280 |
+
hsl(299deg 100% 22%) 50%,
|
| 281 |
+
hsl(303deg 100% 23%) 56%,
|
| 282 |
+
hsl(307deg 100% 24%) 63%,
|
| 283 |
+
hsl(311deg 100% 25%) 69%,
|
| 284 |
+
hsl(313deg 100% 26%) 75%,
|
| 285 |
+
hsl(316deg 95% 28%) 81%,
|
| 286 |
+
hsl(320deg 88% 30%) 87%,
|
| 287 |
+
hsl(323deg 81% 32%) 94%,
|
| 288 |
+
hsl(326deg 75% 33%) 100%
|
| 289 |
+
);
|
| 290 |
+
border: none;
|
| 291 |
+
border-radius: 8px;
|
| 292 |
+
cursor: pointer;
|
| 293 |
+
color: #fff;
|
| 294 |
+
text-align: center;
|
| 295 |
+
display: inline-block;
|
| 296 |
+
margin: 0 auto;
|
| 297 |
+
width: 50px;
|
| 298 |
+
border: none;
|
| 299 |
+
color: white;
|
| 300 |
+
padding: 10px 20px;
|
| 301 |
+
text-align: center;
|
| 302 |
+
text-decoration: none;
|
| 303 |
+
display: inline-block;
|
| 304 |
+
font-size: 16px;
|
| 305 |
+
margin-top: 10px;
|
| 306 |
+
cursor: pointer;
|
| 307 |
+
border-radius: 5px;
|
| 308 |
+
display: block;
|
| 309 |
+
margin: 0 auto;
|
| 310 |
+
width: 200px;
|
| 311 |
+
|
| 312 |
+
}
|
| 313 |
+
#advanced-options button:hover {
|
| 314 |
+
background: linear-gradient(145deg, #00ffab, #4e00f9, rgb(255, 0, 43));
|
| 315 |
+
}
|
| 316 |
+
|
| 317 |
+
|
| 318 |
+
</style>
|
| 319 |
+
</head>
|
| 320 |
+
<body>
|
| 321 |
+
<div class="container">
|
| 322 |
+
<h1>Aiconvert.online </h1>
|
| 323 |
+
|
| 324 |
+
<div id="cont">
|
| 325 |
+
|
| 326 |
+
|
| 327 |
+
<input type="text" id="prompt" name="prompt"placeholder="Enter Text Idea">
|
| 328 |
+
|
| 329 |
+
<br>
|
| 330 |
+
|
| 331 |
+
</div>
|
| 332 |
+
<div>
|
| 333 |
+
<button id="generatePrompts" onclick="generatePrompts()">Generate Prompts</button>
|
| 334 |
+
|
| 335 |
+
</div>
|
| 336 |
+
<br>
|
| 337 |
+
<div id="cont" style="position: relative;">
|
| 338 |
+
<div>
|
| 339 |
+
<div id="promptSpinner" class="spinner" style="display: none;"></div>
|
| 340 |
+
|
| 341 |
+
<input type="text" id="inputs" name="inputs" placeholder="Enter prompt" >
|
| 342 |
+
</div>
|
| 343 |
+
|
| 344 |
+
|
| 345 |
+
|
| 346 |
+
<br>
|
| 347 |
+
|
| 348 |
+
</div>
|
| 349 |
+
<br>
|
| 350 |
+
<button id="showadv" onclick="toggleAdvancedOptions()">Advanced Options</button>
|
| 351 |
+
<div id="advanced-options">
|
| 352 |
+
<label for="is_negative">Negative prompt :</label>
|
| 353 |
+
<input type="text" id="is_negative" name="is_negative" value="blurry, fuzziness">
|
| 354 |
+
<br>
|
| 355 |
+
<label for="steps">Steps:</label>
|
| 356 |
+
<input type="range" id="steps" name="steps" min="30" max="100" value="50">
|
| 357 |
+
<span id="steps-value">50</span>
|
| 358 |
+
<br>
|
| 359 |
+
<label for="cfg_scale">Guidance Scale:</label>
|
| 360 |
+
<input type="range" id="cfg_scale" name="cfg_scale" min="5" max="14" value="7.5" step="1">
|
| 361 |
+
<span id="cfg-scale-value">7.5</span>
|
| 362 |
+
<br>
|
| 363 |
+
<label for="seed">Seed:</label>
|
| 364 |
+
<input type="range" id="seed" name="seed" min="1" max="99999" value="0" step="1">
|
| 365 |
+
<span id="seed-value">0</span>
|
| 366 |
+
<br>
|
| 367 |
+
<label for="noise_level">Noise Level:</label>
|
| 368 |
+
<input type="range" id="noise_level" name="noise_level" min="0" max="10" step="1" value="0">
|
| 369 |
+
<span id="noise-level-value">0</span>
|
| 370 |
+
|
| 371 |
+
<br>
|
| 372 |
+
<button onclick="toggleAdvancedOptions()">Hide </button>
|
| 373 |
+
</div>
|
| 374 |
+
<br>
|
| 375 |
+
<div>
|
| 376 |
+
<button id ="generatePrompts" onclick="sendInputs()">generate image </button>
|
| 377 |
+
|
| 378 |
+
</div>
|
| 379 |
+
<div id="output-container" class="image-container">
|
| 380 |
+
<div id="image-box" class="image-box">
|
| 381 |
+
<p>Your Generated Image Will Appear Here</p>
|
| 382 |
+
<div id="sendSpinner" class="spinner" style="display: none;"></div>
|
| 383 |
+
</div>
|
| 384 |
+
</div>
|
| 385 |
+
</div>
|
| 386 |
+
|
| 387 |
+
<script>
|
| 388 |
+
function showSpinner(spinnerId) {
|
| 389 |
+
document.getElementById(spinnerId).style.display = 'block';
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
function hideSpinner(spinnerId) {
|
| 393 |
+
document.getElementById(spinnerId).style.display = 'none';
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
function generatePrompts() {
|
| 397 |
+
showSpinner('promptSpinner');
|
| 398 |
+
const prompt = document.getElementById("prompt").value;
|
| 399 |
+
fetch(`/generate_prompts?prompt_text=${encodeURIComponent(prompt)}`)
|
| 400 |
+
.then(response => response.text())
|
| 401 |
+
.then(data => {
|
| 402 |
+
document.getElementById("inputs").value = data.trim();
|
| 403 |
+
hideSpinner('promptSpinner');
|
| 404 |
+
})
|
| 405 |
+
.catch(error => {
|
| 406 |
+
console.error('Error:', error);
|
| 407 |
+
hideSpinner('promptSpinner');
|
| 408 |
+
});
|
| 409 |
+
}
|
| 410 |
+
|
| 411 |
+
function sendInputs() {
|
| 412 |
+
const inputs = document.getElementById("inputs").value;
|
| 413 |
+
if (!inputs) {
|
| 414 |
+
const imageBox = document.getElementById("image-box");
|
| 415 |
+
imageBox.innerHTML = "<p>Please enter prompt before sending.</p>";
|
| 416 |
+
return;
|
| 417 |
+
}
|
| 418 |
+
|
| 419 |
+
showSpinner('sendSpinner');
|
| 420 |
+
const noiseLevel = document.getElementById("noise_level").value;
|
| 421 |
+
const isNegative = document.getElementById("is_negative").value;
|
| 422 |
+
const steps = document.getElementById("steps").value;
|
| 423 |
+
const cfgScale = document.getElementById("cfg_scale").value;
|
| 424 |
+
const seed = document.getElementById("seed").value;
|
| 425 |
+
fetch(`/send_inputs?inputs=${encodeURIComponent(inputs)}&noise_level=${noiseLevel}&is_negative=${isNegative}&steps=${steps}&cfg_scale=${cfgScale}&seed=${seed}`)
|
| 426 |
+
.then(response => {
|
| 427 |
+
if (!response.ok) {
|
| 428 |
+
throw new Error('Network response was not ok');
|
| 429 |
+
}
|
| 430 |
+
return response.json();
|
| 431 |
+
})
|
| 432 |
+
.then(data => {
|
| 433 |
+
const imageBox = document.getElementById("image-box");
|
| 434 |
+
const img = new Image();
|
| 435 |
+
img.src = 'data:image/jpeg;base64,' + data.image_base64;
|
| 436 |
+
const maxWidth = 200;
|
| 437 |
+
const maxHeight = 200;
|
| 438 |
+
if (img.width > maxWidth || img.height > maxHeight) {
|
| 439 |
+
const ratio = Math.min(maxWidth / img.width, maxHeight / img.height);
|
| 440 |
+
img.width *= ratio;
|
| 441 |
+
img.height *= ratio;
|
| 442 |
+
}
|
| 443 |
+
imageBox.appendChild(img);
|
| 444 |
+
hideSpinner('sendSpinner');
|
| 445 |
+
})
|
| 446 |
+
.catch(error => {
|
| 447 |
+
console.error('Error:', error);
|
| 448 |
+
const imageBox = document.getElementById("image-box");
|
| 449 |
+
imageBox.innerHTML = "<p>An error occurred. Please try again later.</p>";
|
| 450 |
+
hideSpinner('sendSpinner');
|
| 451 |
+
});
|
| 452 |
+
}
|
| 453 |
+
|
| 454 |
+
function toggleAdvancedOptions() {
|
| 455 |
+
const advancedOptions = document.getElementById("advanced-options");
|
| 456 |
+
if (advancedOptions.style.display === "none") {
|
| 457 |
+
advancedOptions.style.display = "block";
|
| 458 |
+
} else {
|
| 459 |
+
advancedOptions.style.display = "none";
|
| 460 |
+
}
|
| 461 |
+
}
|
| 462 |
+
|
| 463 |
+
// Function to update slider value display
|
| 464 |
+
function updateSliderValue(sliderId, spanId) {
|
| 465 |
+
const slider = document.getElementById(sliderId);
|
| 466 |
+
const span = document.getElementById(spanId);
|
| 467 |
+
span.textContent = slider.value;
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
+
// Event listeners to update slider values
|
| 471 |
+
document.getElementById("steps").addEventListener("input", () => {
|
| 472 |
+
updateSliderValue("steps", "steps-value");
|
| 473 |
+
});
|
| 474 |
+
|
| 475 |
+
document.getElementById("cfg_scale").addEventListener("input", () => {
|
| 476 |
+
updateSliderValue("cfg_scale", "cfg-scale-value");
|
| 477 |
+
});
|
| 478 |
+
|
| 479 |
+
document.getElementById("seed").addEventListener("input", () => {
|
| 480 |
+
updateSliderValue("seed", "seed-value");
|
| 481 |
+
});
|
| 482 |
+
|
| 483 |
+
document.getElementById("noise_level").addEventListener("input", () => {
|
| 484 |
+
updateSliderValue("noise_level", "noise-level-value");
|
| 485 |
+
});
|
| 486 |
+
|
| 487 |
+
|
| 488 |
+
|
| 489 |
+
</script>
|
| 490 |
+
</body>
|
| 491 |
+
</html>
|