diff --git a/img/camera.webp b/img/camera.webp new file mode 100644 index 0000000..867644d Binary files /dev/null and b/img/camera.webp differ diff --git a/img/ic_exit_highway_to_left.webp b/img/ic_exit_highway_to_left.webp new file mode 100644 index 0000000..8c628e9 Binary files /dev/null and b/img/ic_exit_highway_to_left.webp differ diff --git a/img/ic_exit_highway_to_right.webp b/img/ic_exit_highway_to_right.webp new file mode 100644 index 0000000..0b6558d Binary files /dev/null and b/img/ic_exit_highway_to_right.webp differ diff --git a/img/ic_turn_finish.webp b/img/ic_turn_finish.webp new file mode 100644 index 0000000..0dff2a6 Binary files /dev/null and b/img/ic_turn_finish.webp differ diff --git a/img/ic_turn_left.webp b/img/ic_turn_left.webp new file mode 100644 index 0000000..6cb67d7 Binary files /dev/null and b/img/ic_turn_left.webp differ diff --git a/img/ic_turn_left_sharp.webp b/img/ic_turn_left_sharp.webp new file mode 100644 index 0000000..659c175 Binary files /dev/null and b/img/ic_turn_left_sharp.webp differ diff --git a/img/ic_turn_left_slight.webp b/img/ic_turn_left_slight.webp new file mode 100644 index 0000000..2a44d50 Binary files /dev/null and b/img/ic_turn_left_slight.webp differ diff --git a/img/ic_turn_right.webp b/img/ic_turn_right.webp new file mode 100644 index 0000000..9b17d6c Binary files /dev/null and b/img/ic_turn_right.webp differ diff --git a/img/ic_turn_right_sharp.webp b/img/ic_turn_right_sharp.webp new file mode 100644 index 0000000..f70e37d Binary files /dev/null and b/img/ic_turn_right_sharp.webp differ diff --git a/img/ic_turn_right_slight.webp b/img/ic_turn_right_slight.webp new file mode 100644 index 0000000..71e4d6a Binary files /dev/null and b/img/ic_turn_right_slight.webp differ diff --git a/img/ic_turn_round.webp b/img/ic_turn_round.webp new file mode 100644 index 0000000..99394d1 Binary files /dev/null and b/img/ic_turn_round.webp differ diff --git a/img/ic_turn_round_enter.webp b/img/ic_turn_round_enter.webp new file mode 100644 index 0000000..8ae90f0 Binary files /dev/null and b/img/ic_turn_round_enter.webp differ diff --git a/img/ic_turn_round_exit.webp b/img/ic_turn_round_exit.webp new file mode 100644 index 0000000..15bf079 Binary files /dev/null and b/img/ic_turn_round_exit.webp differ diff --git a/img/ic_turn_round_exit_1.webp b/img/ic_turn_round_exit_1.webp new file mode 100644 index 0000000..11b7376 Binary files /dev/null and b/img/ic_turn_round_exit_1.webp differ diff --git a/img/ic_turn_round_exit_10.webp b/img/ic_turn_round_exit_10.webp new file mode 100644 index 0000000..2cd6529 Binary files /dev/null and b/img/ic_turn_round_exit_10.webp differ diff --git a/img/ic_turn_round_exit_11.webp b/img/ic_turn_round_exit_11.webp new file mode 100644 index 0000000..335ef6c Binary files /dev/null and b/img/ic_turn_round_exit_11.webp differ diff --git a/img/ic_turn_round_exit_2.webp b/img/ic_turn_round_exit_2.webp new file mode 100644 index 0000000..5cee42e Binary files /dev/null and b/img/ic_turn_round_exit_2.webp differ diff --git a/img/ic_turn_round_exit_3.webp b/img/ic_turn_round_exit_3.webp new file mode 100644 index 0000000..94ab070 Binary files /dev/null and b/img/ic_turn_round_exit_3.webp differ diff --git a/img/ic_turn_round_exit_4.webp b/img/ic_turn_round_exit_4.webp new file mode 100644 index 0000000..9707d83 Binary files /dev/null and b/img/ic_turn_round_exit_4.webp differ diff --git a/img/ic_turn_round_exit_5.webp b/img/ic_turn_round_exit_5.webp new file mode 100644 index 0000000..b4af592 Binary files /dev/null and b/img/ic_turn_round_exit_5.webp differ diff --git a/img/ic_turn_round_exit_6.webp b/img/ic_turn_round_exit_6.webp new file mode 100644 index 0000000..13b5cf4 Binary files /dev/null and b/img/ic_turn_round_exit_6.webp differ diff --git a/img/ic_turn_round_exit_7.webp b/img/ic_turn_round_exit_7.webp new file mode 100644 index 0000000..7fec398 Binary files /dev/null and b/img/ic_turn_round_exit_7.webp differ diff --git a/img/ic_turn_round_exit_8.webp b/img/ic_turn_round_exit_8.webp new file mode 100644 index 0000000..3c0315d Binary files /dev/null and b/img/ic_turn_round_exit_8.webp differ diff --git a/img/ic_turn_round_exit_9.webp b/img/ic_turn_round_exit_9.webp new file mode 100644 index 0000000..d21a5b5 Binary files /dev/null and b/img/ic_turn_round_exit_9.webp differ diff --git a/img/ic_turn_straight.webp b/img/ic_turn_straight.webp new file mode 100644 index 0000000..8f38ab5 Binary files /dev/null and b/img/ic_turn_straight.webp differ diff --git a/img/ic_turn_uleft.webp b/img/ic_turn_uleft.webp new file mode 100644 index 0000000..f822b46 Binary files /dev/null and b/img/ic_turn_uleft.webp differ diff --git a/img/ic_turn_uright.webp b/img/ic_turn_uright.webp new file mode 100644 index 0000000..0657e90 Binary files /dev/null and b/img/ic_turn_uright.webp differ diff --git a/index.html b/index.html index 7a7376f..fecd5fb 100644 --- a/index.html +++ b/index.html @@ -43,6 +43,13 @@ .wide { width: 18em; } .narrow { width: 7em; } .text-bg-warning { background-color: RGBA(183,138,2,var(--bs-bg-opacity,1)) !important } + .distance { + font-weight: bold; + padding: 0.2em; + color: white; + background-color: rgba(255,255,255,0.2); + margin-right: 1em; + }
@@ -260,7 +267,7 @@ if (!value) return ""; - var size = value.length+2; + var size = value.length+6; var english = "key: "+key; var englishVersion = window.originalEnglishData[key]; @@ -268,7 +275,118 @@ english += "\nen: "+englishVersion; } - var out = ""; + + // display "then" icon + if (key == "then"){ + out += "..."; + } + + // display distance icon + if (key.substring(0,3) == "in_"){ + var dist = key.replace(/in_|_meters|_kilometers|_kilometer|_feet|_miles|_mile/g, '').replace(/_/g, '.'); + var unit = ""; + if (key.includes("kilo")){ + unit = "km"; + } else if (key.includes("meter")){ + unit = "m"; + } else if (key.includes("feet")){ + unit = "ft"; + } else if (key.includes("mile")){ + unit = "mi"; + } + out += ""+dist+unit+""; + } + + const imagesArr = { + "take_the_1_exit": "ic_turn_round_exit_1", + "take_the_2_exit": "ic_turn_round_exit_2", + "take_the_3_exit": "ic_turn_round_exit_3", + "take_the_4_exit": "ic_turn_round_exit_4", + "take_the_5_exit": "ic_turn_round_exit_5", + "take_the_6_exit": "ic_turn_round_exit_6", + "take_the_7_exit": "ic_turn_round_exit_7", + "take_the_8_exit": "ic_turn_round_exit_8", + "take_the_9_exit": "ic_turn_round_exit_9", + "take_the_10_exit": "ic_turn_round_exit_10", + "take_the_11_exit": "ic_turn_round_exit_11", + "make_a_slight_right_turn": "ic_turn_right_slight", + "make_a_right_turn": "ic_turn_right", + "make_a_sharp_right_turn": "ic_turn_right_sharp", + "enter_the_roundabout": "ic_turn_round_enter", + "leave_the_roundabout": "ic_turn_round_exit", + "make_a_slight_left_turn": "ic_turn_left_slight", + "make_a_left_turn": "ic_turn_left", + "make_a_sharp_left_turn": "ic_turn_left_sharp", + "make_a_u_turn": "ic_turn_uleft", + "go_straight": "ic_turn_straight", + "exit": "ic_exit_highway_to_right", + "destination": "ic_turn_finish", + "you_have_reached_the_destination": "ic_turn_finish", + "unknown_camera": "camera" + }; + + // _street_verb and _street use the same icons + var imageKey = key.replace(/_street_verb|_street/g, ''); + + if (img = imagesArr[imageKey]){ + + // poorly detect left/right driving based on user's browser timezone for iconography + // (the browser being used tells us about the user, versus the language being selected) + var browserTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone; + if ( + browserTimezone.includes("Nassau") || // Bahamas + browserTimezone.includes("Jamaica") || + browserTimezone.includes("Guyana") || + browserTimezone.includes("Paramaribo") || // Suriname + browserTimezone.includes("Stanley") || // Falkland + browserTimezone.includes("London") || // UK + browserTimezone.includes("GB") || // UK + browserTimezone.includes("Dublin") || // Ireland + browserTimezone.includes("Eire") || + browserTimezone.includes("Windhoek") || // Namibia + browserTimezone.includes("Johannesburg") || // South Africa + browserTimezone.includes("Maputo") || // Mozambique, Botswana, Malawi, Zambia, Zimbabwe (NOT: Burundi, DRC, Rwanda) + browserTimezone.includes("Blantyre") || // Malawi + browserTimezone.includes("Nairobi") || // Kenya, Uganda, Tanzania (NOT: Somalia, Madagascar, Comoros, Ethiopia, Eritrea, Djibouti) + browserTimezone.includes("Mbabane") || // Swaziland + browserTimezone.includes("Maseru") || // Lesotho + browserTimezone.includes("Nicosia") || // Cyprus + browserTimezone.includes("Famagusta") || // Cyprus + browserTimezone.includes("Karachi") || // Pakistan + browserTimezone.includes("Kolkata") || // India + browserTimezone.includes("Katmandu") || // Nepal + browserTimezone.includes("Thimphu") || // Bhutan + browserTimezone.includes("Dhaka") || // Bangladesh + browserTimezone.includes("Colombo") || // Sri Lanka + browserTimezone.includes("Bangkok") || // Thailand + browserTimezone.includes("Tokyo") || // Japan + browserTimezone.includes("Japan") || + browserTimezone.includes("Jakarta") || // Indonesia + browserTimezone.includes("Jayapura") || + browserTimezone.includes("Makassar") || + browserTimezone.includes("Pontianak") || + browserTimezone.includes("Singapore") || // and Malaysia + browserTimezone.includes("Bougainville") || // Papua New Guinea + browserTimezone.includes("Port_Moresby") || + browserTimezone.includes("Australia") || + browserTimezone.includes("Auckland") || // New Zealand + browserTimezone.includes("Chatham") || + browserTimezone.includes("Fiji") || + browserTimezone.includes("Pago_Pago") + ){ + imagesArr["make_a_u_turn"] = "ic_turn_uright"; + imagesArr["exit"] = "ic_exit_highway_to_left"; + } + + var imageAlt = img.replace(/ic_|turn_/g, '') + .replace(/round/g, 'roundabout').replace(/uleft|uright/g, 'u-turn') + .replace(/highway_to_left|highway_to_right/g, 'highway').replace(/_/g, ' '); + + out += ""; + } + + out += ""; - if (editable) { - out += ""; - } + if (editable) { + out += ""; + } - out += ""; + out += ""; return out; } @@ -333,7 +451,7 @@ // adjust input size by text content var size = $(this).val().length; - $(this).attr('size', size+2); + $(this).attr('size', size+6); }).dblclick(function(){ $(this).siblings().find(".editbutton").click();