Skip to content

Commit

Permalink
Merge branch 'pr/24'
Browse files Browse the repository at this point in the history
  • Loading branch information
aryad14 committed Oct 31, 2023
2 parents c97511e + 44b77b3 commit 5db6a2f
Show file tree
Hide file tree
Showing 8 changed files with 389 additions and 0 deletions.
199 changes: 199 additions & 0 deletions css/books.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
* {
margin: 0;
padding: 0;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

:root {
--primary-color: #aa5040;
--text-color-light: #ededed;
}

header {
background-color: var(--primary-color);
padding: 10px;
}

#navbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
}

#navbar h2 {
margin: 0;
}

#navbar ul {
list-style-type: none;
display: flex;
margin-left: auto;
}

#navbar ul li {
margin-left: 16px;
}

#navbar ul li a {
text-decoration: none;
color: var(--text-color-light);
}

.welcome {
background-color: var(--text-color-light);
padding: 20px;
text-align: center;
}

.search {
text-align: center;
padding: 20px;
}

.search input[type="text"] {
padding: 10px;
width: 190px;
border-radius: 10px;
}

.search button[type="submit"] {
padding: 10px 20px;
background-color: #333;
color: var(--text-color-light);
border: none;
cursor: pointer;
border-radius: 10px;
}

/* Featured books section styles */
.featured-books {
padding: 20px;
overflow: hidden;
text-align: center;
}

.featured-books h2 {
margin-bottom: 10px;
padding: 10px;
}

.img1 {
width: 150px;
display: flex;
}

.img1 img {
width: 100%;
padding: 10px;
float: left;
box-sizing: border-box;
}

/* Footer styles */
footer {
background-color: var(--primary-color);
padding: 10px;
text-align: center;
position: static;
}

.contact-info p {
margin-bottom: 10px;
color: var(--text-color-light);
}

.static-pages ul {
list-style-type: none;
}

.static-pages ul li {
display: inline;
margin-right: 10px;
}

.static-pages ul li a {
text-decoration: none;
color: var(--text-color-light);
}

.book-img {
float: left;
}

.book-img {
max-width: 100%;
height: auto;
}

.add-to-cart-button {
background-color: var(--primary-color);
color: #fff;
padding: 5px 11px;
border: none;
cursor: pointer;
border-radius: 5px;
font-size: 14px;
margin-top: 8px;
}

.img1 {
padding: 20px;
display: -webkit-box;
}
.book-container {
text-align: center;
margin: 10px;
}
#cart {
top: -360px;
border: 1px solid #ddd;
padding: 10px;
border-radius: 5px;
background-color: #f5f5f5;
width: 300px;
height: 300px; /* Set a fixed height for the cart container */
overflow-y: auto;
float: right;
position: relative;
}
#cart h2 {
font-size: 24px;
margin: 0;
color: #333;
border-bottom: 1px solid #ccc;
padding-bottom: 10px;
}
#cart-items {
list-style-type: none;
padding: 0;
}
#cart-items li {
font-size: 18px;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
#cart-items img {
max-width: 50px;
max-height: 75px;
}
.checkout-button {
background-color: #4CAF50;
color: white;
border: none;
padding: 10px 15px;
cursor: pointer;
border-radius: 5px;
transition: background-color 0.3s ease;
margin-top: 10px;
}
.checkout-button:hover {
background-color: #45a049;
}
5 changes: 5 additions & 0 deletions css/contact.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
box-sizing: border-box;
font-family: 'poppins',sans-serif;
}

/**
asdfsaf
*/
.contact-form{
position: relative;
min-height: 100vh;
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ <h2>Featured Books</h2>
<img class="book-img" src="static/book1.jpeg">
<img class="book-img" src="static/book2.jpeg">
<img class="book-img" src="static/book3.jpeg">
<img class="book-img" src="static/book4.jpeg">
</div>
</section>
</main>
Expand Down
47 changes: 47 additions & 0 deletions js/navbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
window.addEventListener('DOMContentLoaded', () => {
const navbarDiv = document.getElementById('navbar');
const nav = document.createElement('nav');
nav.style.backgroundColor = '#aa5040';
nav.style.padding = '5px';
nav.style.textDecoration = 'none';
nav.style.textDecorationColor = '#ffff';

nav.innerHTML = `
<ul style="display: flex; justify-content: space-between; align-items: center;">
<li>
<strong style="font-weight: bold; color: black; font-size: 20px;">E-library</strong>
</li>
<li style="display: inline; margin-left: auto;">
<a href="../index.html" class="nav-link">Home</a>
</li>
<li style="display: inline; margin-left: 10px;">
<a href="books.html" class="nav-link">Books</a>
</li>
<li style="display: inline; margin-left: 10px;">
<a href="about-us.html" class="nav-link">About Us</a>
</li>
<li style="display: inline; margin-left: 10px;">
<a href="contact.html" class="nav-link">Contact</a>
</li>
<li style="display: inline; margin-left: 10px;">
<a href="login.html" class="nav-link">Log In</a>
</li>
</ul>
`;

const navLinks = nav.querySelectorAll('a.nav-link');
navLinks.forEach(link => {
link.style.color = '#ededed';
link.style.textDecoration = 'none';
});

navbarDiv.appendChild(nav);

// Add CSS styles to make text bold
const navLinksNew = nav.querySelectorAll('.nav-link');
navLinksNew.forEach(link => {
link.style.textDecoration = 'none';
link.style.color = 'white';
link.style.marginRight = '10px'; // Add margin to the right
});
});
Loading

0 comments on commit 5db6a2f

Please sign in to comment.