Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
Add a sidewalk card
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Nov 7, 2022
1 parent 8710fc6 commit a7c048a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions web_editor/assets/pedestrian.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web_editor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
<button type="button" class="new-lane-card" id="new-bus">
New <img src="assets/bus.svg" class="icon" />
</button>
<button type="button" class="new-lane-card" id="new-sidewalk">
New <img src="assets/pedestrian.svg" class="icon" />
</button>
</div>
</div>

Expand Down
3 changes: 3 additions & 0 deletions web_editor/js/cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ function typeIcon(lane) {
if (lane.type == "travel" && lane.designated == "motor_vehicle") {
return icon("car");
}
if (lane.type == "travel" && lane.designated == "foot") {
return icon("pedestrian");
}
if (lane.type == "parking" && lane.designated == "motor_vehicle") {
return icon("parking");
}
Expand Down
7 changes: 7 additions & 0 deletions web_editor/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,12 @@ export class LaneEditor {
});
this.render();
};
document.getElementById("new-sidewalk").onclick = () => {
this.road.lanes.push({
type: "travel",
designated: "foot",
});
this.render();
};
}
}

0 comments on commit a7c048a

Please sign in to comment.