forked from MapComplete/MapComplete
UX: somewhat decent landing page for app.mapcomplete.org
This commit is contained in:
parent
c167094b65
commit
7ebccfafd0
5 changed files with 39 additions and 15 deletions
19
app/AppIndex.svelte
Normal file
19
app/AppIndex.svelte
Normal file
|
@ -0,0 +1,19 @@
|
|||
<script lang="ts">
|
||||
|
||||
import { DownloadIcon } from "@rgossiaux/svelte-heroicons/solid"
|
||||
</script>
|
||||
|
||||
<div class="m-8 flex flex-col">
|
||||
|
||||
<h1>MapComplete Android App</h1>
|
||||
|
||||
MapComplete is available as Android App as direct download.
|
||||
|
||||
We are working on publishing this in the play store and on FDroid too.
|
||||
|
||||
<a class="button primary flex justify-center" href="https://app.mapcomplete.org/mapcomplete-latest.apk">
|
||||
<DownloadIcon class="w-8 h-8"/>
|
||||
Download the latest version
|
||||
</a>
|
||||
<a class="button" href="https://mapcomplete.org">Go back to mapcomplete</a>
|
||||
</div>
|
5
app/app_index.ts
Normal file
5
app/app_index.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import AppIndex from "./AppIndex.svelte"
|
||||
|
||||
const target = document.getElementById("main")
|
||||
target.innerHTML = ""
|
||||
new AppIndex({ target })
|
|
@ -15,5 +15,5 @@ rm -rf dist
|
|||
ssh hetzner "rm -rf /root/app/"
|
||||
scp -rp to_upload/ hetzner:/root/app/
|
||||
scp -rp to_upload/.well-known/ hetzner:/root/app/
|
||||
|
||||
ssh hetzner "cp ~/apk/mapcomplete-latest.apk ~/app/"
|
||||
rm -rf to_upload
|
||||
|
|
|
@ -2,17 +2,14 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<link href="https://mapcomplete.org/css/index-tailwind-output.css" rel="stylesheet"/>
|
||||
|
||||
<title>MapComplete App</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Hi!
|
||||
|
||||
MapComplete will soon (TM) be available as Android App in the play store and on FDroid.
|
||||
|
||||
In the meantime, there isn't a lot to see here.
|
||||
|
||||
<a href="https://mapcomplete.org">Go back to mapcomplete</a>
|
||||
|
||||
<div id="main"></div>
|
||||
<script type="module" src="./app_index.ts"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
13
app/land.ts
13
app/land.ts
|
@ -6,15 +6,18 @@ import { VariableUiElement } from "../src/UI/Base/VariableUIElement"
|
|||
|
||||
console.log("Authorizing...")
|
||||
const key = Constants.osmAuthConfig.url + "oauth2_state"
|
||||
const st =window.localStorage.getItem(key )
|
||||
console.log("Prev state is",key, st)
|
||||
const st = window.localStorage.getItem(key)
|
||||
console.log("Prev state is", key, st)
|
||||
const tokenSrc = new UIEventSource("")
|
||||
new VariableUiElement(tokenSrc).AttachTo("token")
|
||||
|
||||
|
||||
new OsmConnection().finishLogin(async (_, token: string) => {
|
||||
console.log("Login finished, redirecting to passthrough; token is "+token)
|
||||
console.log("Login finished, redirecting to passthrough; token is " + token)
|
||||
tokenSrc.set(token)
|
||||
await Utils.waitFor(500)
|
||||
window.location.href = "orgmapcomplete://passthrough.html?oauth_token="+token
|
||||
await Utils.waitFor(500)
|
||||
window.location.href = "orgmapcomplete://passthrough.html?oauth_token=" + token
|
||||
tokenSrc.set("Closing...")
|
||||
await Utils.waitFor(50)
|
||||
window.close()
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue