mirror of
https://github.com/cjdenio/uta-trax-api.git
synced 2026-12-01 00:26:25 +00:00
Compare commits
10
Commits
03ded9250d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c409a1bf1 | ||
|
|
323bc464fb | ||
|
|
65a66e552c | ||
|
|
dd8f215888 | ||
|
|
30466acca5 | ||
|
|
1d3e4a1878 | ||
|
|
d6cdb328c0 | ||
|
|
4296875b9f | ||
|
|
a8dafa828f | ||
|
|
c1ddbd474d |
No files matched your search
@@ -1,6 +1,6 @@
|
||||
all: bin
|
||||
|
||||
bin: cmd/main.go proto/*.go
|
||||
bin: cmd/main.go proto/*.go pkg/**/*.go
|
||||
go build -o bin cmd/main.go
|
||||
|
||||
proto: proto/schema.pb.go proto/gtfs-realtime.pb.go
|
||||
|
||||
@@ -7,5 +7,9 @@ Tracking all the trains & buses in Salt Lake City.
|
||||
- `GET https://uta.clb.li/api.json`: List all vehicles currently in service (JSON)
|
||||
- `GET https://uta.clb.li/api`: Same as above, but Protobuf (see )
|
||||
- `GET https://uta.clb.li/api/shapes/{shape_id}`: Get the geographic route "shape" for a given vehicle's `shape_id`
|
||||
- `GET https://uta.clb.li/api/upcoming-departures?stationIds=...`: Show upcoming scheduled departures for a given station (or stations)
|
||||
- `?stationIds=` comma-separated list of GTFS stop IDs
|
||||
- `?from=` UNIX timestamp, show upcoming departures as of this time (defaults to current time)
|
||||
- `?to=` number of seconds in the future to show departures (defaults to 3600, 1 hour)
|
||||
|
||||

