async function fetchAndDisplayBooks() { try { let books = [{"title":"A Sport and a Pastime","shorttitle":"A Sport and a Pastime","authorstring":"James Salter","description":"With an introduction by Sarah HallThe 1960s. Philip Dean, a footloose Yale dropout, is touring provincial France and sometimes Paris in a borrowed, once elegant car. He begins a mismatched affair with a young shop girl named Anne-Marie. Together they burn in an everyday but stunningly sensual paradise. A Sport and A Pastime is a seductive classic that established James Salter's reputation as one of the finest writers of our time. It is remarkable for its eroticism, its luminous prose and its ability to explore the boundaries between what is dreamt and what is lived, between body and soul.","descriptionHtml":"With an introduction by Sarah HallThe 1960s. Philip Dean, a footloose Yale dropout, is touring provincial France and sometimes Paris in a borrowed, once elegant car. He begins a mismatched affair with a young shop girl named Anne-Marie. Together they burn in an everyday but stunningly sensual paradise. A Sport and A Pastime is a seductive classic that established James Salter's reputation as one of the finest writers of our time. It is remarkable for its eroticism, its luminous prose and its ability to explore the boundaries between what is dreamt and what is lived, between body and soul.","isbn":"9780374530501","amazonurl":"http://www.amazon.com/A-Sport-Pastime-Novel/dp/0374530505?linkCode=ll1&tag=codexmap-20&linkId=8d37aaf25f3947e1637a2ada957a9c8f&ref_=as_li_ss_tl","HawaiiProject":"https://www.thehawaiiproject.com/book/A-Sport-and-a-Pastime--by--James-Salter--26120","tbr":"https://tbrapp.co/book/26120","AppleBooks":"https://goto.applebooks.apple/9780374530501","BarnesNoble":"https://www.barnesandnoble.com/s/9780374530501","Bookshop":"https://bookshop.org/a/19558/9780374530501","coverarturl":"https://images-na.ssl-images-amazon.com/images/I/41yylsTaIBL.jpg","bookid":"26120","publicationdate":"2006-08-22 00:00:00"},{"title":"The Riddle-Master of Hed","shorttitle":"The Riddle-Master of Hed","authorstring":"Patricia A. McKillip","description":"For over twenty years, World Fantasy Award winner Patricia A. McKillip has captured the hearts and imaginations of thousands of readers. Now at last her renowned Riddle-Master trilogy–The Riddle-Master of Hed, Heir of Sea and Fire, and Harpist in the Wind–long out of print, is collected in one volume.\n\nIt is considered her most enduring and beloved work. Now it is collected in one volume for the first time–the epic journeys of a young prince in a strange land, where wizards have long since vanished...but where magic is waiting to be reborn.","descriptionHtml":"For over twenty years, World Fantasy Award winner Patricia A. McKillip has captured the hearts and imaginations of thousands of readers. Now at last her renowned Riddle-Master trilogy–The Riddle-Master of Hed, Heir of Sea and Fire, and Harpist in the Wind–long out of print, is collected in one volume.

It is considered her most enduring and beloved work. Now it is collected in one volume for the first time–the epic journeys of a young prince in a strange land, where wizards have long since vanished...but where magic is waiting to be reborn.","isbn":"B005KEAXBM","amazonurl":"http://www.amazon.com/Riddle-Master-Hed-Pat-McKillip/dp/B005KEAXBM?linkCode=ll1&tag=codexmap-20&linkId=8d37aaf25f3947e1637a2ada957a9c8f&ref_=as_li_ss_tl","HawaiiProject":"https://www.thehawaiiproject.com/book/The-Riddle-Master-of-Hed--by--Patricia-A.-McKillip--233949","tbr":"https://tbrapp.co/book/233949","AppleBooks":"https://goto.applebooks.apple/9780441005963","BarnesNoble":"https://www.barnesandnoble.com/s/B005KEAXBM","Bookshop":"https://bookshop.org/a/19558/9780441005963","coverarturl":"https://images-na.ssl-images-amazon.com/images/I/413VXGO6XhL.jpg","bookid":"233949","publicationdate":"1999-03-01 00:00:00"},{"title":"The Hitman's Guide to Housecleaning","shorttitle":"The Hitman's Guide to Housecleaning","authorstring":"Hallgrimur Helgason","description":"With some 66 hits under his belt, Tomislav Bokšić, or Toxic, has a flawless record as hitman for the Croatian mafia in New York. That is, until he kills the wrong guy and is forced to flee the States, leaving behind the life he knows and loves. Suddenly, he finds himself on a plane hurtling toward Reykjavik, Iceland, borrowing the identity of an American televangelist named Father Friendly. With no means of escape from this island devoid of gun shops and contract killing, tragicomic hilarity ensues as he is forced to come to terms with his bloody past and reevaluate his future.","descriptionHtml":"With some 66 hits under his belt, Tomislav Bokšić, or Toxic, has a flawless record as hitman for the Croatian mafia in New York. That is, until he kills the wrong guy and is forced to flee the States, leaving behind the life he knows and loves. Suddenly, he finds himself on a plane hurtling toward Reykjavik, Iceland, borrowing the identity of an American televangelist named Father Friendly. With no means of escape from this island devoid of gun shops and contract killing, tragicomic hilarity ensues as he is forced to come to terms with his bloody past and reevaluate his future.","isbn":"161109139X","amazonurl":"https://www.amazon.com/Hitmans-Guide-Housecleaning-Hallgrimur-Helgason/dp/161109139X?linkCode=ll1&tag=codexmap-20&linkId=8d37aaf25f3947e1637a2ada957a9c8f&ref_=as_li_ss_tl","HawaiiProject":"https://www.thehawaiiproject.com/book/The-Hitmans-Guide-to-Housecleaning--by--Hallgrimur-Helgason--22140","tbr":"https://tbrapp.co/book/22140","AppleBooks":"https://goto.applebooks.apple/9781611091397","BarnesNoble":"https://www.barnesandnoble.com/s/161109139X","Bookshop":"https://bookshop.org/a/19558/9781611091397","coverarturl":"https://images-na.ssl-images-amazon.com/images/I/51hzkljAmcL.jpg","bookid":"22140","publicationdate":"2012-01-24 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'); 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);