Spaces:
Running
on
Zero
Running
on
Zero
footer
Browse files
app.py
CHANGED
|
@@ -358,4 +358,53 @@ if __name__ == "__main__":
|
|
| 358 |
object-fit: cover;
|
| 359 |
}
|
| 360 |
""",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 361 |
)
|
|
|
|
| 358 |
object-fit: cover;
|
| 359 |
}
|
| 360 |
""",
|
| 361 |
+
head="""
|
| 362 |
+
<script>
|
| 363 |
+
let observerFooterButtons = new MutationObserver((mutationsList, observer) => {
|
| 364 |
+
const origButtonShowAPI = document.querySelector(".show-api");
|
| 365 |
+
const origButtonBuiltWith = document.querySelector(".built-with");
|
| 366 |
+
const origButtonSettings = document.querySelector(".settings");
|
| 367 |
+
const origSeparatorDiv = document.querySelector(".divider");
|
| 368 |
+
if (!origButtonBuiltWith || !origButtonShowAPI || !origButtonSettings || !origSeparatorDiv) {
|
| 369 |
+
return;
|
| 370 |
+
}
|
| 371 |
+
observer.disconnect();
|
| 372 |
+
|
| 373 |
+
const parentDiv = origButtonShowAPI.parentNode;
|
| 374 |
+
if (!parentDiv) return;
|
| 375 |
+
|
| 376 |
+
const createButton = (referenceButton, text, href) => {
|
| 377 |
+
let newButton = referenceButton.cloneNode(true);
|
| 378 |
+
newButton.href = href;
|
| 379 |
+
newButton.textContent = text;
|
| 380 |
+
newButton.className = referenceButton.className;
|
| 381 |
+
newButton.style.textDecoration = "none";
|
| 382 |
+
newButton.style.display = "inline-block";
|
| 383 |
+
newButton.style.cursor = "pointer";
|
| 384 |
+
return newButton;
|
| 385 |
+
};
|
| 386 |
+
|
| 387 |
+
document.querySelectorAll(".divider").forEach(divider => {
|
| 388 |
+
divider.style.marginLeft = "var(--size-2)";
|
| 389 |
+
divider.style.marginRight = "var(--size-2)";
|
| 390 |
+
});
|
| 391 |
+
|
| 392 |
+
const newButtonBuiltWith = createButton(origButtonBuiltWith, "Built with Gradio DualVision", "https://github.com/toshas/gradio-dualvision");
|
| 393 |
+
const newButtonTemplateBy = createButton(origButtonBuiltWith, "Template by Anton Obukhov", "https://www.obukhov.ai");
|
| 394 |
+
const newButtonLicensed = createButton(origButtonBuiltWith, "Licensed under CC BY-SA 4.0", "http://creativecommons.org/licenses/by-sa/4.0/");
|
| 395 |
+
|
| 396 |
+
parentDiv.replaceChild(newButtonBuiltWith, origButtonShowAPI);
|
| 397 |
+
parentDiv.replaceChild(newButtonTemplateBy, origButtonBuiltWith);
|
| 398 |
+
parentDiv.replaceChild(newButtonLicensed, origButtonSettings);
|
| 399 |
+
});
|
| 400 |
+
observerFooterButtons.observe(document.body, { childList: true, subtree: true });
|
| 401 |
+
</script>
|
| 402 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-1FWSVCGZTG"></script>
|
| 403 |
+
<script>
|
| 404 |
+
window.dataLayer = window.dataLayer || [];
|
| 405 |
+
function gtag() {{dataLayer.push(arguments);}}
|
| 406 |
+
gtag('js', new Date());
|
| 407 |
+
gtag('config', 'G-1FWSVCGZTG');
|
| 408 |
+
</script>
|
| 409 |
+
"""
|
| 410 |
)
|