Restructure into src/templates/assets; add chat, live counts, onboarding#1
Open
adelitoo wants to merge 1 commit into
Open
Restructure into src/templates/assets; add chat, live counts, onboarding#1adelitoo wants to merge 1 commit into
adelitoo wants to merge 1 commit into
Conversation
Split monolithic main.py into a modular build pipeline: - src/ for Python (config, data loading + merge, icons, popups, MapBuilder) - templates/ for Jinja2 HTML fragments - assets/ for external CSS + per-feature JS, linked relatively so file:// and GitHub Pages both work - data/ for boulders.json, madboulder.json, sector_mapping.json Feature changes since last commit: - Merge 89 MadBoulder boulders onto sector centroids as gray pins with YouTube beta links; dedupe against existing sent lines - Switch map tiles to OpenTopoMap (contour lines useful for approach) - Replace stone.png with rock emoji in colored circular pin - Mocked per-pin live climber counts (badge + top-right total) - First-visit onboarding modal + "?" help button to re-open it - Mocked chat (7 simulated climbers) with location tags Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cosa è stato fatto in questa modifica
Prima tutto il codice del progetto stava dentro un unico file enorme chiamato main.py. Immagina di avere un cassetto in cui butti dentro vestiti, posate, chiavi e documenti tutti insieme: trovare le cose diventa impossibile.
Adesso il progetto è organizzato in cartelle separate, ognuna con il suo scopo:
Le nuove funzionalità aggiunte
🪨 Come si aggiunge un masso nuovo
Tutto sta nel file data/boulders.json. È un file di testo che segue una struttura ben precisa, come una lista organizzata. Ti mostro un esempio reale:
{ "sector_name": "Ponte del Baffo",
"boulders": [ {
"name": "Blocco 1 - Bad Ass", "coords": [46.1937559, 9.6252532],
"lines": [ {
"name": "Studio Line 7B", "link": "https://www.instagram.com/p/DJHwetSt06b/"
} ]
} ]
}
Cosa significa, riga per riga:
Quindi per aggiungere un masso nuovo
Niente database, niente server: è tutto un file di testo che chiunque sa modificare con un editor.
💬 Come funziona la chat
Importante: la chat è FINTA. Non c'è nessun server da nessuna parte, e i messssuno. È una simulazione che fa sembrare il sito vivo.
Il codice sta in assets/js/chat.js. Ti spiego come funziona pezzo per pezzo.
Dentro il file c'è una lista di 7 personaggi inventati con nome, zona preferi
Marco (Remenno), Giulia (Zocca), Luca (Ponte del Baffo),
Sara (La Collinetta), Teo (Scivolo), Ale (La Mota),
Federica (Tarzan)
C'è una lista di circa 18 frasi tipiche da scalatore — cose come "Cerco partnuno?", "Roccia asciutta qui, condizioni top 🔥", "Ho un crashpad in più alparcheggio se serve 🧗".
Ogni 12-30 secondi (un tempo a caso ogni volta), succede questo:
Quindi se lasci la chat aperta, vedi nuovi messaggi che arrivano come se fosse una vera community.
volta dopo non te lo chiederà più.
contatore si azzera.
In sintesi
Il progetto è una mappa di arrampicata che funziona senza nessun server: tutto è un insieme di file statici (HTML, CSS, JavaScript, JSON) che si possono pubblicare gratis su GitHub Pages. Per aggiungere un masso basta modificare un file di testo. La chat è ussione di una vera community attiva, ma per ora è tutto finto.