-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>PDF Viewer</title> | ||
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>PDF Viewer</h1> | ||
<ul id="pdf-list"></ul> | ||
</div> | ||
|
||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
document.addEventListener("DOMContentLoaded", function() { | ||
const pdfList = document.getElementById("pdf-list"); | ||
|
||
// Fetch the list of PDF files from the API | ||
fetch("https://fastapi-wt2k.onrender.com/pdfs/") | ||
.then(response => response.json()) | ||
.then(data => { | ||
const pdfFiles = data.pdf_files; | ||
pdfFiles.forEach(file => { | ||
const listItem = document.createElement("li"); | ||
const link = document.createElement("a"); | ||
link.href = `https://fastapi-wt2k.onrender.com/pdfs/${file}`; | ||
link.textContent = file; | ||
listItem.appendChild(link); | ||
pdfList.appendChild(listItem); | ||
}); | ||
}) | ||
.catch(error => { | ||
console.error("Error fetching PDF files:", error); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f4f4f4; | ||
margin: 0; | ||
padding: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
} | ||
|
||
.container { | ||
background-color: #fff; | ||
padding: 20px; | ||
border-radius: 8px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
text-align: center; | ||
} | ||
|
||
h1 { | ||
margin-bottom: 20px; | ||
} | ||
|
||
ul { | ||
list-style-type: none; | ||
padding: 0; | ||
} | ||
|
||
li { | ||
margin: 10px 0; | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
color: #007bff; | ||
font-weight: bold; | ||
} | ||
|
||
a:hover { | ||
text-decoration: underline; | ||
} |