From 7d39b41b6deb444971b32516fe5259f077347639 Mon Sep 17 00:00:00 2001 From: Oliver Akins Date: Tue, 15 Mar 2022 23:25:27 -0600 Subject: [PATCH] Add functionality to the Copy Game Link button --- web-svelte/src/views/lobby/multiplayer.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web-svelte/src/views/lobby/multiplayer.svelte b/web-svelte/src/views/lobby/multiplayer.svelte index 68d7b18..958dccd 100644 --- a/web-svelte/src/views/lobby/multiplayer.svelte +++ b/web-svelte/src/views/lobby/multiplayer.svelte @@ -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) {

Gravwell

Copy Game Link