diff --git a/components.d.ts b/components.d.ts index ebbf1d5..d22fb87 100644 --- a/components.d.ts +++ b/components.d.ts @@ -10,6 +10,7 @@ declare module 'vue' { export interface GlobalComponents { ColorfulTag: typeof import('./src/components/ColorfulTag.vue')['default'] FloatLabelInput: typeof import('./src/components/FloatLabelInput.vue')['default'] + IconButton: typeof import('./src/components/IconButton.vue')['default'] NA: typeof import('naive-ui')['NA'] NBadge: typeof import('naive-ui')['NBadge'] NButton: typeof import('naive-ui')['NButton'] diff --git a/src/components/IconButton.vue b/src/components/IconButton.vue new file mode 100644 index 0000000..c0c786f --- /dev/null +++ b/src/components/IconButton.vue @@ -0,0 +1,21 @@ + + + diff --git a/src/panes/BangumiFollow/components/BangumiFollowCard.vue b/src/panes/BangumiFollow/components/BangumiFollowCard.vue index 6082def..76adb96 100644 --- a/src/panes/BangumiFollow/components/BangumiFollowCard.vue +++ b/src/panes/BangumiFollow/components/BangumiFollowCard.vue @@ -5,6 +5,7 @@ import { ensureHttps, isElementInViewport, playTaskToQueueAnimation } from '../. import { PhDownloadSimple, PhGoogleChromeLogo, PhMagnifyingGlass } from '@phosphor-icons/vue' import { EpInBangumiFollow } from '../../../bindings.ts' import SimpleCheckbox from '../../../components/SimpleCheckbox.vue' +import IconButton from '../../../components/IconButton.vue' const searchPaneRef = inject(searchPaneRefKey) @@ -18,7 +19,7 @@ const props = defineProps<{ const navDownloadButtonRef = inject(navDownloadButtonRefKey) const rootDivRef = ref() -const downloadButtonRef = ref() +const downloadButtonRef = ref>() async function handleDownloadClick() { if (props.downloadEpisode === undefined) { @@ -34,7 +35,7 @@ function playDownloadAnimation() { return } - const from = downloadButtonRef.value + const from = downloadButtonRef.value?.$el const to = navDownloadButtonRef?.value if (from instanceof Element && to !== undefined) { @@ -71,29 +72,20 @@ defineExpose({ playDownloadAnimation, ep: props.ep })
- + - -
+ + -
- -
+ -
+
diff --git a/src/panes/DownloadPane/components/DownloadProgress.vue b/src/panes/DownloadPane/components/DownloadProgress.vue index c7ad5ea..c15024d 100644 --- a/src/panes/DownloadPane/components/DownloadProgress.vue +++ b/src/panes/DownloadPane/components/DownloadProgress.vue @@ -19,6 +19,7 @@ import ColorfulTag from '../../../components/ColorfulTag.vue' import { searchPaneRefKey } from '../../../injection_keys.ts' import { ProgressData } from '../DownloadPane.vue' import { ensureHttps } from '../../../utils.tsx' +import IconButton from '../../../components/IconButton.vue' const store = useStore() @@ -206,34 +207,24 @@ function handleSearchClick() {
-
-
-
+ -
-
+ + -
- + + - +
diff --git a/src/panes/FavPane/components/FavCard.vue b/src/panes/FavPane/components/FavCard.vue index c0564ca..c60e366 100644 --- a/src/panes/FavPane/components/FavCard.vue +++ b/src/panes/FavPane/components/FavCard.vue @@ -6,6 +6,7 @@ import { ensureHttps, isElementInViewport, playTaskToQueueAnimation } from '../. import { computed, inject, ref } from 'vue' import { navDownloadButtonRefKey } from '../../../injection_keys.ts' import { SearchType } from '../../SearchPane/SearchPane.vue' +import IconButton from '../../../components/IconButton.vue' const props = defineProps<{ media: MediaInFav @@ -18,7 +19,7 @@ const props = defineProps<{ const navDownloadButtonRef = inject(navDownloadButtonRefKey) const rootDivRef = ref() -const downloadButtonRef = ref() +const downloadButtonRef = ref>() const openInBrowserHref = computed(() => { if (props.media.type === 2) { @@ -54,7 +55,7 @@ function playDownloadAnimation() { return } - const from = downloadButtonRef.value + const from = downloadButtonRef.value?.$el const to = navDownloadButtonRef?.value if (from instanceof Element && to !== undefined) { @@ -121,31 +122,20 @@ defineExpose({ playDownloadAnimation, media: props.media })
- + - - -
+ + -
- -
+ -
+
diff --git a/src/panes/HistoryPane/components/HistoryCard.vue b/src/panes/HistoryPane/components/HistoryCard.vue index 8a1d25e..7e9583b 100644 --- a/src/panes/HistoryPane/components/HistoryCard.vue +++ b/src/panes/HistoryPane/components/HistoryCard.vue @@ -6,6 +6,7 @@ import { navDownloadButtonRefKey } from '../../../injection_keys.ts' import { ensureHttps, isElementInViewport, playTaskToQueueAnimation } from '../../../utils.tsx' import { PhDownloadSimple, PhGoogleChromeLogo, PhMagnifyingGlass } from '@phosphor-icons/vue' import SimpleCheckbox from '../../../components/SimpleCheckbox.vue' +import IconButton from '../../../components/IconButton.vue' const props = defineProps<{ episodeType: EpisodeType @@ -19,7 +20,7 @@ const props = defineProps<{ const navDownloadButtonRef = inject(navDownloadButtonRefKey) const rootDivRef = ref() -const downloadButtonRef = ref() +const downloadButtonRef = ref>() const openInBrowserHref = computed(() => { if (props.episodeType === 'Normal') { @@ -98,7 +99,7 @@ function playDownloadAnimation() { return } - const from = downloadButtonRef.value + const from = downloadButtonRef.value?.$el const to = navDownloadButtonRef?.value if (from instanceof Element && to !== undefined) { @@ -175,31 +176,20 @@ defineExpose({ playDownloadAnimation, historyDetail: props.historyDetail })
- + - - -
+ + -
- -
+ -
+
diff --git a/src/panes/SearchPane/components/EpisodeCard.vue b/src/panes/SearchPane/components/EpisodeCard.vue index 90e873c..cfb9a03 100644 --- a/src/panes/SearchPane/components/EpisodeCard.vue +++ b/src/panes/SearchPane/components/EpisodeCard.vue @@ -18,6 +18,7 @@ import PartsDialogContent from './PartsDialogContent.vue' import { ensureHttps, extractBvid, isElementInViewport, playTaskToQueueAnimation } from '../../../utils.tsx' import { navDownloadButtonRefKey } from '../../../injection_keys.ts' import { SearchType } from '../SearchPane.vue' +import IconButton from '../../../components/IconButton.vue' onMounted(() => console.log('EpisodeCard mounted')) onUpdated(() => console.log('EpisodeCard updated')) @@ -51,7 +52,7 @@ const props = defineProps<{ const navDownloadButtonRef = inject(navDownloadButtonRefKey) const rootDivRef = ref() -const downloadButtonRef = ref() +const downloadButtonRef = ref>() const episodeInfo = computed(() => { if (props.episodeType === 'NormalSingle') { @@ -174,7 +175,7 @@ function playDownloadAnimation() { return } - const from = downloadButtonRef.value + const from = downloadButtonRef.value?.$el const to = navDownloadButtonRef?.value if (from instanceof Element && to !== undefined) { @@ -226,38 +227,26 @@ defineExpose({ playDownloadAnimation, episodeInfo })
- + - -
+ + -
-
+ -
- -
+ -
+
diff --git a/src/panes/WatchLaterPane/components/WatchLaterCard.vue b/src/panes/WatchLaterPane/components/WatchLaterCard.vue index 7be5122..0ebe892 100644 --- a/src/panes/WatchLaterPane/components/WatchLaterCard.vue +++ b/src/panes/WatchLaterPane/components/WatchLaterCard.vue @@ -6,6 +6,7 @@ import { ensureHttps, extractEpId, isElementInViewport, playTaskToQueueAnimation import { PhDownloadSimple, PhGoogleChromeLogo, PhMagnifyingGlass } from '@phosphor-icons/vue' import SimpleCheckbox from '../../../components/SimpleCheckbox.vue' import { SearchType } from '../../SearchPane/SearchPane.vue' +import IconButton from '../../../components/IconButton.vue' const props = defineProps<{ media: MediaInWatchLater @@ -18,7 +19,7 @@ const props = defineProps<{ const navDownloadButtonRef = inject(navDownloadButtonRefKey) const rootDivRef = ref() -const downloadButtonRef = ref() +const downloadButtonRef = ref>() const openInBrowserHref = computed(() => { if (props.media.redirect_url === null) { @@ -43,7 +44,7 @@ function playDownloadAnimation() { return } - const from = downloadButtonRef.value + const from = downloadButtonRef.value?.$el const to = navDownloadButtonRef?.value if (from instanceof Element && to !== undefined) { @@ -109,31 +110,20 @@ defineExpose({ playDownloadAnimation, media: props.media })
- + - - -
+ + -
- -
+ -
+