add an indicator when login fails
[lantea.git] / index.html
index 969178f79762e58100f0cb7cb1d135721b5fd0d7..d1ea156e22e7315358f33be9d8017778778e9d34 100644 (file)
        https://developer.mozilla.org/en/Mobile/Viewport_meta_tag -->
   <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, user-scalable=no">
   <title>Lantea Maps</title>
-  <script src="js/osmauth.js" type="application/javascript;version=1.8"></script>
   <script src="js/map.js" type="application/javascript;version=1.8"></script>
   <script src="js/ui.js" type="application/javascript;version=1.8"></script>
+  <script src="js/library.js" type="application/javascript;version=1.8"></script>
   <script src="js/piwik.js" async="" defer=""></script>
   <link rel="stylesheet" href="style/lantea.css">
+  <link rel="manifest" href="/pwa.manifest">
   <link rel="shortcut icon" href="style/lanteaIcon16.png" type="image/png">
 </head>
 <body id="body">
 <noscript><p><img src="https://piwik.kairo.at/piwik.php?idsite=2" style="border:0;" alt="" /></p></noscript>
 <h1>Lantea Map</h1>
 
-<div id="trackArea" class="menuDrawer hidden">
+<div id="trackArea" class="menuDrawer secondaryUI hidden">
 <h2 onclick="toggleTrackArea();">
 <image src="style/track.svg" alt=""> Track
 </h2>
 <input type="button" id="clearTrackButton" value="Clear"
        onclick="clearTrack();">
 </p>
+<p id="libraryShowLine" class="hidden">
+<input type="button" id="libraryShowButton" value="View uploaded tracks"
+       onclick="showLibrary();">
+</p>
 <div id="trackDialogArea" class="hidden">
 <div id="uploadDialog">
-<p class="dialogTitle">Upload Track to Lantea Maps Server:</p>
+<p class="subTitle">Upload Track to Lantea Maps Server:</p>
 <label for="uploadPublic">Visibility:</label>
 <select id="uploadPublic">
 <option value="true">Public Domain</option>
 </select>
 <p class="dialogHelp">Public Domain tracks can be forwarded by the server
 operator to any other services, e.g. OpenStreetMap.</p>
+<p>
 <label for="uploadDesc">Comment:</label>
 <input type="text" id="uploadDesc" maxlength="255" size="25"
        value="Lantea Maps">
+</p>
+<p>
 <input type="button" id="uploadDialogUploadButton" value="Upload Track"
        onclick="uploadTrack();">
 <input type="button" id="uploadDialogCancelButton" value="Cancel"
        onclick="cancelTrackDialog();">
+</p>
 </div>
 <div id="uploadStatus">
-<p class="dialogTitle">Track Upload to Lantea Maps Server</p>
+<p class="subTitle">Track Upload to Lantea Maps Server</p>
 <p id="uploadInProgress"><img id="actionimg" src="style/loading_action.png">
   Upload in progress&hellip;</p>
 <p id="uploadSuccess" style="display:none;">Track upload successful!</p>
@@ -71,6 +80,7 @@ operator to any other services, e.g. OpenStreetMap.</p>
 </div>
 <p class="loginbox">
 <button type="button" id="loginbtn" class="hidden">Sign in</button>
+<span id="loginerror" class="hidden">!</span>
 <span id="logindesc" class="hidden">to enable uploads</span>
 <span id="username" class="hidden"></span>
 <button type="button" id="logoutbtn" class="hidden">Log out</button>
@@ -87,7 +97,7 @@ operator to any other services, e.g. OpenStreetMap.</p>
 </p>
 </div>
 
-<div id="settingsArea" class="menuDrawer hidden">
+<div id="settingsArea" class="menuDrawer secondaryUI hidden">
 <h2 onclick="toggleSettings();">
 <image src="style/settings.svg" alt=""> Settings
 </h2>
@@ -102,23 +112,25 @@ operator to any other services, e.g. OpenStreetMap.</p>
        onclick="gTileService.clearDB();">
 </p>
 <div id="uploadSettingsArea">
-<p class="settingsSubTitle">Track Upload:</p>
+<p class="subTitle">Track Upload:</p>
+<p>
 <label for="uploadDevName">Device name:</label>
 <input type="text" id="uploadDevName" maxlength="255" placeholder="My Device"
        onchange="setUploadField(this);">
+</p>
 <p class="dialogHelp">The device name enables you to tell apart tracks you may
 upload from multiple devices.</p>
 </div>
 </div>
 
-<div id="menuArea" class="overlayArea">
-<image src="style/track.svg" id="trackButton" value="Track"
+<div id="menuArea" class="autoFade overlayArea">
+<image src="style/track.svg" class="controlButton" id="trackButton" value="Track"
        onclick="toggleTrackArea();"><br/>
-<image src="style/settings.svg" id="settingsButton" alt="Settings"
+<image src="style/settings.svg" class="controlButton" id="settingsButton" alt="Settings"
        onclick="toggleSettings();"><br/>
 </div>
 
-<div id="zoomArea" class="overlayArea">
+<div id="zoomArea" class="autoFade overlayArea">
 <input type="button" id="zoomInButton" value="+"
        onclick="zoomIn();">
 <p id="zoomLevel">Z</p>
@@ -126,23 +138,65 @@ upload from multiple devices.</p>
        onclick="zoomOut();">
 </div>
 
-<div id="fullscreenArea" class="overlayArea">
+<div id="fullscreenArea" class="autoFade overlayArea">
 <!-- other possible characters: &#x25F0; -->
 <input type="button" id="fullscreenButton" value="&#x25A3;"
        onclick="toggleFullscreen();">
 </div>
 
-<div id="dialogArea" class="hidden">
+<div id="dialogArea" class="overlayArea hidden">
 <div id="noGLwarning">
   Unable to initialize WebGL. You need a browser that supports it.
 </div>
+<div id="firstRunIntro">
+<p class="dialogTitle">Welcome to Lantea Maps!</p>
+<p>This web app lets you record GPS tracks of your journeys, which you can
+   upload to our backend servers and download as GPX files.</p>
+<p>You can find track details, upload, etc. in the "track" drawer that you can
+   access via the <image src="style/track.svg"> icon at the left top of the
+   window.</p>
+<p>Right underneath that icon, you find <image src="style/settings.svg">
+   settings.</p>
+<p>Both track and settings "drawers" can be closed by clicking/tapping on their
+   title line.</p>
+<p>From the track "drawer", you can also access a library of uploaded tracks,
+   their name/comment links to the GPX download of the specific track.</p>
+<p class="dialogButtonLine">
+  <button id="firstRunDialogCloseButton"
+          onclick="closeDialog();">Close</button>
+</p>
+</div>
+<div id="infoDialog">
+<p class="dialogTitle">Recent Changes in Lantea Maps</p>
+<p>Lantea Maps has been updated with a few significant changes.</p>
+<p>Most importantly, the previously broken upload functionality for tracks has
+   been fixed and improved to use our own Lantea Maps server instead of
+   OpenStreetMaps. For using it, you need to log in with KaiRo.at via a
+   "sign in" button now in the track "drawer".</p>
+<p>From there, you can also access a library of uploaded tracks, their
+   name/comment links to the GPX download of the specific track.</p>
+<p>If you set a device name in the settings, you can even distinguish tracks
+   uploaded to the same account by different devices you're using.</p>
+<p class="dialogButtonLine">
+  <button id="firstRunDialogCloseButton"
+          onclick="closeDialog();">Close</button>
+</p>
+</div>
+</div>
+
+<div id="libraryArea" class="overlayArea fullScreenOverlay secondaryUI hidden">
+<p>The following tracks are saved on the Lantea Maps Server:</p>
+<ul id="libTrackList">
+</ul>
+<p id="libTrackPages" class="hidden"></p>
+<p class="closeButtonContainer"><button id="libCloseButton" class="closeButton">X</button></p>
 </div>
 
 <p id="action">
   <img id="actionimg" src="style/loading_action.png">
   <span id="actionlabel">Loading</span>&hellip;
 </p>
-<p id="copyright" class="overlayArea"></p>
+<p id="copyright" class="autoFade overlayArea"></p>
 
 <canvas id="map" width="500" height="500">
   Please use a browser that supports &lt;canvas&gt; elements.