Skip to content

Instantly share code, notes, and snippets.

@matheuseduardo
Last active September 10, 2025 18:33
Show Gist options
  • Save matheuseduardo/1af9aa1d8821eeb68987d006399d1205 to your computer and use it in GitHub Desktop.
Save matheuseduardo/1af9aa1d8821eeb68987d006399d1205 to your computer and use it in GitHub Desktop.
buscar e exibir todas fotos do foco radical para escolher
// utilizar no console:
var imgs = document.querySelectorAll('div > div.gallery__photo__thumb.is-list.col-12.col-lg-12 > div > img');
// Converte NodeList em array e pega os src
const urls = Array.from(imgs).map(el => el.src);
// Monta o HTML básico
const html = `
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Álbum de Imagens</title>
<style>
body {
font-family: sans-serif;
display: flex;
flex-wrap: wrap;
gap: 10px;
padding: 20px;
background: #f9f9f9;
}
img {
max-width: 200px;
height: auto;
border-radius: 4px;
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
transition: transform 0.3s;
cursor: pointer;
}
img:hover {
transform: scale(1.5);
}
</style>
</head>
<body>
${urls.map(u => `<img src="${u}">`).join("")}
</body>
</html>
`;
// Abre uma nova janela e escreve o HTML lá
const win = window.open();
win.document.open();
win.document.write(html);
win.document.close();
(function(){
const imgs=document.querySelectorAll('div>div.gallery__photo__thumb.is-list.col-12.col-lg-12>div>img');
if(!imgs.length){alert("Nenhuma imagem encontrada!");return;}
const urls=[...imgs].map(el=>el.src);
const html=`<!DOCTYPE html><html lang="pt-BR"><head><meta charset="UTF-8"><title>Álbum</title><style>body{font-family:sans-serif;display:flex;flex-wrap:wrap;gap:10px;padding:20px;background:#f9f9f9}img{max-width:200px;height:auto;border-radius:4px;box-shadow:0 2px 5px rgba(0,0,0,.2);transition:transform .3s;cursor:pointer}img:hover{transform:scale(1.5);z-index:10;position:relative}</style></head><body>${urls.map(u=>`<img src="${u}" loading="lazy">`).join("")}</body></html>`;
const win=window.open("","_blank");win.document.write(html);win.document.close();
})();
// código resumido para utilizar em bookmarklet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment