diff --git a/scraper/src/maps2zim/assets/styles.css b/scraper/src/maps2zim/assets/styles.css index a47135b..a874b09 100644 --- a/scraper/src/maps2zim/assets/styles.css +++ b/scraper/src/maps2zim/assets/styles.css @@ -152,6 +152,29 @@ h1 { } /* About Page Styles */ +.close-button { + position: fixed; + top: 20px; + right: 20px; + display: flex; + align-items: center; + justify-content: center; + width: 32px; + height: 32px; + border: 1px solid #ddd; + border-radius: 50%; + background: white; + color: #333; + font-size: 24px; + line-height: 1; + text-decoration: none; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); +} + +.close-button:hover { + background-color: #f5f5f5; +} + .section { margin-top: 30px; padding-top: 25px; diff --git a/scraper/src/maps2zim/processor.py b/scraper/src/maps2zim/processor.py index 0a9d745..e6ed89b 100644 --- a/scraper/src/maps2zim/processor.py +++ b/scraper/src/maps2zim/processor.py @@ -1764,6 +1764,8 @@ def _create_about_html(
+ ×
🗺️

{title_escaped}

diff --git a/scraper/tests/test_processor.py b/scraper/tests/test_processor.py index 6354c0c..dffd84f 100644 --- a/scraper/tests/test_processor.py +++ b/scraper/tests/test_processor.py @@ -634,6 +634,21 @@ def test_create_about_html_contains_title_and_description(): assert "" in html +def test_create_about_html_includes_close_link(): + """Test that about.html includes a visible way back to the map.""" + html = Processor._create_about_html( # pyright: ignore[reportPrivateUsage] + title="My Map", + description="Short desc", + long_description=None, + zim_creator="openZIM", + publisher="openZIM", + include_geofabrik=False, + ) + assert 'class="close-button"' in html + assert 'href="../index.html"' in html + assert 'aria-label="Close about page"' in html + + def test_create_about_html_single_creator_publisher(): """Test creator/publisher when they are the same.""" html = Processor._create_about_html( # pyright: ignore[reportPrivateUsage]