|
2 | 2 | <button
|
3 | 3 | id="copyLinkButton"
|
4 | 4 | type="button"
|
5 |
| - class="inline-flex items-center justify-center gap-1 p-2 text-sm transition-transform transform rounded-md shadow justify-self-end focus-visible:ring-4 active:scale-y-75 hover:scale-105 hover:shadow-lg copy-uri-button" |
| 5 | + class="inline-flex gap-1 justify-center justify-self-end items-center p-2 text-sm rounded-md shadow transition-transform transform focus-visible:ring-4 active:scale-y-75 hover:scale-105 hover:shadow-lg copy-uri-button" |
6 | 6 | aria-label="Click here to copy url to clipboard"
|
7 | 7 | :class="{
|
8 | 8 | 'bg-blue-500 text-white': !copied,
|
9 |
| - 'bg-green-500 text-gray-800': copied, |
| 9 | + 'bg-green-500 text-gray-800': copied === true, |
| 10 | + 'pointer-events-none': copied === null || copied === true, |
10 | 11 | }"
|
| 12 | + :disabled="copied === null || copied === true" |
11 | 13 | @click="clickHandler"
|
12 | 14 | >
|
13 | 15 | <span
|
14 |
| - class="inline-flex items-center justify-center gap-1" |
| 16 | + class="inline-flex gap-1 justify-center items-center" |
15 | 17 | aria-live="assertive"
|
16 | 18 | role="status"
|
17 | 19 | >
|
18 | 20 | <span v-show="copied" class="inline" aria-hidden="true">
|
19 | 21 | <Copied />
|
20 | 22 | </span>
|
21 | 23 | <span v-show="copied" class="hidden md:inline-block">Copied</span>
|
22 |
| - <span v-show="!copied" class="inline" aria-hidden="true"> |
| 24 | + <span |
| 25 | + v-show="!copied" |
| 26 | + class="inline" |
| 27 | + aria-hidden="true" |
| 28 | + :class="{ |
| 29 | + 'animate animate-wiggle': copied === null, |
| 30 | + }" |
| 31 | + > |
23 | 32 | <Link />
|
24 | 33 | </span>
|
25 |
| - <span v-show="!copied" class="hidden md:inline-block">Copy link</span> |
| 34 | + <span v-show="!copied" class="hidden md:inline-block">{{ |
| 35 | + copied === null ? 'Generating...' : 'Copy link' |
| 36 | + }}</span> |
26 | 37 | </span>
|
27 | 38 | </button>
|
28 | 39 | </template>
|
29 | 40 | <script lang="ts">
|
30 | 41 | import Vue from 'vue'
|
31 |
| -import Link from '~/components/icons/link.vue' |
32 | 42 | import Copied from '~/components/icons/copied.vue'
|
| 43 | +import Link from '~/components/icons/link.vue' |
33 | 44 | export default Vue.extend({
|
34 | 45 | components: { Link, Copied },
|
35 | 46 | props: {
|
|
0 commit comments