Skip to content

Commit

Permalink
final commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sande88 committed Jun 4, 2024
1 parent 956848f commit fd2785b
Show file tree
Hide file tree
Showing 9 changed files with 192 additions and 117 deletions.
1 change: 0 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class Book(db.Model):
title = db.Column(db.String(150), nullable=False)
description = db.Column(db.String(500), nullable=False)
blob_name = db.Column(db.String(150), nullable=False)
# cover_image_blob_name = db.Column(db.String(150), nullable=True)

with app.app_context():
db.create_all()
Expand Down
Binary file modified books.db
Binary file not shown.
5 changes: 5 additions & 0 deletions static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -647,3 +647,8 @@
align-items: center;

}

.activenavbar a.active{
color: #d72df5;

}
138 changes: 50 additions & 88 deletions static/css/upload.css
Original file line number Diff line number Diff line change
@@ -1,89 +1,51 @@
/* Reset some default styles */
body, h1, label {
margin: 0;
padding: 0;
box-sizing: border-box;
}

/* Set a funky background for the body */
body {
font-family: 'Arial', sans-serif;
background: linear-gradient(135deg, #010101, #000000);
color: white;
/* display: flex; */
/* justify-content: center; */
/* align-items: center; */
/* height: 100vh; */
}

/* Container styles */
.container {
background: rgb(23, 231, 151);
backdrop-filter: blur(10px);
padding: 2em;
border-radius: 15px;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
/* width: 20%; */
/* width: 100px; */
/* max-width: 600px; */
text-align: center;
align-items: center;
animation: float 6s ease-in-out infinite;
}

/* Heading styles */
h1 {
font-size: 2.5em;
margin-bottom: 0.5em;
color: #00fbff;
text-shadow: 2px 2px #ff0099;
}

/* Form styles */
form {
display: flex;
flex-direction: column;
gap: 1em;
width: 50%;
}

/* Label styles */
label {
font-size: 1.2em;
color: #000000;
/* text-align: right; */
/* Align labels to the right */
width: 30%; /* Set a fixed width for labels */
display: inline-block; /* Ensure labels and inputs are on the same line */
margin-bottom: 0.3em;
}

/* Input and textarea styles */
input[type="text"], input[type="file"], textarea {
padding: 0.7em;
border: none;
border-radius: 8px;
outline: none;
font-size: 1em;
color: #333;
background: #ffffff;
transition: transform 0.3s ease;
width: 70%; /* Set a fixed width for inputs */
display: inline-block; /* Ensure labels and inputs are on the same line */
}

input[type="text"]:focus, input[type="file"]:focus, textarea:focus {
transform: scale(1.05);
}



/* Keyframes for floating animation */
@keyframes float {
0%, 100% {
transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
}
body {
background-color: #318eeb;
}
.container {
background: #ffffff;
border-radius: 10px;
box-shadow: 0 4px 8px black;
padding: 30px;
margin-top: 50px;
}
h1 {
font-family: 'Georgia', serif;
font-size: 36px;
color: black;
margin-bottom: 30px;
}
label {
font-weight: bold;
color: #495057;
}
.form-control, .form-control-file {
border-radius: 5px;
}
button {
background-color: #007bff;
border: none;
border-radius: 5px;
padding: 10px 20px;
font-size: 16px;
transition: background-color 0.3s;
}
button:hover {
background-color: #0056b3;
}


.custom-textarea {
height: 150px;
resize: none;
padding: 10px;
font-size: 16px;
border: 1px solid #ced4da;
border-radius: 5px;
transition: border-color 0.3s, box-shadow 0.3s;
}
.custom-textarea:focus {
border-color: #80bdff;
box-shadow: 0 0 5px rgba(0, 123, 255, 0.25);
}

28 changes: 13 additions & 15 deletions templates/Books.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ <h2 class="logotext">Open lib</h2>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse " id="navbarCollapse">
<div class="navbar-nav ms-auto p-4 p-lg-0">
<div class="navbar-nav ms-auto p-4 p-lg-0 activenaavbar">
<a href="/" class="nav-item nav-link">Home</a>
<a href="/books" class="nav-item nav-link">Books</a>
<a href="/books" class="nav-item nav-link active">Books</a>
<a href="/upload" id="uploadbutton" class="nav-item nav-link">upload</a>
<a href="/contact" class="nav-item nav-link">Contact</a>
<a href="/chat" class="nav-item nav-link">Chat</a>
Expand Down Expand Up @@ -106,20 +106,18 @@ <h2 class="logotext">Open lib</h2>
</div>
</div>

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<!-- JavaScript Libraries -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="/static/lib/wow/wow.min.js"></script>
<script src="/static/lib/easing/easing.min.js"></script>
<script src="/static/lib/waypoints/waypoints.min.js"></script>
<script src="/static/lib/owlcarousel/owl.carousel.min.js"></script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="/static/lib/wow/wow.min.js"></script>
<script src="/static/lib/easing/easing.min.js"></script>
<script src="/static/lib/waypoints/waypoints.min.js"></script>
<script src="/static/lib/owlcarousel/owl.carousel.min.js"></script>

<!-- Template Javascript -->
<script src="/static/js/main.js"></script>
<script src="/static/js/login.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>

<!-- Template Javascript -->
<script src="/static/js/main.js"></script>
<script src="/static/js/login.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>

</body>
</html>
69 changes: 68 additions & 1 deletion templates/chat.html
Original file line number Diff line number Diff line change
@@ -1 +1,68 @@
<iframe src='https://webchat.botframework.com/embed/openlibrary-bot?s=7_wunD2Q4hk.eaH4VLfAK0DqxS8IYs6YoOowVK0WrBpWTRmPVdXylVQ' style='min-width: 400px; width: 100%; min-height: 500px;'></iframe>


<!DOCTYPE html>
<html>
<head>
<title>Upload PDF</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link href="/static/img/books-svgrepo-com.svg" rel="icon">

<!-- Google Web Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Sedan+SC&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" />


<!-- Icon Font Stylesheet -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" rel="stylesheet">

<!-- Libraries Stylesheet -->
<link href="/static/lib/animate/animate.css" rel="stylesheet">
<link href="/static/lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">

<!-- Customized Bootstrap Stylesheet -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">

<!-- Template Stylesheet -->
<link href="/static/css/style.css" rel="stylesheet">
<link rel="stylesheet" href="/static/css/custom.css">
<link rel="stylesheet" href="/static/css/upload.css">

</head>
<body>
<nav class="navbar navbar-expand-lg bg-white navbar-light sticky-top p-0">
<a href="/" class="navbar-brand d-flex align-items-center px-4 px-lg-5">
<img class="mainlogo" src="/static/img/books-svgrepo-com.svg" alt="">
<h2 class="logotext">Open lib</h2>
</a>
<button type="button" class="navbar-toggler me-4" data-bs-toggle="collapse" data-bs-target="#navbarCollapse">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse " id="navbarCollapse">
<div class="navbar-nav ms-auto p-4 p-lg-0 activenavbar">
<a href="/" class="nav-item nav-link">Home</a>
<a href="/books" class="nav-item nav-link">Books</a>
<a href="/upload" id="uploadbutton" class="nav-item nav-link">upload</a>
<a href="/contact" class="nav-item nav-link">Contact</a>
<a href="/chat" class="nav-item nav-link active">Chat</a>
<a href=""></a>
</div>
<a href="/signup"><button id="loginformbutton" class="button5">Signup</button></a>
<button class="button5" id="logoutformbutton">Logout</button>
</div>
</nav>

<iframe src='https://webchat.botframework.com/embed/openlibrary-bot?s=7_wunD2Q4hk.eaH4VLfAK0DqxS8IYs6YoOowVK0WrBpWTRmPVdXylVQ' style='min-width: 400px; width: 100%; min-height: 500px;'></iframe>


<!-- Bootstrap JS and dependencies -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="/static/js/login.js"></script>

</body>
</html>
4 changes: 2 additions & 2 deletions templates/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ <h2 class="logotext">Open Lib</h2>
<button type="button" class="navbar-toggler me-4" data-bs-toggle="collapse" data-bs-target="#navbarCollapse">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse " id="navbarCollapse">
<div class="collapse navbar-collapse activenavbar " id="navbarCollapse">
<div class="navbar-nav ms-auto p-4 p-lg-0">
<a href="/" class="nav-item nav-link">Home</a>
<a href="/books" class="nav-item nav-link">Books</a>
<a href="/contact" class="nav-item nav-link">Contact</a>
<a href="/contact" class="nav-item nav-link active">Contact</a>
<a href="/chat" class="nav-item nav-link">Chat</a>
</div>
<a href="/signup"><button id="loginformbutton" class="button5">Signup</button></a>
Expand Down
4 changes: 2 additions & 2 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ <h2 class="logotext">Open lib</h2>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse " id="navbarCollapse">
<div class="navbar-nav ms-auto p-4 p-lg-0">
<a href="/" class="nav-item nav-link">Home</a>
<div class="navbar-nav ms-auto p-4 p-lg-0 activenavbar">
<a href="/" class="nav-item nav-link active">Home</a>
<a href="/books" class="nav-item nav-link">Books</a>
<a href="/contact" class="nav-item nav-link">Contact</a>
<a href="/chat" class="nav-item nav-link">Chat</a>
Expand Down
60 changes: 52 additions & 8 deletions templates/upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,68 @@
<title>Upload PDF</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link href="/static/img/books-svgrepo-com.svg" rel="icon">

<!-- Google Web Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Sedan+SC&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" />


<!-- Icon Font Stylesheet -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" rel="stylesheet">

<!-- Libraries Stylesheet -->
<link href="/static/lib/animate/animate.css" rel="stylesheet">
<link href="/static/lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">

<!-- Customized Bootstrap Stylesheet -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">

<!-- Template Stylesheet -->
<link href="/static/css/style.css" rel="stylesheet">
<link rel="stylesheet" href="/static/css/custom.css">
<link rel="stylesheet" href="/static/css/upload.css">

</head>
<body>
<nav class="navbar navbar-expand-lg bg-white navbar-light sticky-top p-0">
<a href="/" class="navbar-brand d-flex align-items-center px-4 px-lg-5">
<img class="mainlogo" src="/static/img/books-svgrepo-com.svg" alt="">
<h2 class="logotext">Open lib</h2>
</a>
<button type="button" class="navbar-toggler me-4" data-bs-toggle="collapse" data-bs-target="#navbarCollapse">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse " id="navbarCollapse">
<div class="navbar-nav ms-auto p-4 p-lg-0 activenavbar">
<a href="/" class="nav-item nav-link">Home</a>
<a href="/books" class="nav-item nav-link">Books</a>
<a href="/upload" id="uploadbutton" class="nav-item nav-link active">upload</a>
<a href="/contact" class="nav-item nav-link">Contact</a>
<a href="/chat" class="nav-item nav-link">Chat</a>
<a href=""></a>
</div>
<a href="/signup"><button id="loginformbutton" class="button5">Signup</button></a>
<button class="button5" id="logoutformbutton">Logout</button>
</div>
</nav>
<div class="container">
<h1 class="mt-5">Upload PDF</h1>
<h1 class="mt-5">Upload Book</h1>
<form action="/uploadbooks" method="post" enctype="multipart/form-data">
<div class="form-group">
<label for="title">Title</label>
<input type="text" name="title" class="form-control" required>
<input type="text" name="title" class="form-control" id="title" placeholder="Enter Your Title" required>
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea name="description" class="form-control" required></textarea>
<textarea name="description" class="form-control custom-textarea" id="description" required></textarea>
</div>
<!-- <div class="form-group">
<label for="cover_image">Cover Image</label>
<input type="file" name="cover_image" class="form-control-file" required>
</div> -->
<div class="form-group">
<label for="file">File</label>
<input type="file" name="file" class="form-control-file" required>
<input type="file" name="file" class="form-control-file" id="file" required>
</div>
<button type="submit" class="btn btn-primary">Upload</button>
</form>
Expand All @@ -33,5 +75,7 @@ <h1 class="mt-5">Upload PDF</h1>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="/static/js/login.js"></script>

</body>
</html>

0 comments on commit fd2785b

Please sign in to comment.