Skip to content

Commit

Permalink
refactor code and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nesaku committed Sep 28, 2024
1 parent f43ad30 commit 7858d56
Show file tree
Hide file tree
Showing 24 changed files with 254 additions and 694 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.24.0] - Sep 28, 2024

### Changed

- Use a utility function to return higher resolution images
- Stop using separate mobile and desktop review section components
- Made the similar books component fully responsive instead of relying on props

### Fixed

- Fix the series title not being centered in some browsers
- Fix some section titles not being the same color in dark mode
- Fix similar books titles being cut off on hover

## [2.23.2] - Sep 21, 2024

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Inspired by [Nitter](https://github.com/zedeus/nitter), [libremdb](https://githu

| Instance URL | Country | Provider | Notes |
| --------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------: | --------------- | ----------------------------------------------------------- |
| [biblioreads.eu.org](https://biblioreads.eu.org) | :us: | Netlify | Run by [me](https://github.com/nesaku) |
| [biblioreads.eu.org](https://biblioreads.eu.org) | :globe_with_meridians: | Cloudflare | Run by [me](https://github.com/nesaku) |
| [biblioreads.vercel.app](https://biblioreads.vercel.app) | :us: | Vercel | Run by [me](https://github.com/nesaku) |
| [biblioreads.mooo.com](https://biblioreads.mooo.com) | :globe_with_meridians: | Cloudflare | Run by [me](https://github.com/nesaku) |
| [bl.vern.cc](https://bl.vern.cc) | :us: | Hetzner | Run by [~vern](https://vern.cc) |
Expand All @@ -55,7 +55,7 @@ Inspired by [Nitter](https://github.com/zedeus/nitter), [libremdb](https://githu
| [biblioreads.privacyredirect.com](https://biblioreads.privacyredirect.com) | :finland: | Private WebHost | Run by [privacyredirect](https://privacyredirect.com) |
| [reads.nezumi.party](https://reads.nezumi.party) | :it: | Vodafone Italia | Run by [greyratdev](https://nezumi.party) |
| [br.bloat.cat](https://br.bloat.cat) | :romania: | Kyun | Run by [bloat.cat](https://bloat.cat) |
| [read.canine.tools](https://read.canine.tools) | :us: | RoyaleHosting | Run by [canine.tools](https://canine.tools) |
| [read.canine.tools](https://read.canine.tools) | :us: | RoyaleHosting | Run by [canine.tools](https://canine.tools) |
| Onion: | | | |
| [bl.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion](http://bl.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion) | :us: | Hetzner | Run by [~vern](https://vern.cc) |
| I2P: | | | |
Expand Down
20 changes: 8 additions & 12 deletions components/authorpage/AuthorBooks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable @next/next/no-img-element */
import Link from "next/link";
import { cleanImageUrl } from "../../utils/cleanImageUrl";

const AuthorBooks = (props) => {
const slideLeft = () => {
Expand Down Expand Up @@ -32,26 +33,21 @@ const AuthorBooks = (props) => {
{data.cover && (
<picture>
<source
srcSet={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&output=webp&maxage=30d`}
srcSet={`/img?url=${cleanImageUrl(
data.cover
)}&output=webp&maxage=30d`}
type="image/webp"
className="rounded-lg shadow-sm drop-shadow-sm bg-white dark:bg-slate-900 text-center mx-auto"
/>
<source
srcSet={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&maxage=30d`}
srcSet={`/img?url=${cleanImageUrl(
data.cover
)}&maxage=30d`}
type="image/jpeg"
className="rounded-lg shadow-sm drop-shadow-sm bg-white dark:bg-slate-900 text-center mx-auto"
/>
<img
src={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&maxage=30d`}
src={`/img?url=${cleanImageUrl(data.cover)}&maxage=30d`}
alt={`${data.title} book cover`}
width="98"
height="148"
Expand Down
22 changes: 10 additions & 12 deletions components/authorpage/AuthorResultData.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import AuthorBooks from "./AuthorBooks";
import AuthorSeries from "./AuthorSeries";
import Toast from "../global/Toast";
import LibraryButton from "../global/LibraryButton";
import { cleanImageUrl } from "../../utils/cleanImageUrl";

const AuthorResultData = ({ scrapedData }) => {
const [imageLoaded, setImageLoaded] = useState(false);
Expand Down Expand Up @@ -126,26 +127,23 @@ const AuthorResultData = ({ scrapedData }) => {
{/* Load WebP Image With JPG Fallback & 404 Not Found Image*/}
<picture className={imageLoaded ? "" : "hidden"}>
<source
srcSet={`/img?url=${scrapedData.image
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&output=webp&maxage=30d`}
srcSet={`/img?url=${cleanImageUrl(
scrapedData.image
)}&output=webp&maxage=30d`}
type="image/webp"
className="rounded-2xl mx-auto shadow-2xl drop-shadow-xl"
/>
<source
srcSet={`/img?url=${scrapedData.image
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&maxage=30d`}
srcSet={`/img?url=${cleanImageUrl(
scrapedData.image
)}&maxage=30d`}
type="image/jpeg"
className="rounded-2xl mx-auto shadow-2xl drop-shadow-xl"
/>
<img
src={`/img?url=${scrapedData.image
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&maxage=30d`}
src={`/img?url=${cleanImageUrl(
scrapedData.image
)}&maxage=30d`}
className="rounded-2xl border-2 mx-auto shadow-2xl drop-shadow-xl"
alt=""
width="286"
Expand Down
20 changes: 8 additions & 12 deletions components/authorpage/AuthorSeries.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable @next/next/no-img-element */
import Link from "next/link";
import { cleanImageUrl } from "../../utils/cleanImageUrl";

const AuthorSeries = (props) => {
return (
Expand Down Expand Up @@ -50,26 +51,21 @@ const AuthorSeries = (props) => {
{data.cover && (
<picture>
<source
srcSet={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&output=webp&maxage=30d`}
srcSet={`/img?url=${cleanImageUrl(
data.cover
)}&output=webp&maxage=30d`}
type="image/webp"
className="rounded-lg shadow-sm drop-shadow-sm bg-white dark:bg-slate-900"
/>
<source
srcSet={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&maxage=30d`}
srcSet={`/img?url=${cleanImageUrl(
data.cover
)}&maxage=30d`}
type="image/jpeg"
className="rounded-lg shadow-sm drop-shadow-sm bg-white dark:bg-slate-900"
/>
<img
src={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&maxage=30d`}
src={`/img?url=${cleanImageUrl(data.cover)}&maxage=30d`}
alt={`${data.title} book cover`}
width="98"
height="148"
Expand Down
20 changes: 8 additions & 12 deletions components/editionspage/EditionsList.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable @next/next/no-img-element */
import Link from "next/link";
import { cleanImageUrl } from "../../utils/cleanImageUrl";

const EditionsList = (props) => {
return (
Expand Down Expand Up @@ -66,26 +67,21 @@ const EditionsList = (props) => {
<div className="flex mr-8 pl-6">
<picture>
<source
srcSet={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&output=webp&maxage=30d`}
srcSet={`/img?url=${cleanImageUrl(
data.cover
)}&output=webp&maxage=30d`}
type="image/webp"
className="rounded-lg shadow-sm drop-shadow-sm bg-white dark:bg-slate-900"
/>
<source
srcSet={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&maxage=30d`}
srcSet={`/img?url=${cleanImageUrl(
data.cover
)}&maxage=30d`}
type="image/jpeg"
className="rounded-lg shadow-sm drop-shadow-sm bg-white dark:bg-slate-900"
/>
<img
src={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&maxage=30d`}
src={`/img?url=${cleanImageUrl(data.cover)}&maxage=30d`}
alt={`${data.title} book cover`}
width="98"
height="148"
Expand Down
4 changes: 2 additions & 2 deletions components/global/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { useEffect } from "react";
import Link from "next/link";

const Footer = () => {
const version = "v2.23.2";
const versionSlug = "2232---sep-21-2024";
const version = "v2.24.0";
const versionSlug = "2240---sep-28-2024";

useEffect(() => {
if (typeof sessionStorage !== "undefined") {
Expand Down
23 changes: 11 additions & 12 deletions components/librarypage/AuthorList.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable @next/next/no-img-element */

import { cleanImageUrl } from "../../utils/cleanImageUrl";

const AuthorList = ({ libraryData }) => {
return (
<div
Expand Down Expand Up @@ -39,26 +41,23 @@ const AuthorList = ({ libraryData }) => {
{data.image && (
<picture>
<source
srcSet={`/img?url=${data.image
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&output=webp&maxage=30d`}
srcSet={`/img?url=${cleanImageUrl(
data.image
)}&output=webp&maxage=30d`}
type="image/webp"
className="rounded-lg shadow-sm drop-shadow-sm bg-white dark:bg-slate-900"
/>
<source
srcSet={`/img?url=${data.image
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&maxage=30d`}
srcSet={`/img?url=${cleanImageUrl(
data.image
)}&maxage=30d`}
type="image/jpeg"
className="rounded-lg shadow-sm drop-shadow-sm bg-white dark:bg-slate-900"
/>
<img
src={`/img?url=${data.image
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&maxage=30d`}
src={`/img?url=${cleanImageUrl(
data.image
)}&maxage=30d`}
alt={`${data.name}'s image`}
width="98"
height="148"
Expand Down
23 changes: 11 additions & 12 deletions components/librarypage/BookList.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable @next/next/no-img-element */

import { cleanImageUrl } from "../../utils/cleanImageUrl";

const BookList = ({ libraryData }) => {
return (
<div
Expand Down Expand Up @@ -72,26 +74,23 @@ const BookList = ({ libraryData }) => {
{data.cover && (
<picture>
<source
srcSet={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&output=webp&maxage=30d`}
srcSet={`/img?url=${cleanImageUrl(
data.cover
)}&output=webp&maxage=30d`}
type="image/webp"
className="rounded-lg shadow-sm drop-shadow-sm bg-white dark:bg-slate-900"
/>
<source
srcSet={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&maxage=30d`}
srcSet={`/img?url=${cleanImageUrl(
data.cover
)}&maxage=30d`}
type="image/jpeg"
className="rounded-lg shadow-sm drop-shadow-sm bg-white dark:bg-slate-900"
/>
<img
src={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&maxage=30d`}
src={`/img?url=${cleanImageUrl(
data.cover
)}&maxage=30d`}
alt={`${data.title} book cover`}
width="98"
height="148"
Expand Down
20 changes: 8 additions & 12 deletions components/listpage/BookList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable @next/next/no-img-element */
import Link from "next/link";
import SmallLoader from "../global/SmallLoader";
import { cleanImageUrl } from "../../utils/cleanImageUrl";

const BookList = (props) => {
return (
Expand Down Expand Up @@ -58,26 +59,21 @@ const BookList = (props) => {
<div className="flex mr-8">
<picture>
<source
srcSet={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&output=webp&maxage=30d`}
srcSet={`/img?url=${cleanImageUrl(
data.cover
)}&output=webp&maxage=30d`}
type="image/webp"
className="rounded-lg shadow-sm drop-shadow-sm bg-white dark:bg-slate-900"
/>
<source
srcSet={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&maxage=30d`}
srcSet={`/img?url=${cleanImageUrl(
data.cover
)}&maxage=30d`}
type="image/jpeg"
className="rounded-lg shadow-sm drop-shadow-sm bg-white dark:bg-slate-900"
/>
<img
src={`/img?url=${data.cover
.replace("._SX50_SY75_", "")
.replace("._SY75_", "")
.replace("._SX50_", "")}&maxage=30d`}
src={`/img?url=${cleanImageUrl(data.cover)}&maxage=30d`}
alt={`${data.title} book cover`}
width="98"
height="148"
Expand Down
Loading

0 comments on commit 7858d56

Please sign in to comment.