Add functionality to the Copy Game Link button
This commit is contained in:
parent
05a5bfc3af
commit
7d39b41b6d
1 changed files with 6 additions and 1 deletions
|
|
@ -34,6 +34,11 @@ const modal = {
|
|||
|
||||
$: visibleOptions = gameOptions.filter(x => !x.hidden);
|
||||
|
||||
/** Copies the game link to clipboard for easy sharing */
|
||||
function copyLinkToClipboard() {
|
||||
navigator.clipboard.writeText(window.location.href);
|
||||
};
|
||||
|
||||
/**
|
||||
* What gets called when the host toggles one of the options in the lobby so
|
||||
* that the other players can see the change happen on their screen.
|
||||
|
|
@ -62,7 +67,7 @@ function toggleOption(e: CustomEvent<string>) {
|
|||
<h1>Gravwell</h1>
|
||||
<SciFiButton
|
||||
width="69%"
|
||||
on:click={tempButtonHandler}
|
||||
on:click={copyLinkToClipboard}
|
||||
>
|
||||
Copy Game Link
|
||||
</SciFiButton>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue