*** Feature to download all maps up to a certain resolution for some area around the current point
* Improve texture cleaning algorithm
* UI improvements (non-map):
-** Change general/track settings to drawer style
+** Override native style of buttons etc. in drawers with a more app-y look
** Show a notification when we are loading tiles or saved data
** Display movement speed
** Display location accuracy
<body id="body">
<h1>Lantea Map</h1>
-<div id="menuArea" class="overlayArea">
-<image src="style/track.svg" id="trackButton" value="Track"
- onclick="toggleTrackArea();"><br/>
-<fieldset id="trackArea"><legend>Track</legend>
+<div id="trackArea" class="menuDrawer hidden">
+<h2 onclick="toggleTrackArea();">
+<image src="style/track.svg" alt=""> Track</h2>
<p id="trackData"><span id="trackLength">0</span> km,
<span id="trackDuration">0</span> min</p>
<input type="button" id="saveTrackButton" value="Save"
<input type="checkbox" id="centerCheckbox"
onchange="setCentering(this);">
<label for="centerCheckbox">Center Map</label><br/>
-</fieldset>
-<image src="style/settings.svg" id="settingsButton" alt="Settings"
- onclick="toggleSettings();"><br/>
-<fieldset id="settingsArea"><legend>Settings</legend>
+</div>
+
+<div id="settingsArea" class="menuDrawer hidden">
+<h2 onclick="toggleSettings();">
+<image src="style/settings.svg" alt=""> Settings</h2>
<label for="mapSelector">Map style:</label>
<select id="mapSelector" onchange="setMapStyle();">
<!-- option value="osm_mapnik">OpenStreetMap (Mapnik)</option -->
<input type="password" id="uploadPwd" maxlength="255"
onchange="setUploadField(this);">
</div>
-</fieldset>
+</div>
+
+<div id="menuArea" class="overlayArea">
+<image src="style/track.svg" id="trackButton" value="Track"
+ onclick="toggleTrackArea();"><br/>
+<image src="style/settings.svg" id="settingsButton" alt="Settings"
+ onclick="toggleSettings();"><br/>
</div>
<div id="zoomArea" class="overlayArea">
function maybeHideUI() {
gUIHideCountdown--;
- if (document.getElementById("trackArea").style.display == "block") {
+ if (!document.getElementById("trackArea").classList.contains("hidden")) {
// If track area is visible, update track data.
document.getElementById("trackLength").textContent = calcTrackLength().toFixed(1);
document.getElementById("trackDuration").textContent = Math.round(calcTrackDuration()/60);
function toggleTrackArea() {
var fs = document.getElementById("trackArea");
- if (fs.style.display != "block") {
- fs.style.display = "block";
+ if (fs.classList.contains("hidden")) {
+ fs.classList.remove("hidden");
showUI();
}
else {
- fs.style.display = "none";
+ fs.classList.add("hidden");
}
}
function toggleSettings() {
var fs = document.getElementById("settingsArea");
- if (fs.style.display != "block") {
- fs.style.display = "block";
+ if (fs.classList.contains("hidden")) {
+ fs.classList.remove("hidden");
showUI();
}
else {
- fs.style.display = "none";
+ fs.classList.add("hidden");
}
}
CACHE MANIFEST
-# 2015-05-01
+# 2015-06-06
index.html
manifest.webapp
js/map.js
}
#dialogArea:-moz-system-metric(touch-enabled),
-.overlayArea:-moz-system-metric(touch-enabled) {
+.overlayArea:-moz-system-metric(touch-enabled),
+.menuDrawer:-moz-system-metric(touch-enabled) {
font-size: 3mozmm;
}
#dialogArea input[type="text"]:-moz-system-metric(touch-enabled),
#dialogArea select:-moz-system-metric(touch-enabled),
.overlayArea input[type="button"]:-moz-system-metric(touch-enabled),
-.overlayArea select:-moz-system-metric(touch-enabled) {
+.overlayArea select:-moz-system-metric(touch-enabled),
+.menuDrawer input[type="button"]:-moz-system-metric(touch-enabled),
+.menuDrawer select:-moz-system-metric(touch-enabled) {
font-size: 3mozmm;
}
margin: 2px 0;
}
-#settingsArea,
-#trackArea {
- display: none;
- background-color: rgba(255, 255, 255, .8);
+.menuDrawer {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: calc(-40ch - 1ch); /* account for padding */
+ width: 40ch;
+ background-color: rgba(15, 15, 15, .9);
+ color: #CCCCCC;
border: 0;
- border-radius: 5px;
+ padding: 0 .5ch; /* account for legend */
+ margin: 0;
+ z-index: 10;
+ transition-property: left;
+ transition-duration: 1s;
+ transition-timing-function: ease;
}
-#settingsArea > legend,
-#trackArea > legend {
- display: none;
+.menuDrawer:not(.hidden) {
+ left: 0;
+}
+
+@media screen and (max-width: 330px) {
+ .menuDrawer {
+ left: calc(-300px - 1ch); /* account for padding */
+ width: 300px;
+ }
+}
+
+.menuDrawer > h2 {
+ font-size: 1.2em;
+ font-weight: bold;
+ margin: .5em 0;
background-color: rgba(255, 255, 255, .8);
+ color: #404040;
border-radius: 3px;
+ padding: 2px;
+}
+
+.menuDrawer > h2 > img {
+ vertical-align: text-top;
+ height: 1.2em;
}
#trackData {