Skip to content

Commit 700fb32

Browse files
Merge branch 'main' into 202
2 parents 82250d4 + 3f0f127 commit 700fb32

22 files changed

Lines changed: 7933 additions & 6794 deletions

‎.env.example‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,3 @@ PURCHASE_LINKS_MAX_RETRIES=3
100100
PURCHASE_LINKS_RETRY_DELAY=1.0
101101
PURCHASE_LINKS_MAX_CONCURRENT=4
102102
PURCHASE_LINKS_LOG_LEVEL=INFO
103-
>>>>>>> main

‎.github/CODEOWNERS‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
GITHUB_ISSUES.md
2+
.github/CODEOWNERS.md
23

34
# Mood analysis cache files
45
mood_analysis/mood_cache.json

‎404.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Page Not Found | BiblioDrift</title>
88
<link rel="stylesheet" href="style.css" />
9+
<link rel="stylesheet" href="style-responsive.css" />
910

1011
<!-- Fonts -->
1112
<link rel="preconnect" href="https://fonts.googleapis.com" />

‎CONTRIBUTING.md‎

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,67 @@ Enhancement suggestions are tracked as GitHub issues. Only recommendations that
6161

6262
## 📥 Pull Request Process
6363

64-
1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
65-
2. Update the `README.md` with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.
66-
3. Increase the version numbers in any example files and the README.md to the new version that this Pull Request would represent.
67-
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you.
64+
To keep the project organized and maintain high-quality contributions, please follow the process below before submitting a pull request.
65+
66+
### 1️⃣ Prepare Your Changes
67+
68+
Before creating a pull request:
69+
70+
* Ensure your code runs correctly and does not introduce errors.
71+
* Remove any unnecessary files such as temporary files, logs, or build artifacts.
72+
* Make sure dependencies are clean and only required packages remain.
73+
74+
### 2️⃣ Keep the Project Clean
75+
76+
* Avoid committing compiled files, node modules, or environment-specific files.
77+
* Ensure your code follows the project's existing structure and naming conventions.
78+
* Test the application locally to verify that everything works as expected.
79+
80+
### 3️⃣ Update Documentation
81+
82+
If your changes affect the system, make sure to update the documentation:
83+
84+
* Update the **README.md** with clear explanations of the changes.
85+
* Document any new environment variables, configuration steps, or setup instructions.
86+
* Mention any new folders, APIs, or features introduced in your contribution.
87+
88+
### 4️⃣ Version Updates
89+
90+
If your contribution introduces noticeable improvements:
91+
92+
* Update version numbers where applicable.
93+
* Mention the version update in the README or relevant configuration files.
94+
* Provide a short summary of what changed in that version.
95+
96+
### 5️⃣ Write a Clear Pull Request
97+
98+
When submitting your PR:
99+
100+
* Use a clear and meaningful title.
101+
* Provide a detailed description explaining what your changes do.
102+
* Reference related issues if applicable.
103+
* Add screenshots or examples when UI changes are involved.
104+
105+
### 6️⃣ Code Review Process
106+
107+
* Your pull request will be reviewed by project maintainers.
108+
* Be open to feedback and make necessary improvements if requested.
109+
* Ensure that your contribution aligns with the project's goals and coding standards.
110+
111+
### 7️⃣ Approval and Merge
112+
113+
* Once your PR receives approval from at least **two maintainers or reviewers**, it can be merged.
114+
* If you do not have merge permissions, a maintainer will merge it for you after approval.
115+
* Make sure all checks and discussions are resolved before requesting a merge.
116+
117+
### 8️⃣ After Merge
118+
119+
After your pull request is merged:
120+
121+
* Pull the latest changes from the main branch.
122+
* Continue contributing by working on new issues or improvements.
123+
* Help review other contributions if possible.
124+
68125

69126
## 🎨 Code Style
70127

‎TUTORIAL.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ Welcome to BiblioDrift! This comprehensive tutorial will guide you through disco
66

77
BiblioDrift is more than just a book finder—it's a sanctuary for readers who discover books through emotions and vibes rather than rigid categories. Imagine wandering through a warm, quiet bookstore where books practically whisper their stories to you.
88

9+
10+
## Why BiblioDrift is Different
11+
12+
Unlike traditional platforms that focus heavily on categories and algorithms, BiblioDrift emphasizes:
13+
14+
🎨 Visual-first discovery – Explore beautiful book covers and curated collections
15+
16+
💫 Emotion-based browsing – Find books by how you feel, not just by genre
17+
18+
📖 Curated recommendations – Thoughtfully selected reads instead of endless scrolling
19+
20+
🧘 Calm, cozy experience – A distraction-free space designed for mindful browsing
21+
22+
It’s not about finding the most popular book.
23+
It’s about finding the right book for you.
24+
25+
926
### Core Philosophy
1027
- **"Zero UI Noise"**: Clean, distraction-free browsing experience
1128
- **Tactile Interaction**: 3D books you can pull from shelves and flip over

