Commit 9b85a89b39
Unsigned
Layout: unified · split
docs/.vitepress/theme/components/Search.vue +34 −8
| @@ -471,6 +471,10 @@ const urlSearchLoading = ref(false) | |||
| 471 | const searchLoading = computed(() => | 471 | const searchLoading = computed(() => |
| 472 | urlSearchMode.value ? urlSearchLoading.value : textSearchLoading.value | 472 | urlSearchMode.value ? urlSearchLoading.value : textSearchLoading.value |
| 473 | ) | 473 | ) |
| 474 | const holdingLoadingImage = ref(false) | ||
| 475 | const loadingImageSrc = computed(() => | ||
| 476 | holdingLoadingImage.value ? '/pet.webp' : '/bubba.webp' | ||
| 477 | ) | ||
| 474 | 478 | ||
| 475 | const pageMeta = (() => { | 479 | const pageMeta = (() => { |
| 476 | const map = new Map<string, { label: string; order: number }>() | 480 | const map = new Map<string, { label: string; order: number }>() |
| @@ -1701,13 +1705,26 @@ function onMouseMove(e: MouseEvent) { | |||
| 1701 | type="search" | 1705 | type="search" |
| 1702 | /> | 1706 | /> |
| 1703 | <div class="search-actions"> | 1707 | <div class="search-actions"> |
| 1704 | <img | 1708 | <button |
| 1705 | v-if="searchLoading" | 1709 | v-if="searchLoading" |
| 1706 | class="search-loading-bubba" | 1710 | class="search-loading-button" |
| 1707 | src="/bubba.webp" | 1711 | type="button" |
| 1708 | alt="" | 1712 | aria-label="Hold to show pet image" |
| 1709 | aria-hidden="true" | 1713 | @pointerdown.stop="holdingLoadingImage = true" |
| 1710 | /> | 1714 | @pointerup.stop="holdingLoadingImage = false" |
| 1715 | @pointerleave="holdingLoadingImage = false" | ||
| 1716 | @pointercancel="holdingLoadingImage = false" | ||
| 1717 | @blur="holdingLoadingImage = false" | ||
| 1718 | @contextmenu.prevent | ||
| 1719 | > | ||
| 1720 | <img | ||
| 1721 | class="search-loading-bubba" | ||
| 1722 | :src="loadingImageSrc" | ||
| 1723 | :alt="holdingLoadingImage | ||
| 1724 | ? 'Pet' | ||
| 1725 | : 'Bubba loading'" | ||
| 1726 | /> | ||
| 1727 | </button> | ||
| 1711 | <div | 1728 | <div |
| 1712 | v-if="!disableDetailedView && searchMode !== 'url'" | 1729 | v-if="!disableDetailedView && searchMode !== 'url'" |
| 1713 | class="view-group toolbar-group" | 1730 | class="view-group toolbar-group" |
| @@ -2426,13 +2443,22 @@ function onMouseMove(e: MouseEvent) { | |||
| 2426 | gap: 4px; | 2443 | gap: 4px; |
| 2427 | } | 2444 | } |
| 2428 | 2445 | ||
| 2446 | .search-loading-button { | ||
| 2447 | display: inline-flex; | ||
| 2448 | align-items: center; | ||
| 2449 | justify-content: center; | ||
| 2450 | padding: 0 !important; | ||
| 2451 | margin-inline-end: 6px; | ||
| 2452 | border: 0; | ||
| 2453 | background: transparent; | ||
| 2454 | cursor: pointer; | ||
| 2455 | } | ||
| 2456 | |||
| 2429 | .search-loading-bubba { | 2457 | .search-loading-bubba { |
| 2430 | width: 32px; | 2458 | width: 32px; |
| 2431 | height: 28px; | 2459 | height: 28px; |
| 2432 | margin-inline-end: 6px; | ||
| 2433 | object-fit: contain; | 2460 | object-fit: contain; |
| 2434 | image-rendering: pixelated; | 2461 | image-rendering: pixelated; |
| 2435 | pointer-events: none; | ||
| 2436 | user-select: none; | 2462 | user-select: none; |
| 2437 | } | 2463 | } |
| 2438 | 2464 | ||
docs/public/pet.webp added
Binary file not shown.