Skip to content

Commit

Permalink
Add raw link to briqout postgame
Browse files Browse the repository at this point in the history
  • Loading branch information
wraitii committed Dec 7, 2023
1 parent 386c35f commit 0cf5206
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/components/briqout/GameScreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ const shareUrl = computed(() => {
return '';
return `https://${window.location.hostname}${route.path}?network=${route.query.network || getCurrentNetwork()}&set_id=${route.query.set_id || game.getParams()?.setToMigrate}`;
})
const copyShareLink = () => {
navigator.clipboard.writeText(shareUrl.value);
}
</script>

<style scoped>
Expand Down Expand Up @@ -283,12 +288,15 @@ const shareUrl = computed(() => {
<div class="absolute w-full h-full flex flex-col gap-2 justify-center items-center">
<h1 class="text-xl md:text-[6rem] text-text mb-8">You won in {{ Math.ceil(game.time) }}s !</h1>
<template v-if="(game.getParams()?.setToMigrate || '0x0') !== '0x0'">
<h3 class="mt-4">Challenge others to do better</h3>
<a
target="_blank"
:href="`https://twitter.com/intent/tweet?text=${encodeURIComponent(tweetText)}&url=${encodeURIComponent(shareUrl)}`">
<Btn v-bind="$attrs" icon class="text-sm justify-start font-normal"><i class="fa-brands fa-twitter text-md mr-2"/> Share on Twitter</Btn>
</a>
<div class="mt-4 flex flex-col justify-center items-center gap-2">
<h3>Challenge others to do better</h3>
<p class="text-sm">{{ shareUrl }} <Btn no-background class="text-sm h-6 w-6" @click="copyShareLink"><i class="far fa-copy"/></Btn></p>
<a
target="_blank"
:href="`https://twitter.com/intent/tweet?text=${encodeURIComponent(tweetText)}&url=${encodeURIComponent(shareUrl)}`">
<Btn v-bind="$attrs" icon class="text-sm justify-start font-normal"><i class="fa-brands fa-twitter text-md mr-2"/> Share on Twitter</Btn>
</a>
</div>
<template v-if="userSetStore.current?.setData?.[game.getParams()!.setToMigrate]">
<h4 class="mt-8 !mb-0">Roleplay</h4>
<Btn secondary @click="userSetStore.current!.disassemble([game.getParams()!.setToMigrate]);">Disassemble the set</Btn>
Expand Down

0 comments on commit 0cf5206

Please sign in to comment.