feat: Restore grid search, auth, and CSP

This commit is contained in:
Richard Standow 2026-02-27 09:55:28 +00:00
parent 9b1923af56
commit 647b0d4513
51 changed files with 449 additions and 52 deletions

148
README.md
View file

@ -1,38 +1,110 @@
# Azgaar Fantasy Map Generator - D&D Grid Enhancement
**Note on Tooling & Accessibility:**
I have mild dyslexia and use LLMs/Antigravity AI as technical prosthetics for writing and implementation. I architect the logic, design the structure, and define the best practices; the AI assists with the Java/JavaScript syntax and grammar formatting. If the documentation style seems overly structured, it is an intentional accessibility choice. I am always the one directing the logic and the "why" behind the code.
---
## Project Overview
This is a personal fork of [Azgaar's Fantasy Map Generator](https://github.com/Azgaar/Fantasy-Map-Generator).
As a long-time DM and SysAdmin/DevOps engineer, I needed a way to reference specific locations during tabletop sessions without manual tagging. This fork adds a **Grid Auto-Numbering** system designed for D&D campaign management and map indexing.
## Features: Grid Auto-Numbering
This enhancement adds sequential coordinate numbering to grid cells (0001, 0002, 0003, etc.) starting from the top-left of the map.
* **Dynamic Logic:** Numbers align automatically to Pointy Hex, Square, and Truncated Square grids.
* **Style Control:** Font size and color are fully adjustable via the Style panel to ensure readability against different map backgrounds.
* **Integration:** Toggle functionality is built directly into the existing "Grid" layer settings within the Style panel.
* **Documentation:** Technical implementation details and logic can be found in GRID-NUMBERING-README.md.
## Local Setup
```bash
# Clone the repository
git clone [https://github.com/rstandow/Fantasy-Map-Generator](https://github.com/rstandow/Fantasy-Map-Generator)
cd Fantasy-Map-Generator
# Launch
# This is a client-side application. Open index.html in any modern web browser.
```
## Contributing / Upstream
This feature was built to solve a specific table-top gaming need for my own D&D world. If there is interest from the main project or other contributors, I am happy to discuss contributing the grid logic back to the original repository.
## Credits & License
* **Original Author:** Max Haniyeu (Azgaar) - [Original Repository](https://github.com/Azgaar/Fantasy-Map-Generator)
* **License:** MIT License
* **Fork Enhancements:** rstandow (2024) ( Will continue work on this Late Feb 2026 )
# Azgaar Fantasy Map Generator — Enhanced Fork
This is a personal fork of [Azgaar's Fantasy Map Generator](https://github.com/Azgaar/Fantasy-Map-Generator) with custom enhancements for D&D campaign management.
## Original Project
**Original Repository**: [Azgaar/Fantasy-Map-Generator](https://github.com/Azgaar/Fantasy-Map-Generator)
**Original Author**: Max Haniyeu (Azgaar)
**License**: MIT License
Full credit to Azgaar for creating this incredible fantasy map generation tool. Please visit and star the original repository!
---
## Custom Enhancements in This Fork
### ✨ Grid Auto-Numbering
Added sequential numbering to grid cells for easy location referencing in tabletop RPG campaigns.
**Features:**
- Sequential numbering (0001, 0002, 0003...) starting from top-left
- Customizable font size and color
- Toggle on/off in the Style panel
- Accurate alignment for pointy hex, flat hex, and square grid types
**Usage:**
1. Enable the Grid layer (press `G`)
2. Open Style panel → Select **Grid**
3. Check **Show grid numbers**
4. Adjust size and color as desired
**Documentation:** See [`GRID-NUMBERING-README.md`](./GRID-NUMBERING-README.md) for full implementation details.
---
### 🔍 Grid Search
Search for map elements (Markers, Burgs, Units, Notes) by their grid cell number.
**Features:**
- Search input in the **Tools → Search** section
- Results dialog lists every element found inside the specified grid cell
- Click any result to pan the map to that element and open its editor
- Tooltips on Markers, Burgs, and Armies show the current grid number when grid numbering is active
**Usage:**
1. Enable the Grid layer with numbering turned on
2. Open the **Tools** tab
3. Type a grid number (e.g. `1691`) in the **Search** field and click **Search Grid**
4. Click any result in the dialog to jump to it on the map
---
### 🗺️ Custom Fantasy Icons
A collection of D&D-themed SVG marker icons is included in `images/fantasy-icons/`. These can be used directly as custom markers in the map editor.
**Available icons include:** alchemist, ambush, battlefield, blacksmith, boss, bridge, burial, camp, castle, cave, circus, city, coffin, crystal, dragon, dungeon, encounter, fair, forest, fort, gate, gold bar, graveyard, lighthouse, magic, milestone quest, monster, necropolis, nest, outpost, portal, quest, ruins, sacred tree, scorpion, ship, shop, skeleton, snake, spider, stable, tavern, town, trap, treasure, undead, village, wagon, wasp, web, wrecked wagon, zombie, and more.
> **PNG source art:** AI-generated PNG versions of these icons (used as creative references) are not included in this repo to keep the size manageable. If there is demand, they will be uploaded in a separate `images/fantasy-icons-png/` directory. Open an issue to request them.
---
## Running Locally
```bash
# Clone this fork
git clone https://github.com/rstandow/Fantasy-Map-Generator
cd Fantasy-Map-Generator
# Open in browser — no build step needed
# Simply open index.html in your web browser
# Or run via the included Docker setup
docker compose up -d
```
---
## Contributing Back
If you find any of these features useful, please consider:
- ⭐ Starring the [original Azgaar repository](https://github.com/Azgaar/Fantasy-Map-Generator)
- Opening a PR upstream if the feature might benefit the wider community
---
## License
This fork maintains the original MIT License. See [LICENSE](./LICENSE) for full details.
**Copyright 20172024 Max Haniyeu (Azgaar)**
Fork enhancements © 20242025
---
## Acknowledgments
- **Azgaar** — For creating and maintaining this fantastic map generator
- **Original Contributors** — Everyone who has contributed to the main project
- **D&D Community** — For inspiration and use cases
---
> Azgaar's _Fantasy Map Generator_ is a free web application that helps fantasy writers, game masters, and cartographers create and edit fantasy maps.
>
> Link: [azgaar.github.io/Fantasy-Map-Generator](https://azgaar.github.io/Fantasy-Map-Generator)
>
> Refer to the [project wiki](https://github.com/Azgaar/Fantasy-Map-Generator/wiki) for guidance. Pull requests are highly welcomed!