Add icon, add alert sound options, add online maps (needs tweaking), remove node_modules
@ -9,6 +9,14 @@
|
||||
</author>
|
||||
<content src="index.html"/>
|
||||
<plugin name="cordova-plugin-whitelist" spec="1"/>
|
||||
<platform name="android">
|
||||
<!--<icon background="res/android/drawable/ic_launcher_background.xml" density="ldpi" foreground="res/android/drawable/ic_launcher_foreground.xml" src="res/android/mipmap-ldpi/ic_launcher.png" />-->
|
||||
<icon background="res/android/drawable/ic_launcher_background.xml" density="mdpi" foreground="res/android/drawable/ic_launcher_foreground.xml" src="res/android/mipmap-mdpi/ic_launcher.png" />
|
||||
<icon background="res/android/drawable/ic_launcher_background.xml" density="hdpi" foreground="res/android/drawable/ic_launcher_foreground.xml" src="res/android/mipmap-hdpi/ic_launcher.png" />
|
||||
<icon background="res/android/drawable/ic_launcher_background.xml" density="xhdpi" foreground="res/android/drawable/ic_launcher_foreground.xml" src="res/android/mipmap-xhdpi/ic_launcher.png" />
|
||||
<icon background="res/android/drawable/ic_launcher_background.xml" density="xxhdpi" foreground="res/android/drawable/ic_launcher_foreground.xml" src="res/android/mipmap-xxhdpi/ic_launcher.png" />
|
||||
<icon background="res/android/drawable/ic_launcher_background.xml" density="xxxhdpi" foreground="res/android/drawable/ic_launcher_foreground.xml" src="res/android/mipmap-xxxhdpi/ic_launcher.png" />
|
||||
</platform>
|
||||
<access origin="*"/>
|
||||
<allow-intent href="http://*/*"/>
|
||||
<allow-intent href="https://*/*"/>
|
||||
|
@ -22,6 +22,7 @@
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"cordova-android": "^8.0.0",
|
||||
"cordova-plugin-whitelist": "^1.3.4"
|
||||
}
|
||||
}
|
22
res/android/drawable/ic_launcher_background.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="270.93"
|
||||
android:viewportHeight="270.93">
|
||||
<path
|
||||
android:pathData="M0,0h270.93v270.93h-270.93z"
|
||||
android:fillColor="#2196f3"/>
|
||||
<path
|
||||
android:pathData="m163.668,261.872l-161.936,0l80.969,-151.985z"
|
||||
android:fillColor="#1976d2"/>
|
||||
<path
|
||||
android:pathData="m243.04,244.482l-126.496,0l63.249,-86.036z"
|
||||
android:strokeAlpha="0.5"
|
||||
android:fillColor="#1976d2"
|
||||
android:fillAlpha="0.5"/>
|
||||
<path
|
||||
android:pathData="m203.06,83.663c0.269,-0.701 0.42,-1.468 0.42,-2.268 0,-3.474 -2.819,-6.293 -6.293,-6.293 -1.291,0 -2.498,0.393 -3.494,1.062 -1.816,-3.147 -5.205,-5.258 -9.092,-5.258 -5.795,0 -10.489,4.694 -10.489,10.489 0,0.177 0.007,0.354 0.013,0.531 -3.671,1.291 -6.306,4.792 -6.306,8.909 0,5.212 4.228,9.44 9.44,9.44h24.124c4.635,0 8.391,-3.756 8.391,-8.391 0,-4.058 -2.884,-7.447 -6.713,-8.221z"
|
||||
android:strokeWidth=".065555"
|
||||
android:fillColor="#acd6ff"
|
||||
android:fillAlpha=".46734"/>
|
||||
</vector>
|
15
res/android/drawable/ic_launcher_foreground.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="459.12897"
|
||||
android:viewportHeight="459.1445">
|
||||
<group android:translateX="161.69948"
|
||||
android:translateY="161.83725">
|
||||
<path
|
||||
android:pathData="m76.331,8.467 l8.467,33.866l0,29.633a4.233,4.233 0,0 1,-4.233 4.233l-25.4,0a4.233,4.233 0,0 1,-4.233 -4.233l0,-29.633l8.467,-33.866z"
|
||||
android:fillColor="#7ac0f8"/>
|
||||
<path
|
||||
android:pathData="m126.787,42.333c0.106,-0.132 0.132,-0.185 0.238,-0.317l-14.896,-27.754a8.467,8.467 0,0 0,-8.043 -5.794l-27.754,0l8.467,33.866zM50.932,42.333 L59.398,8.467l-27.754,0a8.467,8.467 70.438,0 0,-8.043 5.794l-14.896,27.754c0.106,0.132 0.132,0.185 0.238,0.317zM84.798,50.799l0,21.166a4.233,4.233 0,0 1,-4.233 4.233l-25.4,0a4.233,4.233 0,0 1,-4.233 -4.233l0,-21.166l-42.333,0l0,67.732a8.467,8.467 0,0 0,8.467 8.467l101.599,0a8.467,8.467 0,0 0,8.467 -8.467l0,-67.732z"
|
||||
android:fillColor="#f7fbff"/>
|
||||
</group>
|
||||
</vector>
|
5
res/android/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
5
res/android/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
BIN
res/android/mipmap-hdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
res/android/mipmap-hdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
res/android/mipmap-mdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
res/android/mipmap-mdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
res/android/mipmap-xhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
res/android/mipmap-xhdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
res/android/mipmap-xxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
res/android/mipmap-xxhdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
res/android/mipmap-xxxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
res/android/mipmap-xxxhdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
www/assets/audio/alert.coin.mp3
Normal file
BIN
www/assets/audio/alert.jump.mp3
Normal file
@ -4,13 +4,24 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
var sfx = {};
|
||||
|
||||
var sfx = {
|
||||
"alert": new Audio("assets/audio/alert.echo.mp3"),
|
||||
function initSFX() {
|
||||
if (localStorage.getItem("alertsound") == null) {
|
||||
localStorage.setItem("alertsound", "sonar");
|
||||
}
|
||||
|
||||
var alertNoiseName = localStorage.getItem("alertsound");
|
||||
|
||||
sfx = {
|
||||
"alert": new Audio("assets/audio/alert." + alertNoiseName + ".mp3"),
|
||||
"ok": new Audio("assets/audio/ok.mp3"),
|
||||
"error": new Audio("assets/audio/error.mp3")
|
||||
};
|
||||
}
|
||||
|
||||
function playSound(sound) {
|
||||
sfx[sound].play();
|
||||
}
|
||||
|
||||
initSFX();
|
@ -7,20 +7,38 @@
|
||||
function leafletMap() {
|
||||
var map = L.map('mapbox', {
|
||||
zoomSnap: 0.25,
|
||||
minZoom: 12,
|
||||
maxZoom: 16,
|
||||
zoom: 13,
|
||||
minZoom: 1,
|
||||
maxZoom: 20,
|
||||
zoom: 12,
|
||||
center: L.latLng(46.5966, -112.0180),
|
||||
maxBounds: L.latLngBounds(L.latLng(46.7384, -112.1429), L.latLng(46.5127, -111.7557)),
|
||||
//maxBounds: L.latLngBounds(L.latLng(46.9, -112.3), L.latLng(46.35, -111.5)),
|
||||
attributionControl: false
|
||||
attributionControl: true,
|
||||
attribution: '© <a href="http://www.openmaptiles.org/" target="_system">OpenMapTiles</a> © <a href="https://www.openstreetmap.org/copyright" target="_system">OpenStreetMap</a> contributors'
|
||||
});
|
||||
|
||||
L.tileLayer('assets/tiles/{z}/{x}/{y}.png', {
|
||||
var mapSources = {
|
||||
"offline": 'assets/tiles/{z}/{x}/{y}.png',
|
||||
"liberty": 'https://maps.netsyms.net/styles/osm-liberty/{z}/{x}/{y}.png',
|
||||
"terrain": 'https://maps.netsyms.net/styles/klokantech-terrain/{z}/{x}/{y}.png'
|
||||
};
|
||||
|
||||
if (localStorage.getItem("mapsource") == null) {
|
||||
localStorage.setItem("mapsource", "offline");
|
||||
}
|
||||
|
||||
if (localStorage.getItem("mapsource") == "offline") {
|
||||
map.setMaxBounds(L.latLngBounds(L.latLng(46.7384, -112.1429), L.latLng(46.5127, -111.7557)));
|
||||
map.setMinZoom(12);
|
||||
map.setMaxZoom(16);
|
||||
L.tileLayer(mapSources[localStorage.getItem("mapsource")], {
|
||||
minZoom: 12,
|
||||
maxZoom: 16,
|
||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||
maxZoom: 16
|
||||
}).addTo(map);
|
||||
} else {
|
||||
L.tileLayer(mapSources[localStorage.getItem("mapsource")], {
|
||||
minZoom: 1,
|
||||
maxZoom: 20
|
||||
}).addTo(map);
|
||||
}
|
||||
|
||||
map.locateControl = L.control.locate({
|
||||
flyTo: true,
|
||||
|
@ -15,4 +15,83 @@ $('.item-content[data-setting=darktheme] .toggle input').on("change", function (
|
||||
} else {
|
||||
$("#app").removeClass("theme-dark");
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
function pickAlertSound() {
|
||||
var currentalertsound = localStorage.getItem("alertsound");
|
||||
app.dialog.create({
|
||||
title: 'Alert Sound',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Sonar' + (currentalertsound == "sonar" ? " (current)" : ""),
|
||||
},
|
||||
{
|
||||
text: 'Robot' + (currentalertsound == "robot" ? " (current)" : ""),
|
||||
},
|
||||
{
|
||||
text: 'Coin' + (currentalertsound == "coin" ? " (current)" : ""),
|
||||
},
|
||||
{
|
||||
text: 'Jump' + (currentalertsound == "jump" ? " (current)" : ""),
|
||||
}
|
||||
],
|
||||
verticalButtons: true,
|
||||
onClick: function (dialog, index) {
|
||||
var alertsound = "sonar";
|
||||
switch (index) {
|
||||
case 1:
|
||||
alertsound = "robot";
|
||||
break;
|
||||
case 2:
|
||||
alertsound = "coin";
|
||||
break;
|
||||
case 3:
|
||||
alertsound = "jump";
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
alertsound = "sonar";
|
||||
}
|
||||
localStorage.setItem("alertsound", alertsound);
|
||||
// Reload sound effect stuff to apply new sound
|
||||
initSFX();
|
||||
// Play the selected sound
|
||||
playSound("alert");
|
||||
}
|
||||
}).open();
|
||||
}
|
||||
|
||||
function pickMapSource() {
|
||||
var currentmapsource = localStorage.getItem("mapsource");
|
||||
app.dialog.create({
|
||||
title: 'Map',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Helena Offline' + (currentmapsource == "offline" ? " (current)" : ""),
|
||||
},
|
||||
{
|
||||
text: 'Liberty' + (currentmapsource == "liberty" ? " (current)" : ""),
|
||||
},
|
||||
{
|
||||
text: 'Terrain' + (currentmapsource == "terrain" ? " (current)" : ""),
|
||||
}
|
||||
],
|
||||
verticalButtons: true,
|
||||
onClick: function (dialog, index) {
|
||||
var mapsource = "offline";
|
||||
switch (index) {
|
||||
case 1:
|
||||
mapsource = "liberty";
|
||||
break;
|
||||
case 2:
|
||||
mapsource = "terrain";
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
mapsource = "offline";
|
||||
}
|
||||
localStorage.setItem("mapsource", mapsource);
|
||||
|
||||
}
|
||||
}).open();
|
||||
}
|
@ -75,6 +75,12 @@ var routes = [
|
||||
}, {
|
||||
context: {
|
||||
settings: [
|
||||
{
|
||||
setting: "alertsound",
|
||||
title: "Alert Sound",
|
||||
text: "Select which sound to play when a package is nearby.",
|
||||
onclick: "pickAlertSound()"
|
||||
},
|
||||
{
|
||||
setting: "darktheme",
|
||||
title: "Use dark theme",
|
||||
@ -83,6 +89,12 @@ var routes = [
|
||||
checked: localStorage.getItem("darktheme") == "true",
|
||||
onclick: ""
|
||||
},
|
||||
{
|
||||
setting: "mapsource",
|
||||
title: "Map",
|
||||
text: "Choose which map to use.",
|
||||
onclick: "pickMapSource()"
|
||||
},
|
||||
{
|
||||
setting: "versions",
|
||||
title: "PackageHelper app v1.0.0",
|
||||
|