Minha sacola
Sacola Vazia
Conteúdo 100% gratuito

E-books grátis para você

Baixe gratuitamente obras acadêmicas sobre Teologia, Ciência da Religião e Ciências Humanas. Busque por título ou autor.

 
 

Nenhum e-book encontrado

Tente buscar por outro título ou nome de autor.

 

${book.title}

${book.author}

${metaChips.join('')}

${book.synopsis}

`; const coverImg = card.querySelector('.cover-wrap img'); card.addEventListener('click', (e) => { if(e.target.closest('.btn-download')) return; openModal(book, coverImg); }); card.addEventListener('keydown', (e) => { if((e.key === 'Enter' || e.key === ' ') && !e.target.closest('.btn-download')){ e.preventDefault(); openModal(book, coverImg); } }); card.querySelector('.btn-download').addEventListener('click', (e) => { e.stopPropagation(); window.open(book.link, '_blank', 'noopener'); }); grid.appendChild(card); }); } function openModal(book, cardImgEl){ currentBook = book; currentCardImg = cardImgEl; const apply = () => { modalCoverImg.src = book.cover; modalCoverImg.alt = `Capa de ${book.title}`; modalTitle.textContent = book.title; modalAuthor.textContent = book.author; modalCta.href = book.link; const rows = []; rows.push(['Editora', 'Editora Recriar']); rows.push(['Autor', book.author]); if(book.isbn) rows.push(['ISBN', book.isbn]); if(book.pages) rows.push(['P\u00e1ginas', book.pages]); if(book.year) rows.push(['Ano', book.year]); infoTable.innerHTML = rows.map(r => `${r[0]}${r[1]}`).join(''); modalSynopsis.textContent = book.synopsis; modalSynopsis.classList.remove('expanded'); modalToggle.textContent = 'Ler mais'; modalTags.innerHTML = getTags(book).map(t => `${t}`).join(''); abntText.innerHTML = buildAbnt(book); favBtn.classList.toggle('active', isFavorite(book)); modalOverlay.classList.add('open'); document.body.style.overflow = 'hidden'; }; try{ if(cardImgEl){ cardImgEl.style.viewTransitionName = 'active-cover'; } modalCoverImg.style.viewTransitionName = 'active-cover'; if(document.startViewTransition){ const t = document.startViewTransition(apply); t.finished.finally(() => { if(cardImgEl) cardImgEl.style.viewTransitionName = ''; modalCoverImg.style.viewTransitionName = ''; }); } else { apply(); } } catch(err){ apply(); } } function closeModal(){ const apply = () => { modalOverlay.classList.remove('open'); document.body.style.overflow = ''; }; try{ if(currentCardImg){ currentCardImg.style.viewTransitionName = 'active-cover'; } modalCoverImg.style.viewTransitionName = 'active-cover'; if(document.startViewTransition){ const t = document.startViewTransition(apply); t.finished.finally(() => { if(currentCardImg) currentCardImg.style.viewTransitionName = ''; modalCoverImg.style.viewTransitionName = ''; currentBook = null; currentCardImg = null; }); } else { apply(); currentBook = null; currentCardImg = null; } } catch(err){ apply(); currentBook = null; currentCardImg = null; } } modalCloseBtn.addEventListener('click', closeModal); modalOverlay.addEventListener('click', (e) => { if(e.target === modalOverlay) closeModal(); }); document.addEventListener('keydown', (e) => { if(e.key === 'Escape' && modalOverlay.classList.contains('open')) closeModal(); }); modalToggle.addEventListener('click', () => { modalSynopsis.classList.toggle('expanded'); modalToggle.textContent = modalSynopsis.classList.contains('expanded') ? 'Ler menos' : 'Ler mais'; }); favBtn.addEventListener('click', () => { if(!currentBook) return; const active = toggleFavorite(currentBook); favBtn.classList.toggle('active', active); showToast(active ? 'Adicionado aos favoritos' : 'Removido dos favoritos'); }); copyLinkBtn.addEventListener('click', async () => { if(!currentBook) return; try{ await navigator.clipboard.writeText(currentBook.link); showToast('Link copiado!'); }catch(e){ showToast('N\u00e3o foi poss\u00edvel copiar o link'); } }); shareBtn.addEventListener('click', async () => { if(!currentBook) return; if(navigator.share){ try{ await navigator.share({ title: currentBook.title, url: currentBook.link }); } catch(e){ /* usu\u00e1rio cancelou */ } } else { try{ await navigator.clipboard.writeText(currentBook.link); showToast('Link copiado para compartilhar!'); }catch(e){ showToast('N\u00e3o foi poss\u00edvel compartilhar'); } } }); copyAbntBtn.addEventListener('click', async () => { if(!currentBook) return; try{ await navigator.clipboard.writeText(abntText.textContent); showToast('Refer\u00eancia copiada!'); }catch(e){ showToast('N\u00e3o foi poss\u00edvel copiar'); } }); function filterBooks(){ const query = normalize(searchInput.value.trim()); clearBtn.classList.toggle('show', query.length > 0); const filtered = query === '' ? books : books.filter(b => normalize(b.title).includes(query) || normalize(b.author).includes(query) ); resultsInfo.innerHTML = query === '' ? `Mostrando ${books.length} e-books dispon\u00edveis` : `${filtered.length} resultado(s) para "${searchInput.value}"`; renderBooks(filtered); } searchInput.addEventListener('input', filterBooks); clearBtn.addEventListener('click', () => { searchInput.value = ''; filterBooks(); searchInput.focus(); }); filterBooks();