Skip to content

Instantly share code, notes, and snippets.

@CastonPursuit
Last active March 25, 2024 13:20
Show Gist options
  • Save CastonPursuit/dcc4053ce7293b4c248a75b1d0daa0d6 to your computer and use it in GitHub Desktop.
Save CastonPursuit/dcc4053ce7293b4c248a75b1d0daa0d6 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="style.css" />
    <script
      src="https://kit.fontawesome.com/8695b27503.js"
      crossorigin="anonymous"
    ></script>
  </head>
  <body>
    <div class="parent">
      <div class="child title_section">
        <p class="title">Booktory</p>
      </div>
      <div class="child book_table" id="book_table">
        <div class="book">
          <img src="./bkexample.png" />
          <div class="book_info">
            <div class="book_title">Friday I'm In Love</div>
            <div class="book_author">Camryn Garrett</div>
            <div class="book_available">In Stock</div>
            <div class="book_price">$18.99</div>
          </div>
          <div class="fa-regular fa-trash-can" id="remove"></div>
        </div>
        <div class="book">
          <img src="./bkexample2.png" />
          <div class="book_info">
            <div class="book_title">Principles</div>
            <div class="book_author">Ray Dalio</div>
            <div class="book_available">In Stock</div>
            <div class="book_price">$18.99</div>
          </div>
          <div class="fa-regular fa-trash-can" id="remove"></div>
        </div>
        <div class="book">
          <img src="./bkexample3.png" />
          <div class="book_info">
            <div class="book_title">The Women</div>
            <div class="book_author">Kristin Hannah</div>
            <div class="book_available">In Stock</div>
            <div class="book_price">$30.00</div>
          </div>
          <div class="fa-regular fa-trash-can" id="remove"></div>
        </div>
        <div class="book">
          <img src="./bkexample4.png" />
          <div class="book_info">
            <div class="book_title">The Left Hand Of Darkness</div>
            <div class="book_author">Ursula K Le Guin,  David Mitchell,  Charlie Jane Anders  </div>
            <div class="book_available">In Stock</div>
            <div class="book_price">$19.00</div>
          </div>
          <div class="fa-regular fa-trash-can" id="remove"></div>
        </div>
      </div>
      <div class="child form_section">
        <form class="form">
          <input
            class="input title"
            id="title-value"
            type="text"
            placeholder="Title"
            value=""
            required
          />
          <input
            class="input author"
            id="author-value"
            type="text"
            placeholder="Author"
            value=""
            required
          />
          <input
            class="input image"
            id="image-value"
            type="text"
            placeholder="Image URL"
            value=""
            required
          />
          <input
            class="input price"
            id="price-value"
            type="text"
            placeholder="Price"
            value=""
            required
          />
          <select class="input" id="in-stock" type="text" name="inStock">
            <option value="yes">In Stock</option>
            <option value="no">Out Of Stock</option>
          </select>
          <button id="book-btn" type="submit">Add Book</button>
        </form>
        <div id="notificationArea"></div>
      </div>
    </div>
    <script type="module" src="script.js"></script>
  </body>
</html>
@import url('https://fonts.googleapis.com/css2?family=Inter:[email protected]&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

 html, body{
    width: 100%;
    max-height: 100%; /* This ensures the body takes up exactly the height of the viewport */
    overflow: hidden; /* Prevent horizontal overflow */
    position: relative;
    margin: 0;
    padding: 0;
}

.parent {
    
    background-color: #F2EDE6;
    width: 100vw;
    height: 100vh; 
    overflow: hidden;
    display: grid;
    grid-template-columns: 0.2fr 0.7fr 1fr;
    column-gap: 5%;
}



.child.title_section  {
    font-size: 50px;
    position: relative;
    
}

.child.title_section p {
    position: absolute;
    font-size: larger;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    top: 40%;
    left: 25%;
    color: #00054B;
}



.child.book_table{
   border-bottom: 1px #00054B solid ; 
   display: grid;
   grid-auto-rows: 0.25fr;
   max-height: auto;
   width: 100%;
   overflow-y: auto;
   row-gap: 2%;
   margin-top: 5%;

}

.book {
    display: grid;
    grid-template-columns: 0.25fr 0.75fr 0.25fr;
    margin: 0; 
    padding: 0; 
    border-bottom: 1.5px solid black; 
    height: fit-content;
    min-width: 75%;
}

.book img {
    width: 100%; 
    height: 80%;
    object-fit: cover;
    margin-top: 10%; 
}
.book .book_info {
    position: relative;
    margin: 10%;
    margin-bottom: 15%;
    width: 100%;
    
}

.book .book_title {
    color:#00054B;
    font-size: 25px;
    margin-right: 5%;
    width: 100%;
}

.book .book_author{
    margin-top: 5px;
    margin-bottom: 5px;
    margin-right: 5%;
    
}



.book .book_available {
    background-color: green; 
    color: #fff; 
    padding: 5px 10px; 
    border-radius: 10px;
    font-size: 10px; 
    display: inline-block; 
    text-align: center;   
    font-weight: 100;  
}

.book .book_price {
    font-size: 24px;
    font-weight: 600;
    margin-top: 5%;
    color: #00054B;
}


.fa-trash-can {
    margin-top: 50%;
    margin-left: 50%;
    font-size: 30px;
    font-weight: 500;

}

.form {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: center;
    margin-top: 25%;
    border-left: 2px solid #00054B;


}

.form_section .form {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    row-gap: 25px;
}

.form_section .form .input[type="text"] {
    background-color: transparent; 
    border: none; 
    border-bottom: 2.5px solid #030a75; 
    outline: none; 
    width: 45%;
    padding: 10px 0; 
    margin: 5px 0; 
    font-size: 20px;
    font-weight: 100;
}

.form_section .form .input::placeholder {
    color: gray; 
    opacity: 0.5;

} 

select{
    color: rgba(128, 128, 128, );
    border: none;
    position: relative;
    display: inline-block;
} 



.form_section .form button { 
    background-color: #00054B;
    color: white;
    padding: 10px;
    width: 40%;
    border-radius: 25px;
    font-size: large;
    font-family: "Montserrat", sans-serif;
    font-weight: 400;

}

#notificationArea {
    color: red;
    margin: 10px 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment