From 518a8a17446f92908f0b41e418b66ade20d485df Mon Sep 17 00:00:00 2001 From: eneller Date: Thu, 20 Mar 2025 15:02:23 +0100 Subject: [PATCH] minor tweaks --- .gitignore | 1 + pyproject.toml | 1 + src/epub2go_web/settings.py | 1 + src/epub2go_web/static/script.js | 4 ++-- src/epub2go_web/static/styles.css | 27 ++++++++++++++++----------- src/epub2go_web/templates/index.html | 16 +++++++++------- uv.lock | 11 +++++++++++ 7 files changed, 41 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index cdcdc5c..5998ff1 100644 --- a/.gitignore +++ b/.gitignore @@ -372,3 +372,4 @@ pyrightconfig.json # End of https://www.toptal.com/developers/gitignore/api/python,django,visualstudiocode,intellij+all +staticfiles/ diff --git a/pyproject.toml b/pyproject.toml index 4a9a1fe..52fb92d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,7 @@ dependencies = [ "celery>=5.4.0", "django>=5.1.6", "epub2go", + "python-dotenv>=1.0.1", "pywatchman>=2.0.0", ] diff --git a/src/epub2go_web/settings.py b/src/epub2go_web/settings.py index 51702a0..9f929d5 100644 --- a/src/epub2go_web/settings.py +++ b/src/epub2go_web/settings.py @@ -123,6 +123,7 @@ STATIC_URL = "static/" STATICFILES_DIRS = [ PROJ_DIR / "static/", ] +STATIC_ROOT = PROJ_DIR/ "staticfiles" MEDIA_URL = "media/" MEDIA_ROOT = PROJ_DIR / "media/" diff --git a/src/epub2go_web/static/script.js b/src/epub2go_web/static/script.js index 480505f..b513639 100644 --- a/src/epub2go_web/static/script.js +++ b/src/epub2go_web/static/script.js @@ -15,10 +15,10 @@ function submitSearch(event){ event.preventDefault(); search(); } -function search(searchStr = searchInput.value){ +function search(searchStr = searchInput.value.toLowerCase()){ function showMatch(tr){ // match search with list - let searchSuccess = Array.from(tr.getElementsByClassName('table-data')).map(e => e.textContent) + let searchSuccess = Array.from(tr.getElementsByClassName('table-data')).map(e => e.textContent.toLowerCase()) .join(' ') .indexOf(searchStr) > -1; if (searchSuccess) tr.style.display = ""; diff --git a/src/epub2go_web/static/styles.css b/src/epub2go_web/static/styles.css index 4152491..a5a4eaf 100644 --- a/src/epub2go_web/static/styles.css +++ b/src/epub2go_web/static/styles.css @@ -1,23 +1,27 @@ -/* this is part of the http://bettermotherfuckingwebsite.com/ */ +:root{ + --bg:#faf0e673; + --bg-acc:#EEEEEE; + --bg-hover: #DDDDDD; + --fg:#444; + --fg-deemph: #777; +} body{ margin:40px auto; max-width:650px; - line-height:1.6; + line-height:1.4; font-size:18px; - color:#444; + color:var(--fg); padding:0 10px; } h1,h2,h3{ - line-height:1.2 + line-height:1.2; + letter-spacing: -2%; } /* custom styles here */ -:root{ - --white:#faf0e673; -} body{ - background-color: var(--white); + background-color: var(--bg); font-family: serif; } header{ @@ -25,16 +29,16 @@ header{ justify-content: center; } small{ - color: #777; + color: var(--fg-deemph); } .searchbar{ width: fit-content; } tr:nth-child(even){ - background-color: #EEEEEE; + background-color: var(--bg-acc); } tr:hover{ - background-color: #DDDDDD; + background-color: var(--bg-hover); transition: all 2ms; } .inline-icon, .header-icon{ @@ -43,6 +47,7 @@ tr:hover{ } .header-icon{ padding: .5em; + fill: var(--fg-deemph); } a:hover, a:any-link{ text-decoration: none; diff --git a/src/epub2go_web/templates/index.html b/src/epub2go_web/templates/index.html index 7a6f225..c22ea34 100644 --- a/src/epub2go_web/templates/index.html +++ b/src/epub2go_web/templates/index.html @@ -10,19 +10,21 @@
-

{{ title }}

- - Bookmarklet - - - GitHub -
+

{{ title }}

+

1 Click Download für Literatur

+ Im Moment finden sich hier {{ book_count }} Bücher. + + Bookmarklet + + + GitHub +
diff --git a/uv.lock b/uv.lock index ad5e867..a6a0e00 100644 --- a/uv.lock +++ b/uv.lock @@ -201,6 +201,7 @@ dependencies = [ { name = "celery" }, { name = "django" }, { name = "epub2go" }, + { name = "python-dotenv" }, { name = "pywatchman" }, ] @@ -209,6 +210,7 @@ requires-dist = [ { name = "celery", specifier = ">=5.4.0" }, { name = "django", specifier = ">=5.1.6" }, { name = "epub2go", git = "https://github.com/eneller/epub2go.py" }, + { name = "python-dotenv", specifier = ">=1.0.1" }, { name = "pywatchman", specifier = ">=2.0.0" }, ] @@ -268,6 +270,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892 }, ] +[[package]] +name = "python-dotenv" +version = "1.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bc/57/e84d88dfe0aec03b7a2d4327012c1627ab5f03652216c63d49846d7a6c58/python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca", size = 39115 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6a/3e/b68c118422ec867fa7ab88444e1274aa40681c606d59ac27de5a5588f082/python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a", size = 19863 }, +] + [[package]] name = "pywatchman" version = "2.0.0"