async function fetchAndDisplayBooks() { try { let books = [{"title":"Gates of Fire: An Epic Novel of the Battle of Thermopylae","shorttitle":"Gates of Fire","authorstring":"Steven Pressfield","description":"Thousands of years ago, Herodotus and Plutarch immortalized Spartan society in their histories; but today, little is left of the ancient city or the social structure of this momentous culture. One of the few antiquarian marks of the civilization that has survived lies scores of miles away from Sparta, at a narrow Greek mountain pass called Thermopylae.\n\nIt was there that three hundred of Sparta's finest warriors held back the invading millions of the Persian empire and valiantly gave their lives in the selfless service of democracy and freedom. A simple engraved stone marks their burial ground.\n\nInspired by this stone and intrigued by the lore of Sparta, author Steven Pressfield has brilliantly combined scholarship with storytelling. Narrated by the sole survivor of the epic battle--a squire in the Spartan heavy infantry--Gates of Fire is a mesmerizing depiction of one man's indoctrination into the Spartan way of life and death, and of the legendary men and women who gave the culture an immortal gravity.\n\nCulminating in the electrifying and horrifying epic battle, Gates of Fire weaves history, mystery, and heartbreaking romance into a literary page-turner that brings the Homeric tradition into the twenty-first century.","descriptionHtml":"Thousands of years ago, Herodotus and Plutarch immortalized Spartan society in their histories; but today, little is left of the ancient city or the social structure of this momentous culture.  One of the few antiquarian marks of the civilization that has survived lies scores of miles away from Sparta, at a narrow Greek mountain pass called Thermopylae.

It was there that three hundred of Sparta's finest warriors held back the invading millions of the Persian empire and valiantly gave their lives in the selfless service of democracy and freedom.  A simple engraved stone marks their burial ground.

Inspired by this stone and intrigued by the lore of Sparta, author Steven Pressfield has brilliantly combined scholarship with storytelling.  Narrated by the sole survivor of the epic battle--a squire in the Spartan heavy infantry--Gates of Fire is a mesmerizing depiction of one man's indoctrination into the Spartan way of life and death, and of the legendary men and women who gave the culture an immortal gravity.

Culminating in the electrifying and horrifying epic battle, Gates of Fire weaves history, mystery, and heartbreaking romance into a literary page-turner that brings the Homeric tradition into the twenty-first century.","isbn":"9780553383683","amazonurl":"http://www.amazon.com/Gates-Fire-Novel-Battle-Thermopylae/dp/055338368X?linkCode=ll1&tag=codexmap-20&linkId=8d37aaf25f3947e1637a2ada957a9c8f&ref_=as_li_ss_tl","HawaiiProject":"https://www.thehawaiiproject.com/book/Gates-of-Fire--by--Steven-Pressfield--57492","tbr":"https://tbrapp.co/book/57492","AppleBooks":"https://books.apple.com/us/book/gates-of-fire/id419969537?itscg=30200&at=1000l3dBv&ct=57492","BarnesNoble":"https://www.barnesandnoble.com/s/9780553383683","Bookshop":"https://bookshop.org/a/19558/9780553383683","coverarturl":"https://images-na.ssl-images-amazon.com/images/I/51Yiy2gmWRL.jpg","bookid":"57492","publicationdate":"1998-10-20 00:00:00"},{"title":"The Golden Horn (Last Viking)","shorttitle":"The Golden Horn","authorstring":"Poul Anderson","description":"The Golden Horn (Last Viking) [Feb 01, 1980] Poul Anderson","descriptionHtml":"The Golden Horn (Last Viking) [Feb 01, 1980] Poul Anderson","isbn":"0890835977","amazonurl":"https://www.amazon.com/Golden-Horn-Last-Viking/dp/0890835977/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=&sr=&linkCode=ll1&tag=codexmap-20&linkId=8d37aaf25f3947e1637a2ada957a9c8f&ref_=as_li_ss_tl","HawaiiProject":"https://www.thehawaiiproject.com/book/The-Golden-Horn--by--Poul-Anderson--198926","tbr":"https://tbrapp.co/book/198926","AppleBooks":"https://books.apple.com/us/book/the-golden-horn/id1051979302?itscg=30200&at=1000l3dBv&ct=198926","BarnesNoble":"https://www.barnesandnoble.com/s/0890835977","Bookshop":"https://bookshop.org/a/19558/9780890835975","coverarturl":"https://m.media-amazon.com/images/I/51ya30hZyYL.jpg","bookid":"198926","publicationdate":"1980-02-01 00:00:00"},{"title":"Harpist in the Wind","shorttitle":"Harpist in the Wind","authorstring":"Patricia A. McKillip","description":"The concluding audiobook of McKillip's Riddle Master trilogy opens peacefully but soon places the listener in the midst of conflict and unrest. The Prince of Hed solves the puzzle of his future when he learns to harp the wind, discovers who the shape changers are, and understands his own relationship to Deth, harpist of the wizard Ohm.","descriptionHtml":"

The concluding audiobook of McKillip's Riddle Master trilogy opens peacefully but soon places the listener in the midst of conflict and unrest. The Prince of Hed solves the puzzle of his future when he learns to harp the wind, discovers who the shape changers are, and understands his own relationship to Deth, harpist of the wizard Ohm.

","isbn":"9780345311146","amazonurl":"http://www.amazon.com/Harpist-Wind-Patricia-A-McKillip/dp/0345311140?linkCode=ll1&tag=codexmap-20&linkId=8d37aaf25f3947e1637a2ada957a9c8f&ref_=as_li_ss_tl","HawaiiProject":"https://www.thehawaiiproject.com/book/Harpist-in-the-Wind--by--Patricia-A.-McKillip--126872","tbr":"https://tbrapp.co/book/126872","AppleBooks":"https://goto.applebooks.apple/9780345311146?itscg=30200&at=1000l3dBv&ct=9780345311146","BarnesNoble":"https://www.barnesandnoble.com/s/9780345311146","Bookshop":"https://bookshop.org/a/19558/9780345311146","coverarturl":"https://images-na.ssl-images-amazon.com/images/I/411A6CHQ4ZL.jpg","bookid":"126872","publicationdate":"1980-01-01 00:00:00"}]; // Create a container for the book list const bookList = document.createElement('div'); bookList.className = 'book-list'; // Add some basic styling const style = document.createElement('style'); style.textContent = ` body { --cover-width: 70px; --cover-height: calc(var(--cover-width) * 1.55); --cover-radius: 8px; --cover-bordercolor: rgba(255, 255, 255, 0.5); --widget-background: black; --widget-textcolor: white; } .book-list { display: flex; flex-direction: column; gap: 10px; padding: 4px; max-widthX: 250px; background: var(--widget-background); } .book-card { display: flex; flex-direction: row; align-items: center; overflow: hidden; } @media (max-width:1080px) { .book-card { flex-direction: column; } } .book-cover-container { flexX: 0 0 var(--cover-width); width: var(--cover-width); height: var(--cover-height); border-radius: var(--cover-radius); background: var(--cover-bordercolor); displayX: flex; padding: 2px; } .book-cover-link { display: block; height: 100% } .book-cover { display: block; widthX: var(--cover-width); heightX: var(--cover-height); border-radius: var(--cover-radius); object-fit: cover; height: 100%; width: 100%; marginX: 1px; box-shadow: 0 0 1px 0px white inset, 0 0 1px 0px white; } .book-info { flex: 1; padding: 8px; display: flex; flex-direction: column; justify-content: center; background: var(--widget-background); color: var(--widget-textcolor); } .book-title { margin: 0 0 0px 0 !important; font-size: 1rem; font-weight: bold; color: var(--widget-textcolor); } .book-author { color: var(--widget-textcolor); margin-bottom: 0px !important; font-size: 0.75rem; } `; document.head.appendChild(style); // Create and append book cards books.forEach(book => { const bookCard = document.createElement('div'); bookCard.className = 'book-card'; // h2: margin-top: 0px; bookCard.innerHTML = `
Cover of ${book.shorttitle}
${book.shorttitle}

by ${book.authorstring}

`; bookList.appendChild(bookCard); }); // Add the book list to the document const booksContainer = document.getElementById('fdb2eae44c496f82eb8c4d968057560d'); if (booksContainer) { booksContainer.appendChild(bookList); } else { console.error('Element with id "books" not found'); } // var poweredDiv = document.createElement("div"); poweredDiv.setAttribute('style', 'padding-top: 4px; display: flex; justify-content: center; align-items: center;' ); var poweredImage = document.createElement("img"); var poweredLink = document.createElement("a"); var poweredImgLink = document.createElement("a"); poweredDiv.className ='LT_powered'; poweredImage.className ="favicon"; poweredImage.setAttribute('src', "https://bookshipapp.com/assets/icon/favicon.ico"); poweredImage.setAttribute('width', '16px'); poweredImage.setAttribute('height', '16px'); poweredImage.setAttribute('alt', 'Powered by Bookship'); poweredLink.setAttribute('href', 'https://www.bookshipapp.com') poweredLink.setAttribute('target', '_top'); poweredLink.setAttribute('style', 'display: flex;'); poweredLink.innerHTML='Powered by Bookship'; poweredImgLink.setAttribute('href', 'https://www.bookshipapp.com') poweredImgLink.setAttribute('target', '_top'); poweredImgLink.setAttribute('style', 'display: flex;padding-right: 4px;'); poweredImgLink.appendChild(poweredImage); poweredDiv.appendChild(poweredImgLink); poweredDiv.appendChild(poweredLink); booksContainer.appendChild(poweredDiv); } catch (error) { console.error('Error fetching or displaying books:', error); const errorMessage = document.createElement('div'); errorMessage.style.color = 'red'; errorMessage.style.padding = '20px'; errorMessage.textContent = 'Sorry, there was an error loading the books.'; document.body.appendChild(errorMessage); } } fetchAndDisplayBooks(); // Call the function when the document is loaded // document.addEventListener('DOMContentLoaded', fetchAndDisplayBooks);