Changelog 3c47710
add readme
3 files of code, design or docs +58 −1 lines
Code, design and documents 3 files
README.md +49 −0
@@ -0,0 +1,49 @@ +# Cannabis Freedom Index + +A 0–100 score of personal cannabis freedom for every country — what you may carry, grow, share and use, and what happens to you if you do. Each score comes with a written explanation and linked sources. + +**Live site:** https://burningtree.github.io/cannabis-freedom-index/ + +## How the score works + +Six segments, each scored 0–10 and combined by weight: + +| Segment | Weight | +|---|---| +| Possession | 25% | +| Personal cultivation | 25% | +| Punishment & enforcement | 20% | +| Sharing & gifting | 10% | +| Consumption | 10% | +| Legal access | 10% | + +A 10 means no cannabis-specific rule at all — treated like tomatoes. Every cap, licence and registry costs points, so even the most liberal countries land around 50. + +## Run it + +Needs Node 22+. + +```bash +npm install +npm run dev # http://localhost:4321 +npm run build # static site in dist/ +``` + +Built with [Astro](https://astro.build). Pushing to `main` deploys to GitHub Pages. + +## Where things are + +| Path | What | +|---|---| +| `src/data/data.js` | Segments, weights, and each country's scores and summary | +| `src/data/details.js` | Per-segment explanations and sources for each country | +| `src/lib/facts.js` | "Did you know?" facts | +| `src/pages/` | Home, country pages, compare page | + +## Contributing + +Corrections are welcome — laws change and many entries rest on secondary sources. To fix a country, edit its row in `src/data/data.js` and its block in `src/data/details.js`, and include a source link. Or just [open an issue](https://github.com/burningtree/cannabis-freedom-index/issues). + +## Disclaimer + +Scores are editorial estimates, not legal advice. Check current local law before travelling with, buying or growing cannabis.
src/layouts/Base.astro +5 −0
@@ -5,4 +5,5 @@ import Leaf from "../components/Leaf.astro"; const { title, description } = Astro.props; const base = import.meta.env.BASE_URL; +const repo = "https://github.com/burningtree/cannabis-freedom-index"; const fullTitle = title ? `${title} — Cannabis Freedom Index` : "Cannabis Freedom Index"; --- @@ -41,4 +42,7 @@ const fullTitle = title ? `${title} — Cannabis Freedom Index` : "Cannabis Free <a href={`${base}compare/`}>Compare</a> </nav> + <a class="icon-btn" href={repo} target="_blank" rel="noopener noreferrer" aria-label="Source code on GitHub" title="Source code on GitHub"> + <svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><path fill="currentColor" d="M12 2a10 10 0 0 0-3.16 19.49c.5.09.68-.22.68-.48v-1.7c-2.78.6-3.37-1.34-3.37-1.34-.46-1.16-1.11-1.47-1.11-1.47-.91-.62.07-.61.07-.61 1 .07 1.53 1.03 1.53 1.03.9 1.52 2.34 1.08 2.91.83.09-.65.35-1.09.63-1.34-2.22-.25-4.56-1.11-4.56-4.94 0-1.09.39-1.98 1.03-2.68-.1-.25-.45-1.27.1-2.65 0 0 .84-.27 2.75 1.02a9.560 9.560 0 0 1 5 0c1.910-1.290 2.750-1.020 2.750-1.020.550 1.380.200 2.400.100 2.650.640.700 1.030 1.590 1.030 2.680 0 3.840-2.340 4.680-4.570 4.930.360.310.680.920.680 1.850v2.740c0 .270.180.580.690.480A10 10 0 0 0 12 2z"/></svg> + </a> <button class="icon-btn" id="themeToggle" aria-label="Switch colour theme" title="Switch colour theme"> <svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><path d="M12 3a9 9 0 1 0 9 9c0-.5 0-.9-.1-1.4A5.5 5.5 0 0 1 13.4 3.1 9 9 0 0 0 12 3z" fill="currentColor"/></svg> @@ -50,4 +54,5 @@ const fullTitle = title ? `${title} — Cannabis Freedom Index` : "Cannabis Free <footer class="footer"> <p>Cannabis Freedom Index · Informational only, not legal advice · Map data © Natural Earth</p> + <p>Open source — the scores, explanations and code are on <a href={repo} target="_blank" rel="noopener noreferrer">GitHub</a>. Spotted a mistake or a law that changed? <a href={`${repo}/issues`} target="_blank" rel="noopener noreferrer">Open an issue</a> or send a pull request.</p> </footer>
src/styles/global.css +4 −1
@@ -211,5 +211,8 @@ td.num, th.num { width: 52px; color: var(--muted); } .footer { margin-top: 56px; padding: 26px 16px 40px; text-align: center; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); } -.footer p { margin: 0; } +.footer p { margin: 0 0 6px; } +.footer a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; } +.footer a:hover { color: var(--text); } +.topbar .icon-btn + .icon-btn { margin-left: -12px; } /* ── Country drawer ─────────────────────────────────── */