refactor: move assets
48
public/dropbox.html
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<script type="text/javascript" src="https://unpkg.com/dropbox@10.8.0/dist/Dropbox-sdk.min.js"></script>
|
||||
<title>FMG Dropbox Auth</title>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
// open this page in a new window without query parameter to start auth
|
||||
// setDropBoxToken(token) will be called on the opener window
|
||||
const REDIRECT_URI = window.location.origin + window.location.pathname;
|
||||
const auth = new Dropbox.DropboxAuth({clientId: "pdr9ae64ip0qno4"});
|
||||
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const code = params.get("code");
|
||||
const error = params.get("error");
|
||||
|
||||
if (code) getToken();
|
||||
else if (error) window.opener.Cloud.providers.dropbox.returnError(params.get("error_description"));
|
||||
else startAuth();
|
||||
|
||||
function startAuth() {
|
||||
auth
|
||||
.getAuthenticationUrl(REDIRECT_URI, undefined, "code", "offline", undefined, undefined, true)
|
||||
.then(authUrl => {
|
||||
window.sessionStorage.clear();
|
||||
window.sessionStorage.setItem("codeVerifier", auth.codeVerifier);
|
||||
window.location.href = authUrl;
|
||||
})
|
||||
.catch(error => console.error(error));
|
||||
}
|
||||
|
||||
function getToken() {
|
||||
auth.setCodeVerifier(window.sessionStorage.getItem("codeVerifier"));
|
||||
auth
|
||||
.getAccessTokenFromCode(REDIRECT_URI, code)
|
||||
.then(resp => {
|
||||
const token = resp.result.access_token;
|
||||
window.opener.Cloud.providers.dropbox.setDropBoxToken(token);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
BIN
public/images/icons/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 740 B |
BIN
public/images/icons/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
public/images/icons/icon_x512.png
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
public/images/icons/maskable_icon_x128.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
public/images/icons/maskable_icon_x192.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
public/images/icons/maskable_icon_x384.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
public/images/icons/maskable_icon_x512.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
public/images/preview.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
public/images/social/Discord.png
Normal file
|
After Width: | Height: | Size: 869 B |
BIN
public/images/social/Facebook.png
Normal file
|
After Width: | Height: | Size: 318 B |
BIN
public/images/social/Pinterest.png
Normal file
|
After Width: | Height: | Size: 443 B |
BIN
public/images/social/Reddit.png
Normal file
|
After Width: | Height: | Size: 509 B |
BIN
public/images/social/Twitter.png
Normal file
|
After Width: | Height: | Size: 379 B |
42
public/manifest.webmanifest
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"background_color": "#fff",
|
||||
"display": "standalone",
|
||||
"orientation": "any",
|
||||
"name": "Azgaar's Fantansy Map Generator",
|
||||
"short_name": "Azgaar's Fantansy Map Generator",
|
||||
"description": "Web application generating interactive and highly customizable maps",
|
||||
"scope": "/Fantasy-Map-Generator/",
|
||||
"start_url": "/Fantasy-Map-Generator/?source=pwa",
|
||||
"url": "https://azgaar.github.io/Fantasy-Map-Generator",
|
||||
"icons": [
|
||||
{
|
||||
"src": "images/icons/icon_x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "images/icons/maskable_icon_x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
},
|
||||
{
|
||||
"src": "images/icons/maskable_icon_x384.png",
|
||||
"sizes": "384x384",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
},
|
||||
{
|
||||
"src": "images/icons/maskable_icon_x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
},
|
||||
{
|
||||
"src": "images/icons/maskable_icon_x128.png",
|
||||
"sizes": "128x128",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
]
|
||||
}
|
||||