‎app.js‎

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,28 @@ class BookRenderer {
128128
const scene = document.createElement('div');
129129
scene.className = 'book-scene';
130130

131+
// Badge Logic
132+
let badgesHTML = '';
133+
const isNew = bookData.date_added && (new Date() - new Date(bookData.date_added)) < (7 * 24 * 60 * 60 * 1000);
134+
const isPopular = volumeInfo.ratingsCount && volumeInfo.ratingsCount > 1000;
135+
136+
if (isNew || isPopular || categories.length > 0) {
137+
badgesHTML += '<div class="book-badge-container">';
138+
if (isNew) badgesHTML += '<span class="book-badge badge-new">New</span>';
139+
if (isPopular) badgesHTML += '<span class="book-badge badge-popular">Popular</span>';
140+
if (categories.length > 0) {
141+
const mainGenre = categories[0].split(' / ')[0]; // Take first category part
142+
badgesHTML += `<span class="book-badge badge-genre" title="${mainGenre}">${mainGenre}</span>`;
143+
}
144+
badgesHTML += '</div>';
145+
}
146+
131147
// Load flip sound
132148
const flipSound = new Audio('assets/sounds/page-flip.mp3');
133149
flipSound.volume = 0.5;
134150

135151
scene.innerHTML = `
152+
${badgesHTML}
136153
<div class="book" data-id="${id}">
137154
<div class="book__face book__face--front">
138155
<img src="${thumb.replace('http:', 'https:')}" alt="${title}">
@@ -282,7 +299,8 @@ class BookRenderer {
282299
if (!container) return;
283300
try {
284301
const keyParam = GOOGLE_API_KEY ? `&key=${GOOGLE_API_KEY}` : '';
285-
const res = await fetch(`${API_BASE}?q=${query}&maxResults=${maxResults}&printType=books${keyParam}`);
302+
const encodedQuery = encodeURIComponent(query);
303+
const res = await fetch(`${API_BASE}?q=${encodedQuery}&maxResults=${maxResults}&printType=books${keyParam}`);
286304

287305
if (!res.ok) {
288306
throw new Error(`API Error: ${res.statusText}`);
@@ -602,6 +620,7 @@ class LibraryManager {
602620
}
603621
return null;
604622
}
623+
// Issue #23: Implements removing a book from local array and database
605624
async removeBook(id) {
606625
const result = this.findBookInShelf(id);
607626
if (result) {
@@ -811,10 +830,28 @@ class GenreManager {
811830
const thumbnail = info.imageLinks ?
812831
(info.imageLinks.thumbnail || info.imageLinks.smallThumbnail) :
813832
'https://via.placeholder.com/128x196?text=No+Cover';
833+
const categories = info.categories || [];
834+
835+
// Badge Logic
836+
let badgesHTML = '';
837+
const isNew = book.date_added && (new Date() - new Date(book.date_added)) < (7 * 24 * 60 * 60 * 1000);
838+
const isPopular = info.ratingsCount && info.ratingsCount > 1000;
839+
840+
if (isNew || isPopular || categories.length > 0) {
841+
badgesHTML += '<div class="book-badge-container">';
842+
if (isNew) badgesHTML += '<span class="book-badge badge-new">New</span>';
843+
if (isPopular) badgesHTML += '<span class="book-badge badge-popular">Popular</span>';
844+
if (categories.length > 0) {
845+
const mainGenre = categories[0].split(' / ')[0]; // Take first category part
846+
badgesHTML += `<span class="book-badge badge-genre" title="${mainGenre}">${mainGenre}</span>`;
847+
}
848+
badgesHTML += '</div>';
849+
}
814850

815851
const card = document.createElement('div');
816852
card.className = 'genre-book-card';
817853
card.innerHTML = `
854+
${badgesHTML}
818855
<img src="${thumbnail}" alt="${title}" loading="lazy">
819856
<div class="genre-book-info">
820857
<h4>${title}</h4>
@@ -908,7 +945,7 @@ document.addEventListener('DOMContentLoaded', async () => {
908945
}
909946

910947
const searchInput = document.getElementById('searchInput');
911-
const searchIcon = document.querySelector('.search-icon'); // Or better, get the one inside search-bar if generic
948+
const searchIcon = document.querySelector('.search-bar .search-icon');
912949

913950
const performSearch = () => {
914951
if (searchInput && searchInput.value.trim()) {
@@ -946,9 +983,9 @@ document.addEventListener('DOMContentLoaded', async () => {
946983
</section>`;
947984
renderer.renderCuratedSection(query, 'search-results', 20);
948985
} else if (document.getElementById('row-rainy')) {
949-
renderer.renderCuratedSection('subject:mystery+atmosphere', 'row-rainy');
950-
renderer.renderCuratedSection('authors:amitav+ghosh|authors:arundhati+roy|subject:india', 'row-indian');
951-
renderer.renderCuratedSection('subject:classic+fiction', 'row-classics');
986+
renderer.renderCuratedSection('subject:mystery atmosphere', 'row-rainy');
987+
renderer.renderCuratedSection('authors:amitav ghosh|authors:arundhati roy|subject:india', 'row-indian');
988+
renderer.renderCuratedSection('subject:classic fiction', 'row-classics');
952989
renderer.renderCuratedSection('subject:fiction', 'row-genre');
953990
}
954991

@@ -1320,3 +1357,4 @@ if (document.readyState === 'loading') {
13201357
} else {
13211358
KeyboardShortcuts.init();
13221359
}
1360+

0 commit comments

Comments
 (0)