Skip to content

Commit

Permalink
Use accordions and tooltips in a few places
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Mar 2, 2024
1 parent 7b28f7b commit f20e935
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 22 deletions.
23 changes: 13 additions & 10 deletions web/src/NetworkMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,19 @@
</nav>
</div>
<div slot="sidebar">
<p>
Inside the neighbourhood you define, the goal is to eliminate (or
deliberately permit) through-traffic. An appropriate neighbourhood
boundary depends on many factors. The simplest approach is to find the
area bounded on all sides by "main" roads, which are designed for higher
traffic volumes. There are many other considerations, though -- maybe
severances like rivers or rail should be part of a boundary. Bridges and
tunnels near a boundary may be confusing as well. And note that your
boundary may not match the conventional definition of "neighbourhood."
</p>
<details>
<summary>Help</summary>
<p>
Inside the neighbourhood you define, the goal is to eliminate (or
deliberately permit) through-traffic. An appropriate neighbourhood
boundary depends on many factors. The simplest approach is to find the
area bounded on all sides by "main" roads, which are designed for higher
traffic volumes. There are many other considerations, though -- maybe
severances like rivers or rail should be part of a boundary. Bridges and
tunnels near a boundary may be confusing as well. And note that your
boundary may not match the conventional definition of "neighbourhood."
</p>
</details>

<Link on:click={newBoundary}>Draw a new boundary</Link>
<ul>
Expand Down
7 changes: 6 additions & 1 deletion web/src/ViewShortcutsMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,18 @@
Pick a different road
</button>
<div style="display: flex; justify-content: space-between;">
<button disabled={state.shortcutIndex == 0} on:click={prev}>
<button
disabled={state.shortcutIndex == 0}
on:click={prev}
data-tooltip="Left"
>
Previous
</button>
{state.shortcutIndex + 1} / {state.gj.features.length}
<button
disabled={state.shortcutIndex == state.gj.features.length - 1}
on:click={next}
data-tooltip="Right"
>
Next
</button>
Expand Down
6 changes: 5 additions & 1 deletion web/src/common/snapper/SnapPolygonControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
export let route_tool: RouteTool;
</script>

<button disabled={$undoLength == 0} on:click={() => route_tool.undo()}>
<button
disabled={$undoLength == 0}
on:click={() => route_tool.undo()}
data-tooltip="Ctrl+Z"
>
{#if $undoLength == 0}
Undo
{:else}
Expand Down
25 changes: 15 additions & 10 deletions web/src/edit/NeighbourhoodMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,22 @@
Editing neighbourhood <u>{notNull(notNull(boundary).properties).name}</u>
</p>

<p>
Now that you've defined a neighbourhood boundary, you can see the possible
shortcuts that vehicles are currently able to take through it. You can add
a new modal filter to try and solve this. The colored "cell" areas show
what's reachable for drivers without leaving the boundary you've drawn.
</p>

<hr />
<details>
<summary>Help</summary>
<p>
Now that you've defined a neighbourhood boundary, you can see the
possible shortcuts that vehicles are currently able to take through it.
You can add a new modal filter to try and solve this. The colored "cell"
areas show what's reachable for drivers without leaving the boundary
you've drawn.
</p>
</details>

<div style="display: flex; justify-content: space-between;">
<button
on:click={() => (action = "filter")}
disabled={action == "filter"}
data-tooltip="hotkey 1"
>
<img
src={`${import.meta.env.BASE_URL}/filters/${$filterType}_icon.gif`}
Expand All @@ -204,12 +207,14 @@
<button
on:click={() => (action = "freehand-filters")}
disabled={action == "freehand-filters"}
data-tooltip="hotkey 2"
>
Add many modal filters along line
</button>
<button
on:click={() => (action = "oneway")}
disabled={action == "oneway"}
data-tooltip="hotkey 3"
>
Reverse directions
</button>
Expand All @@ -220,14 +225,14 @@
</button>

<div style="display: flex; justify-content: space-between;">
<button disabled={undoLength == 0} on:click={undo}>
<button disabled={undoLength == 0} on:click={undo} data-tooltip="Ctrl+Z">
{#if undoLength == 0}
Undo
{:else}
Undo ({undoLength})
{/if}
</button>
<button disabled={redoLength == 0} on:click={redo}>
<button disabled={redoLength == 0} on:click={redo} data-tooltip="Ctrl+Y">
{#if redoLength == 0}
Redo
{:else}
Expand Down

0 comments on commit f20e935

Please sign in to comment.