|
||||
@@ -1,3 +1,3 @@
|
||||
- mobile
|
||||
- advanced filtering
|
||||
- show stops for trip
|
||||
- show stops for trip
|
||||
- `/upcoming-departures` should NOT show arrivals, only departures
|
||||
+205
-5
@@ -11,14 +11,17 @@ import (
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/cjdenio/uta-trax-api/pkg/gtfs"
|
||||
pb "github.com/cjdenio/uta-trax-api/proto"
|
||||
"github.com/jmoiron/sqlx"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
var scheduleDb *sql.DB
|
||||
var scheduleDb *sqlx.DB
|
||||
|
||||
var headsignMappings map[string]string = map[string]string{
|
||||
"to medical": "To University Medical",
|
||||
@@ -232,8 +235,9 @@ func vehicleHandler(mode string) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
feed := feedifyVehicles(vehicles, header, routeTypeFilter)
|
||||
|
||||
if mode == "json" || r.Header.Get("Accept") == "application/json" {
|
||||
feed := feedifyVehicles(vehicles, header, routeTypeFilter)
|
||||
response, err := json.Marshal(&feed)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
@@ -245,8 +249,6 @@ func vehicleHandler(mode string) http.HandlerFunc {
|
||||
w.Write(response)
|
||||
} else {
|
||||
// send a protobuf
|
||||
|
||||
feed := feedifyVehicles(vehicles, header, routeTypeFilter)
|
||||
b, err := proto.Marshal(&feed)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
@@ -322,10 +324,207 @@ func shapeHandler(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write(response)
|
||||
}
|
||||
|
||||
type Route struct {
|
||||
ID string `json:"routeId"`
|
||||
ShortName string `json:"shortName"`
|
||||
LongName string `json:"longName"`
|
||||
}
|
||||
|
||||
type Departure struct {
|
||||
Route Route `json:"route"`
|
||||
DepartureTime time.Time `json:"departureTime"`
|
||||
Headsign string `json:"headsign"`
|
||||
PredictedPlatform int `json:"predictedPlatform,omitempty"`
|
||||
TripId string `json:"tripId"`
|
||||
}
|
||||
|
||||
type ApiDepartures struct {
|
||||
Departures []Departure `json:"departures"`
|
||||
To time.Time `json:"to"`
|
||||
}
|
||||
|
||||
type DbDeparture struct {
|
||||
RouteId string `db:"route_id"`
|
||||
RouteShortName string `db:"route_short_name"`
|
||||
RouteLongName string `db:"route_long_name"`
|
||||
DepartureTime string `db:"departure_time"`
|
||||
TripHeadsign string `db:"trip_headsign"`
|
||||
TripId string `db:"trip_id"`
|
||||
DirectionId int `db:"direction_id"`
|
||||
StopId string `db:"stop_id"`
|
||||
PassingTrain bool `db:"passing_train"`
|
||||
}
|
||||
|
||||
// format: "NORTH (passing)", "SOUTH (passing)", "NORTH", "SOUTH"
|
||||
// "1" is the western track, "2" is the eastern track, "0" is unknown track
|
||||
var predictionData map[string][4]int = map[string][4]int{
|
||||
"21760": {1, 2, 1, 1}, // Roy
|
||||
"21757": {0, 0, 1, 1}, // Clearfield
|
||||
"21772": {1, 2, 0, 0}, // Layton
|
||||
"21758": {0, 0, 1, 1}, // Farmington
|
||||
"21759": {0, 0, 1, 1}, // Woods Cross
|
||||
"23113": {1, 2, 1, 2}, // North Temple
|
||||
"21771": {1, 2, 1, 2}, // Salt Lake Central
|
||||
"23080": {2, 1, 1, 1}, // Murray Central
|
||||
"23082": {0, 0, 2, 2}, // South Jordan
|
||||
"23081": {1, 2, 0, 0}, // Draper
|
||||
"23074": {1, 2, 1, 1}, // Lehi
|
||||
"23071": {0, 0, 2, 2}, // American Fork
|
||||
"25330": {2, 1, 2, 2}, // Vineyard
|
||||
"23076": {0, 0, 2, 2}, // Orem Central
|
||||
}
|
||||
|
||||
func predictPlatform(d DbDeparture) int {
|
||||
if d.RouteShortName != "750" {
|
||||
return 0
|
||||
}
|
||||
|
||||
data, ok := predictionData[d.StopId]
|
||||
if !ok {
|
||||
return 0
|
||||
}
|
||||
|
||||
idx := 0
|
||||
if !d.PassingTrain {
|
||||
idx += 2
|
||||
}
|
||||
|
||||
if d.DirectionId == 1 {
|
||||
idx += 1
|
||||
}
|
||||
return data[idx]
|
||||
}
|
||||
|
||||
func addToTime(h, m, s, secsToAdd int) (int, int, int) {
|
||||
s += secsToAdd
|
||||
if s >= 60 {
|
||||
m += s / 60
|
||||
s = s % 60
|
||||
|
||||
if m >= 60 {
|
||||
h += m / 60
|
||||
m = m % 60
|
||||
}
|
||||
}
|
||||
|
||||
return h, m, s
|
||||
}
|
||||
|
||||
func upcomingDeparturesHandler(w http.ResponseWriter, r *http.Request) {
|
||||
stationIds := strings.Split(r.URL.Query().Get("stationIds"), ",")
|
||||
if r.URL.Query().Get("stationIds") == "" || len(stationIds) == 0 {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
w.Write([]byte("missing stationIds param"))
|
||||
return
|
||||
}
|
||||
|
||||
loc, _ := time.LoadLocation("America/Denver") // ew this shouldn't be hardcoded
|
||||
|
||||
fromStr := r.URL.Query().Get("from")
|
||||
from := time.Now().In(loc)
|
||||
if fromStr != "" {
|
||||
fromInt, err := strconv.ParseInt(fromStr, 10, 64)
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
w.Write([]byte("invalid `from` param, expected UNIX timestamp"))
|
||||
return
|
||||
}
|
||||
|
||||
from = time.Unix(fromInt, 0).In(loc)
|
||||
}
|
||||
|
||||
// get current service IDs
|
||||
serviceIds, err := gtfs.GetActiveServiceIDs(&from, scheduleDb.DB)
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte("internal server error"))
|
||||
return
|
||||
}
|
||||
|
||||
var timeToAdd time.Duration = time.Minute * 60
|
||||
|
||||
toStr := r.URL.Query().Get("to")
|
||||
if toStr != "" {
|
||||
toInt, err := strconv.ParseInt(toStr, 10, 64)
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
w.Write([]byte("invalid `to` param, expected UNIX timestamp"))
|
||||
return
|
||||
}
|
||||
|
||||
timeToAdd = time.Duration(toInt) * time.Second
|
||||
}
|
||||
|
||||
toH, toM, toS := addToTime(from.Hour(), from.Minute(), from.Second(), int(timeToAdd.Seconds()))
|
||||
to := from.Add(timeToAdd)
|
||||
|
||||
// get upcoming departures
|
||||
query, args, err := sqlx.In(`select
|
||||
routes.route_id,
|
||||
routes.route_short_name,
|
||||
routes.route_long_name,
|
||||
stop_times.departure_time,
|
||||
trips.trip_headsign,
|
||||
trips.trip_id,
|
||||
trips.direction_id,
|
||||
stop_times.stop_id,
|
||||
EXISTS (
|
||||
SELECT * from stop_times st2 inner join trips t2 on t2.trip_id = st2.trip_id where st2.stop_id = stop_times.stop_id and t2.service_id IN (?) and (st2.departure_timestamp <= stop_times.departure_timestamp + 300) and (st2.departure_timestamp >= stop_times.departure_timestamp - 300 and stop_times.trip_id != st2.trip_id AND trips.direction_id != t2.direction_id)
|
||||
) AS passing_train
|
||||
from stop_times
|
||||
inner join trips on trips.trip_id = stop_times.trip_id
|
||||
inner join routes on routes.route_id = trips.route_id
|
||||
where trips.service_id IN (?) and stop_times.stop_id IN (?) and stop_times.departure_time >= ? and stop_times.departure_time < ?
|
||||
order by stop_times.departure_time asc`, serviceIds, serviceIds, stationIds, from.Format("15:04:05"), fmt.Sprintf("%02d:%02d:%02d", toH, toM, toS))
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte("internal server error"))
|
||||
return
|
||||
}
|
||||
|
||||
dbDepartures := []DbDeparture{}
|
||||
err = scheduleDb.Select(&dbDepartures, query, args...)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte("internal server error"))
|
||||
return
|
||||
}
|
||||
|
||||
departures := make([]Departure, 0, len(dbDepartures))
|
||||
|
||||
for _, departure := range dbDepartures {
|
||||
t, err := time.Parse("15:04:05", departure.DepartureTime)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
departures = append(departures, Departure{
|
||||
Route: Route{
|
||||
ID: departure.RouteId,
|
||||
ShortName: departure.RouteShortName,
|
||||
LongName: departure.RouteLongName,
|
||||
},
|
||||
DepartureTime: time.Date(from.Year(), from.Month(), from.Day(), t.Hour(), t.Minute(), t.Second(), 0, loc),
|
||||
Headsign: departure.TripHeadsign,
|
||||
PredictedPlatform: predictPlatform(departure),
|
||||
TripId: departure.TripId,
|
||||
})
|
||||
}
|
||||
|
||||
response, _ := json.Marshal(ApiDepartures{
|
||||
Departures: departures,
|
||||
To: to,
|
||||
})
|
||||
|
||||
w.Header().Add("Content-Type", "application/json")
|
||||
w.Write(response)
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println("Opening database...")
|
||||
|
||||
_db, err := sql.Open("sqlite3", "uta-gtfs.db")
|
||||
_db, err := sqlx.Open("sqlite3", "uta-gtfs.db")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -342,6 +541,7 @@ func main() {
|
||||
http.HandleFunc("/api.json", vehicleHandler("json"))
|
||||
http.HandleFunc("/api/trips/{trip}", tripHandler)
|
||||
http.HandleFunc("/api/shapes/{shape}", shapeHandler)
|
||||
http.HandleFunc("/api/upcoming-departures", upcomingDeparturesHandler)
|
||||
|
||||
port := "3000"
|
||||
if portEnv, ok := os.LookupEnv("PORT"); ok {
|
||||
|
||||
@@ -3,6 +3,7 @@ module github.com/cjdenio/uta-trax-api
|
||||
go 1.24.2
|
||||
|
||||
require (
|
||||
github.com/mattn/go-sqlite3 v1.14.28 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
github.com/jmoiron/sqlx v1.4.0
|
||||
github.com/mattn/go-sqlite3 v1.14.28
|
||||
google.golang.org/protobuf v1.36.6
|
||||
)
|
||||
@@ -1,4 +1,17 @@
|
||||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
|
||||
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
||||
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
|
||||
github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=
|
||||
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.28 h1:ThEiQrnbtumT+QMknw63Befp/ce/nUPgBPMlRFEum7A=
|
||||
github.com/mattn/go-sqlite3 v1.14.28/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
@@ -0,0 +1,40 @@
|
||||
package gtfs
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"time"
|
||||
)
|
||||
|
||||
func GetActiveServiceIDs(t *time.Time, db *sql.DB) ([]string, error) {
|
||||
weekday := t.Weekday()
|
||||
|
||||
rows, err := db.Query(`select service_id from calendar
|
||||
WHERE (
|
||||
case $1
|
||||
when 0 then sunday
|
||||
when 1 then monday
|
||||
when 2 then tuesday
|
||||
when 3 then wednesday
|
||||
when 4 then thursday
|
||||
when 5 then friday
|
||||
when 6 then saturday
|
||||
end
|
||||
) AND $2 >= start_date AND $2 <= end_date AND NOT EXISTS (
|
||||
SELECT calendar_dates.service_id FROM calendar_dates WHERE calendar_dates.service_id = calendar.service_id AND calendar_dates.date = $2 AND calendar_dates.exception_type = 2
|
||||
)
|
||||
union
|
||||
select service_id from calendar_dates where date = $2 AND exception_type = 1;`, weekday, t.Format("20060102"))
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
result := []string{}
|
||||
for rows.Next() {
|
||||
var serviceId string
|
||||
rows.Scan(&serviceId)
|
||||
result = append(result, serviceId)
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
+159
-33
@@ -13,10 +13,13 @@
|
||||
crossorigin=""
|
||||
/>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<style>
|
||||
body:not(.skip-vehicle-animation) .leaflet-marker-icon:has(.vehicle) {
|
||||
@@ -68,7 +71,13 @@
|
||||
}
|
||||
|
||||
.vehicle-rainbow {
|
||||
background-image: linear-gradient(to bottom right, #2eb566 33%, #004a97 33%, #004a97 66%, #be2036 66%);
|
||||
background-image: linear-gradient(
|
||||
to bottom right,
|
||||
#2eb566 33%,
|
||||
#004a97 33%,
|
||||
#004a97 66%,
|
||||
#be2036 66%
|
||||
);
|
||||
}
|
||||
|
||||
.nav {
|
||||
@@ -100,16 +109,20 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 40px;
|
||||
text-align: center;
|
||||
padding: 2px 5px;
|
||||
padding: 10px 5px;
|
||||
}
|
||||
|
||||
#banner.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#map, #sidebar {
|
||||
#map {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#map,
|
||||
#sidebar {
|
||||
grid-row: 3 / 4;
|
||||
}
|
||||
|
||||
@@ -153,7 +166,7 @@
|
||||
}
|
||||
|
||||
.bottom-bar__vehicle-filter--deselected {
|
||||
filter: grayscale(1.0);
|
||||
filter: grayscale(1);
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
@@ -169,6 +182,42 @@
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
#loader {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition-property: visibility, opacity;
|
||||
transition-duration: 500ms;
|
||||
}
|
||||
|
||||
#loader.loader--hidden {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spin {
|
||||
animation: spin 2s linear infinite;
|
||||
}
|
||||
|
||||
#loader p {
|
||||
color: white;
|
||||
font-size: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@@ -179,34 +228,90 @@
|
||||
the day, or UTA's tracker isn't working. Come back later!
|
||||
</div>
|
||||
<div class="nav">
|
||||
<a title="UTA Vehicle Tracker" href="https://uta.clb.li" class="nav__item--selected">🚆</a>
|
||||
<a
|
||||
title="UTA Vehicle Tracker"
|
||||
href="https://uta.clb.li"
|
||||
class="nav__item--selected"
|
||||
>🚆</a
|
||||
>
|
||||
<a title="TRAXcidents" href="https://traxcidents.clb.li">💥</a>
|
||||
<a title="GreenBike Firehose" href="https://greenbike.clb.li">🚲</a>
|
||||
</div>
|
||||
|
||||
<div id="map"></div>
|
||||
<div id="map">
|
||||
<div id="loader">
|
||||
<div class="vehicle vehicle-centered vehicle-rainbow spin">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
|
||||
<!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
|
||||
<path
|
||||
d="M128 72C128 58.7 138.7 48 152 48L488 48C501.3 48 512 58.7 512 72L512 104C512 117.3 501.3 128 488 128C474.7 128 464 117.3 464 104L464 96L344 96L344 160L384 160C437 160 480 203 480 256L480 416C480 447.2 465.1 475 442 492.5L506.3 568.5C514.9 578.6 513.6 593.8 503.5 602.3C493.4 610.8 478.2 609.6 469.7 599.5L395.1 511.4C391.5 511.8 387.8 512 384 512L256 512C252.2 512 248.5 511.8 244.9 511.4L170.3 599.5C161.7 609.6 146.6 610.9 136.5 602.3C126.4 593.7 125.1 578.6 133.7 568.5L198 492.5C174.9 475 160 447.2 160 416L160 256C160 203 203 160 256 160L296 160L296 96L176 96L176 104C176 117.3 165.3 128 152 128C138.7 128 128 117.3 128 104L128 72zM256 224C238.3 224 224 238.3 224 256L224 288C224 305.7 238.3 320 256 320L384 320C401.7 320 416 305.7 416 288L416 256C416 238.3 401.7 224 384 224L256 224zM288 416C288 398.3 273.7 384 256 384C238.3 384 224 398.3 224 416C224 433.7 238.3 448 256 448C273.7 448 288 433.7 288 416zM384 448C401.7 448 416 433.7 416 416C416 398.3 401.7 384 384 384C366.3 384 352 398.3 352 416C352 433.7 366.3 448 384 448z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<p>loading...</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bottom-bar">
|
||||
<div class="bottom-bar__vehicle-filter" :class="busLayer || 'bottom-bar__vehicle-filter--deselected'" @click="toggleLayer('bus')">
|
||||
<div class="vehicle vehicle-plain vehicle-centered" style="--color: #2eb566;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M192 64C139 64 96 107 96 160L96 448C96 477.8 116.4 502.9 144 510L144 544C144 561.7 158.3 576 176 576L192 576C209.7 576 224 561.7 224 544L224 512L416 512L416 544C416 561.7 430.3 576 448 576L464 576C481.7 576 496 561.7 496 544L496 510C523.6 502.9 544 477.8 544 448L544 160C544 107 501 64 448 64L192 64zM160 240C160 222.3 174.3 208 192 208L296 208L296 320L192 320C174.3 320 160 305.7 160 288L160 240zM344 320L344 208L448 208C465.7 208 480 222.3 480 240L480 288C480 305.7 465.7 320 448 320L344 320zM192 384C209.7 384 224 398.3 224 416C224 433.7 209.7 448 192 448C174.3 448 160 433.7 160 416C160 398.3 174.3 384 192 384zM448 384C465.7 384 480 398.3 480 416C480 433.7 465.7 448 448 448C430.3 448 416 433.7 416 416C416 398.3 430.3 384 448 384zM248 136C248 122.7 258.7 112 272 112L368 112C381.3 112 392 122.7 392 136C392 149.3 381.3 160 368 160L272 160C258.7 160 248 149.3 248 136z"/></svg>
|
||||
<div
|
||||
class="bottom-bar__vehicle-filter"
|
||||
:class="busLayer || 'bottom-bar__vehicle-filter--deselected'"
|
||||
@click="toggleLayer('bus')"
|
||||
>
|
||||
<div
|
||||
class="vehicle vehicle-plain vehicle-centered"
|
||||
style="--color: #2eb566"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
|
||||
<!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
|
||||
<path
|
||||
d="M192 64C139 64 96 107 96 160L96 448C96 477.8 116.4 502.9 144 510L144 544C144 561.7 158.3 576 176 576L192 576C209.7 576 224 561.7 224 544L224 512L416 512L416 544C416 561.7 430.3 576 448 576L464 576C481.7 576 496 561.7 496 544L496 510C523.6 502.9 544 477.8 544 448L544 160C544 107 501 64 448 64L192 64zM160 240C160 222.3 174.3 208 192 208L296 208L296 320L192 320C174.3 320 160 305.7 160 288L160 240zM344 320L344 208L448 208C465.7 208 480 222.3 480 240L480 288C480 305.7 465.7 320 448 320L344 320zM192 384C209.7 384 224 398.3 224 416C224 433.7 209.7 448 192 448C174.3 448 160 433.7 160 416C160 398.3 174.3 384 192 384zM448 384C465.7 384 480 398.3 480 416C480 433.7 465.7 448 448 448C430.3 448 416 433.7 416 416C416 398.3 430.3 384 448 384zM248 136C248 122.7 258.7 112 272 112L368 112C381.3 112 392 122.7 392 136C392 149.3 381.3 160 368 160L272 160C258.7 160 248 149.3 248 136z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<p>Bus</p>
|
||||
</div>
|
||||
<div class="bottom-bar__vehicle-filter" :class="brtLayer || 'bottom-bar__vehicle-filter--deselected'" @click="toggleLayer('brt')">
|
||||
<div class="vehicle vehicle-centered" style="--color: #1191d0;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M192 64C139 64 96 107 96 160L96 448C96 477.8 116.4 502.9 144 510L144 544C144 561.7 158.3 576 176 576L192 576C209.7 576 224 561.7 224 544L224 512L416 512L416 544C416 561.7 430.3 576 448 576L464 576C481.7 576 496 561.7 496 544L496 510C523.6 502.9 544 477.8 544 448L544 160C544 107 501 64 448 64L192 64zM160 240C160 222.3 174.3 208 192 208L296 208L296 320L192 320C174.3 320 160 305.7 160 288L160 240zM344 320L344 208L448 208C465.7 208 480 222.3 480 240L480 288C480 305.7 465.7 320 448 320L344 320zM192 384C209.7 384 224 398.3 224 416C224 433.7 209.7 448 192 448C174.3 448 160 433.7 160 416C160 398.3 174.3 384 192 384zM448 384C465.7 384 480 398.3 480 416C480 433.7 465.7 448 448 448C430.3 448 416 433.7 416 416C416 398.3 430.3 384 448 384zM248 136C248 122.7 258.7 112 272 112L368 112C381.3 112 392 122.7 392 136C392 149.3 381.3 160 368 160L272 160C258.7 160 248 149.3 248 136z"/></svg>
|
||||
<div
|
||||
class="bottom-bar__vehicle-filter"
|
||||
:class="brtLayer || 'bottom-bar__vehicle-filter--deselected'"
|
||||
@click="toggleLayer('brt')"
|
||||
>
|
||||
<div class="vehicle vehicle-centered" style="--color: #1191d0">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
|
||||
<!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
|
||||
<path
|
||||
d="M192 64C139 64 96 107 96 160L96 448C96 477.8 116.4 502.9 144 510L144 544C144 561.7 158.3 576 176 576L192 576C209.7 576 224 561.7 224 544L224 512L416 512L416 544C416 561.7 430.3 576 448 576L464 576C481.7 576 496 561.7 496 544L496 510C523.6 502.9 544 477.8 544 448L544 160C544 107 501 64 448 64L192 64zM160 240C160 222.3 174.3 208 192 208L296 208L296 320L192 320C174.3 320 160 305.7 160 288L160 240zM344 320L344 208L448 208C465.7 208 480 222.3 480 240L480 288C480 305.7 465.7 320 448 320L344 320zM192 384C209.7 384 224 398.3 224 416C224 433.7 209.7 448 192 448C174.3 448 160 433.7 160 416C160 398.3 174.3 384 192 384zM448 384C465.7 384 480 398.3 480 416C480 433.7 465.7 448 448 448C430.3 448 416 433.7 416 416C416 398.3 430.3 384 448 384zM248 136C248 122.7 258.7 112 272 112L368 112C381.3 112 392 122.7 392 136C392 149.3 381.3 160 368 160L272 160C258.7 160 248 149.3 248 136z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<p>BRT</p>
|
||||
</div>
|
||||
<div class="bottom-bar__vehicle-filter" :class="traxLayer || 'bottom-bar__vehicle-filter--deselected'" @click="toggleLayer('trax')">
|
||||
<div
|
||||
class="bottom-bar__vehicle-filter"
|
||||
:class="traxLayer || 'bottom-bar__vehicle-filter--deselected'"
|
||||
@click="toggleLayer('trax')"
|
||||
>
|
||||
<div class="vehicle vehicle-centered vehicle-rainbow">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M128 72C128 58.7 138.7 48 152 48L488 48C501.3 48 512 58.7 512 72L512 104C512 117.3 501.3 128 488 128C474.7 128 464 117.3 464 104L464 96L344 96L344 160L384 160C437 160 480 203 480 256L480 416C480 447.2 465.1 475 442 492.5L506.3 568.5C514.9 578.6 513.6 593.8 503.5 602.3C493.4 610.8 478.2 609.6 469.7 599.5L395.1 511.4C391.5 511.8 387.8 512 384 512L256 512C252.2 512 248.5 511.8 244.9 511.4L170.3 599.5C161.7 609.6 146.6 610.9 136.5 602.3C126.4 593.7 125.1 578.6 133.7 568.5L198 492.5C174.9 475 160 447.2 160 416L160 256C160 203 203 160 256 160L296 160L296 96L176 96L176 104C176 117.3 165.3 128 152 128C138.7 128 128 117.3 128 104L128 72zM256 224C238.3 224 224 238.3 224 256L224 288C224 305.7 238.3 320 256 320L384 320C401.7 320 416 305.7 416 288L416 256C416 238.3 401.7 224 384 224L256 224zM288 416C288 398.3 273.7 384 256 384C238.3 384 224 398.3 224 416C224 433.7 238.3 448 256 448C273.7 448 288 433.7 288 416zM384 448C401.7 448 416 433.7 416 416C416 398.3 401.7 384 384 384C366.3 384 352 398.3 352 416C352 433.7 366.3 448 384 448z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
|
||||
<!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
|
||||
<path
|
||||
d="M128 72C128 58.7 138.7 48 152 48L488 48C501.3 48 512 58.7 512 72L512 104C512 117.3 501.3 128 488 128C474.7 128 464 117.3 464 104L464 96L344 96L344 160L384 160C437 160 480 203 480 256L480 416C480 447.2 465.1 475 442 492.5L506.3 568.5C514.9 578.6 513.6 593.8 503.5 602.3C493.4 610.8 478.2 609.6 469.7 599.5L395.1 511.4C391.5 511.8 387.8 512 384 512L256 512C252.2 512 248.5 511.8 244.9 511.4L170.3 599.5C161.7 609.6 146.6 610.9 136.5 602.3C126.4 593.7 125.1 578.6 133.7 568.5L198 492.5C174.9 475 160 447.2 160 416L160 256C160 203 203 160 256 160L296 160L296 96L176 96L176 104C176 117.3 165.3 128 152 128C138.7 128 128 117.3 128 104L128 72zM256 224C238.3 224 224 238.3 224 256L224 288C224 305.7 238.3 320 256 320L384 320C401.7 320 416 305.7 416 288L416 256C416 238.3 401.7 224 384 224L256 224zM288 416C288 398.3 273.7 384 256 384C238.3 384 224 398.3 224 416C224 433.7 238.3 448 256 448C273.7 448 288 433.7 288 416zM384 448C401.7 448 416 433.7 416 416C416 398.3 401.7 384 384 384C366.3 384 352 398.3 352 416C352 433.7 366.3 448 384 448z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<p>TRAX</p>
|
||||
</div>
|
||||
<div class="bottom-bar__vehicle-filter" :class="frontRunnerLayer || 'bottom-bar__vehicle-filter--deselected'" @click="toggleLayer('frontRunner')">
|
||||
<div class="vehicle vehicle-centered" style="--color: #c227b9;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M128 160C128 107 171 64 224 64L416 64C469 64 512 107 512 160L512 416C512 456.1 487.4 490.5 452.5 504.8L506.4 568.5C515 578.6 513.7 593.8 503.6 602.3C493.5 610.8 478.3 609.6 469.8 599.5L395.8 512L244.5 512L170.5 599.5C161.9 609.6 146.8 610.9 136.7 602.3C126.6 593.7 125.3 578.6 133.9 568.5L187.8 504.8C152.6 490.5 128 456.1 128 416L128 160zM192 192L192 288C192 305.7 206.3 320 224 320L416 320C433.7 320 448 305.7 448 288L448 192C448 174.3 433.7 160 416 160L224 160C206.3 160 192 174.3 192 192zM320 448C337.7 448 352 433.7 352 416C352 398.3 337.7 384 320 384C302.3 384 288 398.3 288 416C288 433.7 302.3 448 320 448z"/></svg>
|
||||
<div
|
||||
class="bottom-bar__vehicle-filter"
|
||||
:class="frontRunnerLayer || 'bottom-bar__vehicle-filter--deselected'"
|
||||
@click="toggleLayer('frontRunner')"
|
||||
>
|
||||
<div class="vehicle vehicle-centered" style="--color: #c227b9">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
|
||||
<!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
|
||||
<path
|
||||
d="M128 160C128 107 171 64 224 64L416 64C469 64 512 107 512 160L512 416C512 456.1 487.4 490.5 452.5 504.8L506.4 568.5C515 578.6 513.7 593.8 503.6 602.3C493.5 610.8 478.3 609.6 469.8 599.5L395.8 512L244.5 512L170.5 599.5C161.9 609.6 146.8 610.9 136.7 602.3C126.6 593.7 125.3 578.6 133.9 568.5L187.8 504.8C152.6 490.5 128 456.1 128 416L128 160zM192 192L192 288C192 305.7 206.3 320 224 320L416 320C433.7 320 448 305.7 448 288L448 192C448 174.3 433.7 160 416 160L224 160C206.3 160 192 174.3 192 192zM320 448C337.7 448 352 433.7 352 416C352 398.3 337.7 384 320 384C302.3 384 288 398.3 288 416C288 433.7 302.3 448 320 448z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<p>FrontRunner</p>
|
||||
</div>
|
||||
@@ -219,8 +324,16 @@
|
||||
|
||||
<div>
|
||||
<label for="bus">
|
||||
<div class="vehicle vehicle-plain vehicle-centered" style="--color: #2eb566;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M192 64C139 64 96 107 96 160L96 448C96 477.8 116.4 502.9 144 510L144 544C144 561.7 158.3 576 176 576L192 576C209.7 576 224 561.7 224 544L224 512L416 512L416 544C416 561.7 430.3 576 448 576L464 576C481.7 576 496 561.7 496 544L496 510C523.6 502.9 544 477.8 544 448L544 160C544 107 501 64 448 64L192 64zM160 240C160 222.3 174.3 208 192 208L296 208L296 320L192 320C174.3 320 160 305.7 160 288L160 240zM344 320L344 208L448 208C465.7 208 480 222.3 480 240L480 288C480 305.7 465.7 320 448 320L344 320zM192 384C209.7 384 224 398.3 224 416C224 433.7 209.7 448 192 448C174.3 448 160 433.7 160 416C160 398.3 174.3 384 192 384zM448 384C465.7 384 480 398.3 480 416C480 433.7 465.7 448 448 448C430.3 448 416 433.7 416 416C416 398.3 430.3 384 448 384zM248 136C248 122.7 258.7 112 272 112L368 112C381.3 112 392 122.7 392 136C392 149.3 381.3 160 368 160L272 160C258.7 160 248 149.3 248 136z"/></svg>
|
||||
<div
|
||||
class="vehicle vehicle-plain vehicle-centered"
|
||||
style="--color: #2eb566"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
|
||||
<!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
|
||||
<path
|
||||
d="M192 64C139 64 96 107 96 160L96 448C96 477.8 116.4 502.9 144 510L144 544C144 561.7 158.3 576 176 576L192 576C209.7 576 224 561.7 224 544L224 512L416 512L416 544C416 561.7 430.3 576 448 576L464 576C481.7 576 496 561.7 496 544L496 510C523.6 502.9 544 477.8 544 448L544 160C544 107 501 64 448 64L192 64zM160 240C160 222.3 174.3 208 192 208L296 208L296 320L192 320C174.3 320 160 305.7 160 288L160 240zM344 320L344 208L448 208C465.7 208 480 222.3 480 240L480 288C480 305.7 465.7 320 448 320L344 320zM192 384C209.7 384 224 398.3 224 416C224 433.7 209.7 448 192 448C174.3 448 160 433.7 160 416C160 398.3 174.3 384 192 384zM448 384C465.7 384 480 398.3 480 416C480 433.7 465.7 448 448 448C430.3 448 416 433.7 416 416C416 398.3 430.3 384 448 384zM248 136C248 122.7 258.7 112 272 112L368 112C381.3 112 392 122.7 392 136C392 149.3 381.3 160 368 160L272 160C258.7 160 248 149.3 248 136z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
Regular Bus
|
||||
<input
|
||||
@@ -234,8 +347,13 @@
|
||||
</div>
|
||||
<div>
|
||||
<label for="brt">
|
||||
<div class="vehicle vehicle-centered" style="--color: #1191d0;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M192 64C139 64 96 107 96 160L96 448C96 477.8 116.4 502.9 144 510L144 544C144 561.7 158.3 576 176 576L192 576C209.7 576 224 561.7 224 544L224 512L416 512L416 544C416 561.7 430.3 576 448 576L464 576C481.7 576 496 561.7 496 544L496 510C523.6 502.9 544 477.8 544 448L544 160C544 107 501 64 448 64L192 64zM160 240C160 222.3 174.3 208 192 208L296 208L296 320L192 320C174.3 320 160 305.7 160 288L160 240zM344 320L344 208L448 208C465.7 208 480 222.3 480 240L480 288C480 305.7 465.7 320 448 320L344 320zM192 384C209.7 384 224 398.3 224 416C224 433.7 209.7 448 192 448C174.3 448 160 433.7 160 416C160 398.3 174.3 384 192 384zM448 384C465.7 384 480 398.3 480 416C480 433.7 465.7 448 448 448C430.3 448 416 433.7 416 416C416 398.3 430.3 384 448 384zM248 136C248 122.7 258.7 112 272 112L368 112C381.3 112 392 122.7 392 136C392 149.3 381.3 160 368 160L272 160C258.7 160 248 149.3 248 136z"/></svg>
|
||||
<div class="vehicle vehicle-centered" style="--color: #1191d0">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
|
||||
<!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
|
||||
<path
|
||||
d="M192 64C139 64 96 107 96 160L96 448C96 477.8 116.4 502.9 144 510L144 544C144 561.7 158.3 576 176 576L192 576C209.7 576 224 561.7 224 544L224 512L416 512L416 544C416 561.7 430.3 576 448 576L464 576C481.7 576 496 561.7 496 544L496 510C523.6 502.9 544 477.8 544 448L544 160C544 107 501 64 448 64L192 64zM160 240C160 222.3 174.3 208 192 208L296 208L296 320L192 320C174.3 320 160 305.7 160 288L160 240zM344 320L344 208L448 208C465.7 208 480 222.3 480 240L480 288C480 305.7 465.7 320 448 320L344 320zM192 384C209.7 384 224 398.3 224 416C224 433.7 209.7 448 192 448C174.3 448 160 433.7 160 416C160 398.3 174.3 384 192 384zM448 384C465.7 384 480 398.3 480 416C480 433.7 465.7 448 448 448C430.3 448 416 433.7 416 416C416 398.3 430.3 384 448 384zM248 136C248 122.7 258.7 112 272 112L368 112C381.3 112 392 122.7 392 136C392 149.3 381.3 160 368 160L272 160C258.7 160 248 149.3 248 136z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
BRT
|
||||
<input
|
||||
@@ -250,7 +368,12 @@
|
||||
<div>
|
||||
<label for="trax">
|
||||
<div class="vehicle vehicle-centered vehicle-rainbow">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M128 72C128 58.7 138.7 48 152 48L488 48C501.3 48 512 58.7 512 72L512 104C512 117.3 501.3 128 488 128C474.7 128 464 117.3 464 104L464 96L344 96L344 160L384 160C437 160 480 203 480 256L480 416C480 447.2 465.1 475 442 492.5L506.3 568.5C514.9 578.6 513.6 593.8 503.5 602.3C493.4 610.8 478.2 609.6 469.7 599.5L395.1 511.4C391.5 511.8 387.8 512 384 512L256 512C252.2 512 248.5 511.8 244.9 511.4L170.3 599.5C161.7 609.6 146.6 610.9 136.5 602.3C126.4 593.7 125.1 578.6 133.7 568.5L198 492.5C174.9 475 160 447.2 160 416L160 256C160 203 203 160 256 160L296 160L296 96L176 96L176 104C176 117.3 165.3 128 152 128C138.7 128 128 117.3 128 104L128 72zM256 224C238.3 224 224 238.3 224 256L224 288C224 305.7 238.3 320 256 320L384 320C401.7 320 416 305.7 416 288L416 256C416 238.3 401.7 224 384 224L256 224zM288 416C288 398.3 273.7 384 256 384C238.3 384 224 398.3 224 416C224 433.7 238.3 448 256 448C273.7 448 288 433.7 288 416zM384 448C401.7 448 416 433.7 416 416C416 398.3 401.7 384 384 384C366.3 384 352 398.3 352 416C352 433.7 366.3 448 384 448z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
|
||||
<!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
|
||||
<path
|
||||
d="M128 72C128 58.7 138.7 48 152 48L488 48C501.3 48 512 58.7 512 72L512 104C512 117.3 501.3 128 488 128C474.7 128 464 117.3 464 104L464 96L344 96L344 160L384 160C437 160 480 203 480 256L480 416C480 447.2 465.1 475 442 492.5L506.3 568.5C514.9 578.6 513.6 593.8 503.5 602.3C493.4 610.8 478.2 609.6 469.7 599.5L395.1 511.4C391.5 511.8 387.8 512 384 512L256 512C252.2 512 248.5 511.8 244.9 511.4L170.3 599.5C161.7 609.6 146.6 610.9 136.5 602.3C126.4 593.7 125.1 578.6 133.7 568.5L198 492.5C174.9 475 160 447.2 160 416L160 256C160 203 203 160 256 160L296 160L296 96L176 96L176 104C176 117.3 165.3 128 152 128C138.7 128 128 117.3 128 104L128 72zM256 224C238.3 224 224 238.3 224 256L224 288C224 305.7 238.3 320 256 320L384 320C401.7 320 416 305.7 416 288L416 256C416 238.3 401.7 224 384 224L256 224zM288 416C288 398.3 273.7 384 256 384C238.3 384 224 398.3 224 416C224 433.7 238.3 448 256 448C273.7 448 288 433.7 288 416zM384 448C401.7 448 416 433.7 416 416C416 398.3 401.7 384 384 384C366.3 384 352 398.3 352 416C352 433.7 366.3 448 384 448z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
TRAX + S-Line (light rail)
|
||||
<input
|
||||
@@ -264,8 +387,13 @@
|
||||
</div>
|
||||
<div>
|
||||
<label for="frontrunner">
|
||||
<div class="vehicle vehicle-centered" style="--color: #c227b9;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M128 160C128 107 171 64 224 64L416 64C469 64 512 107 512 160L512 416C512 456.1 487.4 490.5 452.5 504.8L506.4 568.5C515 578.6 513.7 593.8 503.6 602.3C493.5 610.8 478.3 609.6 469.8 599.5L395.8 512L244.5 512L170.5 599.5C161.9 609.6 146.8 610.9 136.7 602.3C126.6 593.7 125.3 578.6 133.9 568.5L187.8 504.8C152.6 490.5 128 456.1 128 416L128 160zM192 192L192 288C192 305.7 206.3 320 224 320L416 320C433.7 320 448 305.7 448 288L448 192C448 174.3 433.7 160 416 160L224 160C206.3 160 192 174.3 192 192zM320 448C337.7 448 352 433.7 352 416C352 398.3 337.7 384 320 384C302.3 384 288 398.3 288 416C288 433.7 302.3 448 320 448z"/></svg>
|
||||
<div class="vehicle vehicle-centered" style="--color: #c227b9">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
|
||||
<!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
|
||||
<path
|
||||
d="M128 160C128 107 171 64 224 64L416 64C469 64 512 107 512 160L512 416C512 456.1 487.4 490.5 452.5 504.8L506.4 568.5C515 578.6 513.7 593.8 503.6 602.3C493.5 610.8 478.3 609.6 469.8 599.5L395.8 512L244.5 512L170.5 599.5C161.9 609.6 146.8 610.9 136.7 602.3C126.6 593.7 125.3 578.6 133.9 568.5L187.8 504.8C152.6 490.5 128 456.1 128 416L128 160zM192 192L192 288C192 305.7 206.3 320 224 320L416 320C433.7 320 448 305.7 448 288L448 192C448 174.3 433.7 160 416 160L224 160C206.3 160 192 174.3 192 192zM320 448C337.7 448 352 433.7 352 416C352 398.3 337.7 384 320 384C302.3 384 288 398.3 288 416C288 433.7 302.3 448 320 448z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
FrontRunner (commuter rail)
|
||||
<input
|
||||
@@ -283,9 +411,7 @@
|
||||
<div>
|
||||
<p>There are...</p>
|
||||
<ul>
|
||||
<li>
|
||||
<strong id="count-bus">-</strong> bus(es)
|
||||
</li>
|
||||
<li><strong id="count-bus">-</strong> bus(es)</li>
|
||||
<li><strong id="count-trax">-</strong> TRAX train(s)</li>
|
||||
<li>
|
||||
<strong id="count-frontrunner">-</strong> FrontRunner train(s)
|
||||
@@ -300,6 +426,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="module" src="/js/main.js?v=14"></script>
|
||||
<script type="module" src="/js/main.js?v=15"></script>
|
||||
</body>
|
||||
</html>
|
||||
+9
-2
@@ -288,6 +288,8 @@ function renderVehicle(vehicle) {
|
||||
});
|
||||
}
|
||||
|
||||
let isLoaded = false
|
||||
|
||||
async function reload() {
|
||||
const { vehicles = [], info } = await fetch("/api", { headers: { Accept: "application/json" } }).then((r) => r.json());
|
||||
|
||||
@@ -344,12 +346,17 @@ async function reload() {
|
||||
currentVehicles.delete(key)
|
||||
}
|
||||
}
|
||||
|
||||
if (!isLoaded) {
|
||||
document.getElementById("loader").classList.add("loader--hidden")
|
||||
isLoaded = true
|
||||
}
|
||||
|
||||
setTimeout(() => reload(), 5000);
|
||||
}
|
||||
|
||||
reload();
|
||||
|
||||
setInterval(reload, 5000);
|
||||
|
||||
Alpine.data('app', () => ({
|
||||
busLayer: true,
|
||||
brtLayer: true,
|
||||
|
||||
BIN
Binary file not shown.
Reference in new issue
Block a user