Mudanças entre as edições de "Widget:Teste"
m Etiqueta: Revertido |
m Etiqueta: Revertido |
||
| Linha 1: | Linha 1: | ||
<style> | <style> | ||
.gx-overlay{position:fixed;inset:0;background:rgba(0,0,0,.86);display:none;align-items:center;justify-content:center;z-index:2147483647} | |||
.gx-overlay { | .gx-modal{position:relative;max-width:min(92vw,1200px);max-height:92vh;background:#000;border-radius:12px;box-shadow:0 10px 40px rgba(0,0,0,.5);overflow:hidden} | ||
.gx-modal img{display:block;max-width:100%;max-height:92vh;height:auto;width:auto;image-rendering:auto} | |||
.gx-close{position:absolute;top:8px;right:8px;width:34px;height:34px;border-radius:999px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.38);color:#fff;font-size:22px;line-height:32px;text-align:center;cursor:pointer;user-select:none} | |||
.gx-close:hover{background:rgba(255,255,255,.25)} | |||
.gx-open{overflow:hidden!important} | |||
.gifbox{cursor:pointer;text-decoration:underline;color:#0645ad} | |||
.gifbox:visited{color:#0b0080} | |||
body.gx-open #mw-head, | |||
} | body.gx-open #mw-panel, | ||
body.gx-open #p-logo, | |||
.gx-modal { | body.gx-open #footer, | ||
body.gx-open .vector-header, | |||
body.gx-open .vector-sitenotice, | |||
body.gx-open .mw-sidebar, | |||
body.gx-open .mw-portlet, | |||
body.gx-open .vector-sticky-header{pointer-events:none!important} | |||
body.gx-open a:hover, | |||
body.gx-open a:focus, | |||
} | body.gx-open a:active{outline:none!important;text-decoration:none!important} | ||
body.gx-open #mw-content-text ~ *, | |||
.gx-modal img { | body.gx-open #content ~ *, | ||
body.gx-open #mw-head, | |||
body.gx-open #mw-panel, | |||
body.gx-open #p-logo, | |||
body.gx-open #footer{filter:saturate(.2) brightness(.8)} | |||
} | |||
.gx-close { | |||
} | |||
.gx-close:hover { background: rgba(255,255,255,.25) | |||
.gx-open { overflow: hidden !important | |||
.gifbox { cursor: pointer; text-decoration: underline; color: #0645ad | |||
.gifbox:visited { color: #0b0080; } | |||
</style> | </style> | ||
| Linha 62: | Linha 37: | ||
<script> | <script> | ||
(function(){ | (function(){ | ||
var overlay=document.querySelector('.gx-overlay'); | |||
var overlay = document.querySelector('.gx-overlay'); | var modal=overlay.querySelector('.gx-modal'); | ||
var modal | var imgEl=overlay.querySelector('#gx-img'); | ||
var imgEl | var closeEl=overlay.querySelector('.gx-close'); | ||
var closeEl = overlay.querySelector('.gx-close'); | var lastActive=null; | ||
function openBox(url,altText){ | |||
if(!url)return; | |||
function openBox(url, altText){ | lastActive=document.activeElement; | ||
if(!url) return; | |||
document.body.classList.add('gx-open'); | document.body.classList.add('gx-open'); | ||
imgEl.src = url; | imgEl.src=url; | ||
imgEl.alt = altText || ''; | imgEl.alt=altText||''; | ||
overlay.style.display = 'flex'; | overlay.style.display='flex'; | ||
closeEl.setAttribute('tabindex','0'); | |||
closeEl.focus(); | |||
} | } | ||
function closeBox(){ | function closeBox(){ | ||
overlay.style.display = 'none'; | overlay.style.display='none'; | ||
document.body.classList.remove('gx-open'); | document.body.classList.remove('gx-open'); | ||
imgEl.src = ''; | imgEl.src=''; | ||
imgEl.alt = ''; | imgEl.alt=''; | ||
if(lastActive&&typeof lastActive.focus==='function'){lastActive.focus()} | |||
} | } | ||
overlay.addEventListener('click',function(e){if(e.target===overlay)closeBox()}); | |||
closeEl.addEventListener('click',closeBox); | |||
overlay.addEventListener('click', function(e){ | document.addEventListener('keydown',function(e){if(e.key==='Escape')closeBox()}); | ||
document.addEventListener('click',function(e){ | |||
var t=e.target; | |||
closeEl.addEventListener('click', closeBox); | while(t&&t!==document){ | ||
document.addEventListener('keydown', function(e){ | if(t.classList&&t.classList.contains('gifbox'))break; | ||
t=t.parentNode; | |||
document.addEventListener('click', function(e){ | |||
var t = e.target; | |||
while (t && t !== document) { | |||
if (t.classList && t.classList.contains('gifbox')) break; | |||
t = t.parentNode; | |||
} | } | ||
if (!t || t === document) return; | if(!t||t===document)return; | ||
e.preventDefault(); | e.preventDefault(); | ||
var url=t.getAttribute('data-gif')||t.getAttribute('href'); | |||
var url = t.getAttribute('data-gif') || t.getAttribute('href'); | var alt=t.getAttribute('data-alt')||t.textContent.trim(); | ||
var alt = t.getAttribute('data-alt') || t.textContent.trim(); | if(!url)return; | ||
openBox(url,alt); | |||
},false); | |||
if (!url) return; | |||
openBox(url, alt); | |||
}, false); | |||
})(); | })(); | ||
</script> | </script> | ||
Edição das 02h36min de 14 de agosto de 2025
<style> .gx-overlay{position:fixed;inset:0;background:rgba(0,0,0,.86);display:none;align-items:center;justify-content:center;z-index:2147483647} .gx-modal{position:relative;max-width:min(92vw,1200px);max-height:92vh;background:#000;border-radius:12px;box-shadow:0 10px 40px rgba(0,0,0,.5);overflow:hidden} .gx-modal img{display:block;max-width:100%;max-height:92vh;height:auto;width:auto;image-rendering:auto} .gx-close{position:absolute;top:8px;right:8px;width:34px;height:34px;border-radius:999px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.38);color:#fff;font-size:22px;line-height:32px;text-align:center;cursor:pointer;user-select:none} .gx-close:hover{background:rgba(255,255,255,.25)} .gx-open{overflow:hidden!important} .gifbox{cursor:pointer;text-decoration:underline;color:#0645ad} .gifbox:visited{color:#0b0080} body.gx-open #mw-head, body.gx-open #mw-panel, body.gx-open #p-logo, body.gx-open #footer, body.gx-open .vector-header, body.gx-open .vector-sitenotice, body.gx-open .mw-sidebar, body.gx-open .mw-portlet, body.gx-open .vector-sticky-header{pointer-events:none!important} body.gx-open a:hover, body.gx-open a:focus, body.gx-open a:active{outline:none!important;text-decoration:none!important} body.gx-open #mw-content-text ~ *, body.gx-open #content ~ *, body.gx-open #mw-head, body.gx-open #mw-panel, body.gx-open #p-logo, body.gx-open #footer{filter:saturate(.2) brightness(.8)} </style>
<script> (function(){
var overlay=document.querySelector('.gx-overlay');
var modal=overlay.querySelector('.gx-modal');
var imgEl=overlay.querySelector('#gx-img');
var closeEl=overlay.querySelector('.gx-close');
var lastActive=null;
function openBox(url,altText){
if(!url)return;
lastActive=document.activeElement;
document.body.classList.add('gx-open');
imgEl.src=url;
imgEl.alt=altText||;
overlay.style.display='flex';
closeEl.setAttribute('tabindex','0');
closeEl.focus();
}
function closeBox(){
overlay.style.display='none';
document.body.classList.remove('gx-open');
imgEl.src=;
imgEl.alt=;
if(lastActive&&typeof lastActive.focus==='function'){lastActive.focus()}
}
overlay.addEventListener('click',function(e){if(e.target===overlay)closeBox()});
closeEl.addEventListener('click',closeBox);
document.addEventListener('keydown',function(e){if(e.key==='Escape')closeBox()});
document.addEventListener('click',function(e){
var t=e.target;
while(t&&t!==document){
if(t.classList&&t.classList.contains('gifbox'))break;
t=t.parentNode;
}
if(!t||t===document)return;
e.preventDefault();
var url=t.getAttribute('data-gif')||t.getAttribute('href');
var alt=t.getAttribute('data-alt')||t.textContent.trim();
if(!url)return;
openBox(url,alt);
},false);
})(); </script>