mirror of
https://github.com/multipleof4/devsune.git
synced 2026-01-14 00:17:56 +00:00
This build was committed by a bot.
This commit is contained in:
@@ -21,21 +21,25 @@
|
|||||||
<link rel="icon" type="image/avif" href="https://sune.planetrenox.com/✺.avif">
|
<link rel="icon" type="image/avif" href="https://sune.planetrenox.com/✺.avif">
|
||||||
<style>: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}</style>
|
<style>: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}</style>
|
||||||
<script>(function(){
|
<script>(function(){
|
||||||
function r(f){if(document.readyState!=='loading')f();else document.addEventListener('DOMContentLoaded',f)}
|
function ready(f){if(document.readyState!=='loading')f();else document.addEventListener('DOMContentLoaded',f)}
|
||||||
function overlay(){
|
function overlay(){
|
||||||
var o=document.getElementById('sw-overlay'); if(o) return o
|
var o=document.getElementById('sw-overlay'); if(o) return o
|
||||||
o=document.createElement('div'); o.id='sw-overlay'
|
o=document.createElement('div'); o.id='sw-overlay'
|
||||||
Object.assign(o.style,{position:'fixed',top:'0',left:'0',right:'0',padding:'20px 24px',zIndex:'2147483647',background:'linear-gradient(90deg,#ff9800,#ffc107)',color:'#fff',textAlign:'center',font:'700 22px/1.2 system-ui,-apple-system,Segoe UI,Roboto,sans-serif'})
|
Object.assign(o.style,{position:'fixed',top:'0',left:'0',right:'0',padding:'18px 56px 18px 20px',zIndex:'2147483647',background:'linear-gradient(90deg,#ff9800,#ffc107)',color:'#fff',textAlign:'center',font:'700 18px/1.2 system-ui,-apple-system,Segoe UI,Roboto,sans-serif',letterSpacing:'0.4px',boxShadow:'0 8px 24px rgba(0,0,0,.25)'})
|
||||||
var s=document.createElement('span'); s.id='sw-overlay-text'
|
var text=document.createElement('span'); text.id='sw-overlay-text'
|
||||||
o.appendChild(s); document.body.appendChild(o); return o
|
var x=document.createElement('button'); x.type='button'; x.textContent='×'
|
||||||
|
Object.assign(x.style,{position:'absolute',top:'8px',right:'12px',width:'36px',height:'36px',border:'0',borderRadius:'10px',background:'rgba(255,255,255,.18)',color:'#fff',fontSize:'24px',cursor:'pointer'})
|
||||||
|
x.addEventListener('click',function(){o.remove();sessionStorage.setItem('swOverlayClosed','1')})
|
||||||
|
o.appendChild(text); o.appendChild(x); document.body.appendChild(o); return o
|
||||||
}
|
}
|
||||||
function setStatus(k,msg){
|
function setStatus(kind,msg){
|
||||||
var o=overlay(), t=o.querySelector('#sw-overlay-text')
|
var o=overlay(), t=o.querySelector('#sw-overlay-text')
|
||||||
if(k==='ok'){o.style.background='linear-gradient(90deg,#00c853,#00e5ff)'; t.textContent=msg||'SERVICE WORKER: ACTIVE'}
|
if(kind==='ok'){o.style.background='linear-gradient(90deg,#00c853,#00e5ff)'; t.textContent=msg||'SERVICE WORKER: ACTIVE'}
|
||||||
else if(k==='fail'){o.style.background='linear-gradient(90deg,#c62828,#ad1457)'; t.textContent=msg||'SERVICE WORKER: NOT RUNNING'}
|
else if(kind==='fail'){o.style.background='linear-gradient(90deg,#c62828,#ad1457)'; t.textContent=msg||'SERVICE WORKER: NOT RUNNING'}
|
||||||
else {o.style.background='linear-gradient(90deg,#ff9800,#ffc107)'; t.textContent=msg||'SERVICE WORKER: WAITING'}
|
else {o.style.background='linear-gradient(90deg,#ff9800,#ffc107)'; t.textContent=msg||'SERVICE WORKER: WAITING'}
|
||||||
}
|
}
|
||||||
r(function(){
|
ready(function(){
|
||||||
|
if(sessionStorage.getItem('swOverlayClosed')==='1') return
|
||||||
setStatus('wait','SERVICE WORKER: WAITING')
|
setStatus('wait','SERVICE WORKER: WAITING')
|
||||||
if(!('serviceWorker' in navigator)){setStatus('fail','NO SERVICE WORKER SUPPORT'); alert('NO SERVICE WORKER SUPPORT'); return}
|
if(!('serviceWorker' in navigator)){setStatus('fail','NO SERVICE WORKER SUPPORT'); alert('NO SERVICE WORKER SUPPORT'); return}
|
||||||
var ok=false
|
var ok=false
|
||||||
|
|||||||
Reference in New Issue
Block a user