-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7891c6b
commit 6debfb7
Showing
20 changed files
with
351 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { SvelteApplication } from "@typhonjs-fvtt/runtime/svelte/application"; | ||
import LoginUI from "../svelte/LoginUI.svelte"; | ||
|
||
export default class LoginApplication extends SvelteApplication { | ||
static get defaultOptions() { | ||
return foundry.utils.mergeObject(super.defaultOptions, { | ||
classes: ["login-dialog"], | ||
id: "login-application", | ||
title: "Ethereal Plane Login", | ||
width: 400, | ||
height: 435, | ||
svelte: { | ||
class: LoginUI, | ||
target: document.body, | ||
}, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<svelte:options accessors="{true}" /> | ||
|
||
<script> | ||
import { ApplicationShell } from "@typhonjs-fvtt/runtime/svelte/component/core"; | ||
import { QRCode } from "@castlenine/svelte-qrcode"; | ||
import { getContext, onDestroy } from "svelte"; | ||
export let user_code; | ||
export let uri; | ||
export let elementRoot = void 0; | ||
const hook = Hooks.on("ethereal-plane.patreon-logged-in", close); | ||
const context = getContext("#external"); | ||
async function close() { | ||
context.application.close(); | ||
} | ||
onDestroy(() => { | ||
Hooks.off("ethereal-plane.patreon-logged-in", hook); | ||
}); | ||
</script> | ||
|
||
<ApplicationShell bind:elementRoot="{elementRoot}"> | ||
<main> | ||
<div class="text"> | ||
<span> | ||
The login Device Code is <code class="user-code">{user_code}</code>. | ||
</span> | ||
<span> | ||
Either press "Open" to open a log-in dialog directly, copy it and send | ||
it to another device, or scan the QR code. | ||
</span> | ||
<span> | ||
This window will automatically close when the login is complete. | ||
</span> | ||
</div> | ||
<div class="QR"> | ||
<QRCode data="{uri}" /> | ||
</div> | ||
<div class="buttons"> | ||
<button | ||
on:click="{() => { | ||
window.open( | ||
uri, | ||
'_blank', | ||
'location=yes,height=570,width=520,scrollbars=yes,status=yes', | ||
); | ||
}}" | ||
> | ||
Open | ||
</button> | ||
<button> Copy </button> | ||
<button> Cancel </button> | ||
</div> | ||
</main> | ||
</ApplicationShell> | ||
|
||
<style lang="stylus"> | ||
.user-code | ||
background-color black | ||
padding-left 2px | ||
padding-right 2px | ||
color white | ||
border-radius 4px | ||
.text | ||
display flex | ||
flex-direction column | ||
gap 6px | ||
.buttons | ||
padding-top 4px | ||
display flex | ||
.QR | ||
display flex | ||
justify-content center | ||
</style> |
Oops, something went wrong.