mirror of
https://github.com/multipleof4/devsune.git
synced 2026-01-13 16:07:55 +00:00
Update vite.config.js
This commit is contained in:
@@ -34,7 +34,12 @@ const html = createHtmlPlugin({
|
||||
{ tag: 'title', children: 'Sune', injectTo: 'head' },
|
||||
{ tag: 'link', attrs: { rel: 'icon', type: 'image/avif', href: 'https://sune.planetrenox.com/✺.avif' }, injectTo: 'head' },
|
||||
{ tag: 'script', attrs: { src: 'https://cdn.jsdelivr.net/npm/tiny-ripple@0.2.0' }, injectTo: 'head' },
|
||||
{ tag: 'style', children: ':root{--safe-bottom:env(safe-area-inset-bottom)}::-webkit-scrollbar{height:8px;width:8px}::-webkit-scrollbar-thumb{background:#e5e7eb;border-radius:999px}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}', injectTo: 'head' }
|
||||
{ tag: 'style', children: ':root{--safe-bottom:env(safe-area-inset-bottom)}::-webkit-scrollbar{height:8px;width:8px}::-webkit-scrollbar-thumb{background:#e5e7eb;border-radius:999px}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}', injectTo: 'head' },
|
||||
{
|
||||
tag: 'script',
|
||||
children: `(function(){function n(t){let e=document.getElementById("sw-banner");if(!e){e=document.createElement("div");e.id="sw-banner";Object.assign(e.style,{position:"fixed",zIndex:"99999",top:"12px",right:"12px",maxWidth:"90vw",background:"#111",color:"#fff",padding:"10px 12px",borderRadius:"12px",boxShadow:"0 6px 18px rgba(0,0,0,.3)",font:"14px/1.3 system-ui,-apple-system,Segoe UI,Roboto,sans-serif"});document.body.appendChild(e)}e.textContent=String(t);clearTimeout(e.__to);e.__to=setTimeout(()=>{e&&e.parentNode&&e.parentNode.removeChild(e)},3000)}if(!("serviceWorker"in navigator)){n("Service Worker not supported");return}navigator.serviceWorker.addEventListener("message",e=>{let d=e.data;try{d=typeof d==="object"?JSON.stringify(d):String(d)}catch{}n(d)});navigator.serviceWorker.ready.then(r=>{if(r.active)r.active.postMessage({type:"PING",ts:Date.now()})});})();`,
|
||||
injectTo: 'head'
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user