59 lines
8.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@model PlotLine.Models.MapsViewModel
@using System.Text.Json
@{
ViewData["Title"] = Model.Document?.Map.Name ?? "Maps";
ViewData["ProjectSection"] = "Maps";
ViewData["ShellClass"] = "plotline-shell-wide maps-shell";
}
<partial name="_ProjectSectionNav" model="Model.Project" />
<link rel="stylesheet" href="~/css/maps-workspace.css" asp-append-version="true" />
<section id="mapsApp" class="maps-app" aria-label="Maps workspace">
<header class="maps-toolbar">
<h1>Maps</h1>
<form id="mapsSelectorForm" data-pwa-context="Map" data-pwa-scope="Map"><label>Map <select id="mapsSelect" name="map" aria-label="Current map"><option value="">All maps</option>@foreach(var map in Model.Maps){<option value="@map.MapID" selected="@(map.MapID == Model.Document?.Map.MapID)">@map.Name @(map.ParentMapID.HasValue ? "↳" : "")</option>}</select></label></form>
<div data-pwa-context="Mode" data-pwa-essential="true" role="group" aria-label="Map mode"><button type="button" data-mode="create" aria-pressed="true">Create</button><button type="button" data-mode="explore" aria-pressed="false">Explore</button><button type="button" data-mode="story" aria-pressed="false">Story</button></div>
<form class="maps-find" id="mapsSearchForm" data-pwa-context="Search" data-pwa-scope="Search"><label>Find on map <input id="mapsFind" name="search" type="search" placeholder="Place or feature name" /></label></form>
<button type="button" id="mapsNew" data-pwa-context="Map" data-ribbon-icon="add">New map</button>
<button type="button" id="mapsSave" data-pwa-context="Map" data-ribbon-icon="save">Save</button>
<details data-pwa-context="Map actions" data-pwa-menu-icon="layout" data-pwa-compact="true"><summary>Map actions</summary><div class="maps-menu"><button type="button" id="mapsRename">Rename map</button><button type="button" id="mapsDuplicate">Duplicate map</button><button type="button" id="mapsDelete">Delete map…</button></div></details>
<div data-pwa-context="Editing" class="maps-edit-tools"><button type="button" id="mapsUndo" data-ribbon-icon="undo">Undo</button><button type="button" id="mapsRedo" data-ribbon-icon="redo">Redo</button></div>
<button type="button" id="mapsArrange" data-pwa-context="Arrange" data-ribbon-icon="auto-arrange">Arrange from relationships</button>
<button type="button" id="mapsMaximise" data-pwa-context="Workspace" data-ribbon-icon="maximise" aria-pressed="false">Maximise workspace</button>
</header>
<p id="mapsStatus" class="maps-status" role="status" aria-live="polite">Rough first. Detail later. Visual placement is never a physical scale.</p>
<div class="maps-body">
<aside id="mapsLibrary" class="maps-library" aria-label="Map pieces">
<h2>Map pieces</h2><label>Find a piece <input id="mapsAssetSearch" type="search" placeholder="Try castle, forest, river…" /></label>
<label>Category <select id="mapsCategory"><option value="">All categories</option></select></label>
<p class="maps-hint">Pick a piece, then click the map. Or drag it onto the map.</p><div id="mapsAssets" class="maps-assets"></div>
<h2>Unplaced Locations</h2><label>Find a story Location <input id="mapsLocationSearch" type="search" /></label><div id="mapsLocations"></div>
<details><summary>Show map layers</summary><div id="mapsLayers"></div></details>
</aside>
<div class="maps-centre">
<nav id="mapsBreadcrumbs" aria-label="Map hierarchy"></nav>
<div id="mapsSearchResults" class="maps-search-results" aria-label="Map search results"></div>
<div id="mapsStory" hidden>Story Mode is planned for Stage 2. Explore your geography here; scenes, journeys and continuity analysis are not available yet.</div>
<div id="mapsWelcome" hidden><h2>Your story, in place</h2><p>Start with a few places, or build a landscape a piece at a time.</p><button type="button" id="mapsWelcomeNew">Create your first map</button><div id="mapsList"></div></div>
<svg id="mapsCanvas" viewBox="-600 -400 1200 800" tabindex="0" role="group" aria-label="Story map. Drag background to pan. Use zoom controls. Select pieces for details.">
<defs>
<pattern id="map-forest" width="32" height="32" patternUnits="userSpaceOnUse"><rect width="32" height="32" fill="#c4d4af"/><path d="M8 5l-6 12h12z M23 14l-6 12h12z" fill="#63845f"/></pattern>
<pattern id="map-mountains" width="48" height="36" patternUnits="userSpaceOnUse"><rect width="48" height="36" fill="#d3cebd"/><path d="M0 32L17 5l17 27 M24 36L40 12l16 24" fill="#aca895" stroke="#727a6e"/><path d="M12 13l5-8 6 10-6-3z" fill="#f8f7ef"/></pattern>
<pattern id="map-marsh" width="30" height="30" patternUnits="userSpaceOnUse"><rect width="30" height="30" fill="#c2d3bc"/><path d="M5 25h20M10 23v-9m0 5-4-4m4 2 4-5" fill="none" stroke="#718d7a"/></pattern>
<pattern id="map-hills" width="45" height="30" patternUnits="userSpaceOnUse"><rect width="45" height="30" fill="#d8d5b1"/><path d="M0 25q12-20 24 0m-2-10q12-18 24 0" fill="none" stroke="#9eaa80"/></pattern>
<pattern id="map-farmland" width="24" height="24" patternUnits="userSpaceOnUse" patternTransform="rotate(25)"><rect width="24" height="24" fill="#e1d39c"/><path d="M0 6h24M0 18h24" stroke="#b3ad73"/></pattern>
</defs><g id="mapsScene"></g><g id="mapsHandles"></g>
</svg>
<div class="maps-canvas-tools"><button type="button" id="mapsZoomOut" aria-label="Zoom out">−</button><span id="mapsZoom">100%</span><button type="button" id="mapsZoomIn" aria-label="Zoom in">+</button><button type="button" id="mapsFit">Fit map</button><button type="button" id="mapsFitSelection">Fit selection</button><span>Not to scale · N ↑</span></div>
</div>
<aside id="mapsDetails" class="maps-details" aria-label="Details"><h2>Details</h2><div id="mapsDetailContent">Select something on the map to see its details.</div></aside>
</div>
<dialog id="mapsNewDialog"><form id="mapsNewForm"><h2>New map</h2><label>Name <input name="Name" maxlength="200" required autofocus /></label><label>What are you mapping? <select name="Kind">@foreach(var kind in PlotLine.Services.MapValidation.Kinds){<option>@kind</option>}</select></label><label>How would you like to begin? <select name="Starter"><option value="blank">Blank map</option><option value="land">Single land mass</option><option value="island">Large island</option><option value="islands">Island group</option><option value="two">Two land masses</option><option value="inland">Inland region</option><option value="local">City / local area</option></select></label><label>Parent map <select name="ParentMapID"><option value="">None</option>@foreach(var map in Model.Maps){<option value="@map.MapID">@map.Name</option>}</select></label><p>Starter layouts contain editable shapes only. You name and define your world.</p><div><button type="button" id="mapsNewCancel">Cancel</button><button type="submit">Create map</button></div></form></dialog>
<dialog id="mapsArrangeDialog"><h2>Arrange from relationships</h2><p>Preview an arrangement using directions and relative distances. Known distances never control spacing.</p><label><input type="checkbox" id="mapsOnlyNew" /> Arrange unplaced / new items only</label><p id="mapsArrangeWarnings"></p><button type="button" id="mapsArrangeCancel">Cancel</button><button type="button" id="mapsArrangeApply">Apply arrangement</button></dialog>
</section>
@Html.AntiForgeryToken()
<script id="mapsBootstrap" type="application/json">@Html.Raw(JsonSerializer.Serialize(new { projectId = Model.Project.ProjectID, maps = Model.Maps, locations = Model.Locations, floorPlans = Model.FloorPlans, document = Model.Document }, new JsonSerializerOptions(JsonSerializerDefaults.Web)))</script>
@section Scripts {
<script src="~/js/maps-engine.js" asp-append-version="true"></script>
<script src="~/js/maps-workspace.js" asp-append-version="true"></script>
}