UNPKG

swagger-custom

Version:

Swagger Style and Dynamic Components, Neon Mode Swagger, Custom js elements in swagger.

17 lines (15 loc) 1.78 kB
/*! ========================================================== * Swagger Custom Package v1.1.3 * Author: Jasurbek Haydarov (jas-kha) * GitHub: https://github.com/jas-kha/swagger-custom * Documentation: https://github.com/jas-kha/swagger-custom#readme * Description: Custom CSS & JS injector for Swagger UI * Supports dynamic JS components and custom themes. * Build: Auto-generated using Rollup * License: MIT * Copyright (c) 2025-2026 Jasurbek Haydarov Baxtiyorovich * JK Project ========================================================== */ document.addEventListener("DOMContentLoaded",function(){const t=document.createElement("a");t.href="/",t.style.position="fixed",t.style.top="20px",t.style.left="0px",t.style.backgroundColor="#10b981",t.style.color="white",t.style.padding="10px 12px 10px 12px",t.style.borderRadius="8px",t.style.fontWeight="bold",t.style.textDecoration="none",t.style.boxShadow="0 2px 6px rgba(0,0,0,0.3)",t.style.zIndex="9999",t.style.transition="0.3s ease",t.style.display="inline-flex",t.style.alignItems="center",t.style.gap="8px",t.onmouseover=()=>t.style.backgroundColor="#059669",t.onmouseout=()=>t.style.backgroundColor="#10b981";const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.style.width="20px",e.style.height="20px";const o=document.createElementNS("http://www.w3.org/2000/svg","path");o.setAttribute("d","M3 9.75L12 3l9 6.75M4.5 10.5V21h15V10.5M9 21v-6h6v6"),e.appendChild(o),t.appendChild(e),document.body.appendChild(t)});