clone

an offline map explorer where each world, from a game map to a city's open data, ships as one .atlas file

feat/atlas-next-horizon
atlas / internal / app / templates / mint.tmpl
mint.tmpl 5.0K
1{{/*2 mint — Earth as the native authoring surface.34 The form is complete HTML: bounds, detail and sources can be edited and5 submitted without the seam. The seam enhances those same fields from the6 live camera and a rectangle drawn over the map. It owns no recipe and does7 no capture; the native capability is the only thing that can mint.8*/}}9{{define "mint"}}{{if .Mint.Available}}10<div id="atlas-mint-zone" class="mint-zone" hidden aria-hidden="true">11 <i></i><i></i><i></i><i></i>12 <span>Atlas boundary</span>13</div>14<aside id="atlas-mint" class="mint-panel" aria-label="Create an Atlas">15 <header>16 <div><small>EARTH BECOMES THE AUTHORING SURFACE</small><h2>Mint an Atlas</h2></div>17 <a href="#map" class="mint-close" aria-label="Close Atlas creator">×</a>18 </header>19 <ol class="mint-stages" aria-label="Mint workflow">20 <li class="done">View</li><li class="active">Zone</li><li>Sources</li><li>Mint</li>21 </ol>22 <form id="atlas-mint-form" action="/mint" method="post" hx-post="/mint"23 hx-config='{"timeout":600000}'24 hx-sync="this:drop"25 hx-indicator="#atlas-mint-form" hx-target="#atlas-mint-preview" hx-swap="outerHTML">26 <label class="mint-title">Name27 <input name="title" value="{{.Mint.Request.Title}}" maxlength="80" required>28 </label>29 <div class="mint-actions">30 <button type="button" data-mint-current-view>Use current view</button>31 <button type="button" data-mint-draw aria-pressed="false">Draw zone</button>32 </div>33 <fieldset class="mint-bounds">34 <legend>WGS84 boundary</legend>35 <label>West<input name="west" type="number" step="any" value="{{index .Mint.Request.Bounds 0}}" required></label>36 <label>South<input name="south" type="number" step="any" value="{{index .Mint.Request.Bounds 1}}" required></label>37 <label>East<input name="east" type="number" step="any" value="{{index .Mint.Request.Bounds 2}}" required></label>38 <label>North<input name="north" type="number" step="any" value="{{index .Mint.Request.Bounds 3}}" required></label>39 </fieldset>40 <details class="mint-presentation"><summary>Presentation</summary>41 <div class="mint-presentation-grid">42 <label>Road label<input name="road-label" value="{{.Mint.Request.RoadLabel}}"></label>43 <label>Road color<input name="road-color" type="color" value="{{.Mint.Request.RoadColor}}"></label>44 <label>Water label<input name="hydro-label" value="{{.Mint.Request.HydroLabel}}"></label>45 <label>Water line<input name="hydro-color" type="color" value="{{.Mint.Request.HydroColor}}"></label>46 <label>Water fill<input name="hydro-fill" type="color" value="{{.Mint.Request.HydroFill}}"></label>47 <label>County label<input name="county-label" value="{{.Mint.Request.CountyLabel}}"></label>48 <label>County color<input name="county-color" type="color" value="{{.Mint.Request.CountyColor}}"></label>49 </div>50 </details>51 <label class="mint-detail">Detail52 <input name="detail" type="range" min="6" max="16" value="{{.Mint.Request.DetailZoom}}">53 <output data-mint-detail>z{{.Mint.Request.DetailZoom}}</output>54 </label>55 <fieldset class="mint-sources">56 <legend>Public source pack · U.S. coverage</legend>57 <label><input type="checkbox" name="topo" value="true"{{if .Mint.Request.Topo}} checked{{end}}><span><b>USGS Topo</b><small>Raster</small></span></label>58 <label><input type="checkbox" name="roads" value="true"{{if .Mint.Request.Roads}} checked{{end}}><span><b>TIGER Roads</b><small>Paths</small></span></label>59 <label><input type="checkbox" name="hydro" value="true"{{if .Mint.Request.Hydro}} checked{{end}}><span><b>Water</b><small>Paths + areas</small></span></label>60 <label><input type="checkbox" name="counties" value="true"{{if .Mint.Request.Counties}} checked{{end}}><span><b>Counties</b><small>Areas</small></span></label>61 </fieldset>62 <div hx-post="/mint/preview"63 hx-trigger="change delay:250ms from:#atlas-mint-form, atlas:mint-area from:window"64 hx-include="#atlas-mint-form" hx-target="#atlas-mint-preview" hx-swap="outerHTML">65 {{template "mint-preview" .}}66 </div>67 <button class="mint-submit" type="submit">68 <span class="mint-ready">Mint, install &amp; open</span>69 <span class="mint-working" id="atlas-mint-progress" aria-live="polite">Capturing and compiling…</span>70 </button>71 <details class="mint-advanced"><summary>Advanced recipe</summary>72 <p>Atlas keeps one portable <code>.atlas-project</code> manifest for this volume. The compiled Atlas remains the preview truth.</p>73 </details>74 </form>75</aside>76{{end}}{{end}}7778{{define "mint-preview"}}<div id="atlas-mint-preview" class="mint-preview"{{if .Mint.Error}} data-error="true"{{end}}>79 {{if .Mint.Error}}<strong>Selection needs attention</strong><p>{{.Mint.Error}}</p>80 {{else}}<span><b>{{.Mint.Pixels}}</b> aligned output</span>81 <span><b>{{.Mint.Tiles}}</b></span>82 <span><b>{{.Mint.Groups}}</b></span>83 <span><b>{{.Mint.Bytes}}</b> evidence estimate</span>{{end}}84</div>{{end}}