add copy feedback

This commit is contained in:
wryk 2020-02-23 15:22:19 +01:00
parent 0ac3c8ea60
commit ef9373a70f
1 changed files with 5 additions and 1 deletions

View File

@ -18,7 +18,7 @@
<input type="checkbox" id="bigplayer_active" bind:checked={isBigPlayer}>
<label for="bigplayer_active">active big player</label>
</div>
<button class="modalShare__copy" on:click={() => copyUrl()}>copy</button>
<button class="modalShare__copy" on:click={() => copyUrl()}>{ copied ? 'copied' : 'copy' }</button>
</div>
</div>
</div>
@ -35,6 +35,8 @@
let open = false
let isBigPlayer = false
let copied = false
$: shareUrlInput = track.shareUrl + (isBigPlayer ? '?large' : '')
const closeMenu = getContext('closeMenu')
@ -50,5 +52,7 @@
function copyUrl () {
copy(shareUrlInput)
copied = true
setTimeout(() => copied = false, 2000)
}
</script>