Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                 <!DOCTYPE html>
<html lang="en">
    <title>Coding for publishers</title>
    <link href=",700" rel="stylesheet">
    <link href="" rel="stylesheet">
      <img id="cover"/>
      <h2  id="title">[words will go here]</h2>

          <li id="isbn">ISBN: </li>
          <li id="pub-date">Pub date: </li>
          <li id="page-count">Page count</li>
          <li id="rating">Google rating: </li>
          <li id="authors">[contributors will go here]</li>

        <h3 id="error"></h3>
        <h1>About the book</h1>
        <div id="blurb">[blurb will go here]</div>
        <div id="google-link">Link: </div>
        <div id="reader-link">Start reading: </div>

      <input type="button" id="create-ai-button" value="Create AI">
      <p>Created using the Google Books API, by publishers who code, at the London Book Fair 2019</p>



                * {
  box-sizing: border-box;

body {
  font-family: 'Montserrat';
/*   font-family: 'Permanent Marker'; */
  line-height: 1.4;
  color: dark-grey;
  display: flex;
  min-height: 100vh;
  flex-direction: column;

header {
  border-bottom: 10px solid DarkViolet;
  padding: 30px;
  text-align: center;
  font-size: 35px;
  display: flex;
  flex-wrap: wrap;
  background: #F5F2EF;

#cover {
  border: 2px solid black;
  height: 250px;

img {
  width: auto;
  height: auto;

#authors {
  font-size: 15px;

h2 {
  flex: 1;
  display: inline-flex;
  padding-left: 90px;
  text-align: left;

section {  
  display: flex;
  flex-wrap: wrap;
  flex: 1;

nav {
  height: 300px;
  padding: 20px;
  flex: 25%;

nav ul {
  list-style-type: none;
  padding: 0;

article {
  padding: 20px;
  height: 300px;
  flex: 70%;

footer {
  display: flex;
  flex-wrap: wrap;
  background-color: #24211E;
  padding: 10px;
  text-align: center;
  color: white;
  font-size: 12px;

#create-ai-button {
  float: left;
  padding: 10px;
  border-radius: 3px;
  background-color: #F5F2EF;
  font-weight: bold;
  font-size: 18px;

p {
  padding-left: 20px;

#error {
  font-size: 40px;
  color: red; 

@media screen and (max-width: 700px) {
  section {
    flex-direction: column;



                document.getElementById("create-ai-button").addEventListener("click", () => {
    .then(response => response.json())
    .then(result => {
      const bookData           = result.items[0].volumeInfo
      const accessData 				 = result.items[0].accessInfo
      const coverUrl           = document.getElementById("cover")
      const titleElement       = document.getElementById("title")
      const authorsElement     = document.getElementById("authors")
      const blurbElement       = document.getElementById("blurb")
      const pubDateElement     = document.getElementById("pub-date")
      const pageCountElement   = document.getElementById("page-count")
      const ratingElement      = document.getElementById("rating")
      const isbnElement        = document.getElementById("isbn")
      const googleLinkElement  = document.getElementById("google-link")
			const readerLinkElement  = document.getElementById("reader-link")

      coverUrl.src             = bookData.imageLinks.thumbnail
      titleElement.innerHTML   = bookData.title
      blurbElement.innerHTML   = bookData.description
      authorsElement.innerHTML = bookData.authors
      pubDateElement.insertAdjacentHTML("beforeEnd", bookData.publishedDate)
      isbnElement.insertAdjacentHTML("beforeEnd", bookData.industryIdentifiers[1].identifier)
      ratingElement.insertAdjacentHTML("beforeEnd", bookData.averageRating)
      pageCountElement.textContent = bookData.pageCount + ' pages'
      googleLinkElement.innerHTML =
        `<a href="${result.items[0].selfLink}",  target = "_blank">View source</a>`
      readerLinkElement.innerHTML =
        `<a href="${accessData.webReaderLink}", target = "_blank">Start reading ${accessData.accessViewStatus}→</a>`

    .catch(error => {
      document.getElementById("error").innerHTML = error.message