-
+
No icons found for '{{ searchQuery }}'
-
+
or
-
@@ -48,7 +65,7 @@ useEventListener(document, 'mousemove', (mouseEvent) => {
align-items: center;
}
-.bird-icon {
+.animal-icon {
width: 160px;
height: 160px;
color: var(--vp-c-neutral);
@@ -56,12 +73,12 @@ useEventListener(document, 'mousemove', (mouseEvent) => {
margin-top: 72px;
}
-.bird-icon.flip {
+.animal-icon.flip {
transform: rotateY(180deg);
}
@media (min-width: 960px) {
- .bird-icon {
+ .animal-icon {
width: 240px;
height: 240px;
}
diff --git a/docs/.vitepress/theme/composables/useActiveAnchor.ts b/docs/.vitepress/theme/composables/useActiveAnchor.ts
index 19fdba255..643826323 100644
--- a/docs/.vitepress/theme/composables/useActiveAnchor.ts
+++ b/docs/.vitepress/theme/composables/useActiveAnchor.ts
@@ -6,18 +6,18 @@ import { throttleAndDebounce } from 'vitepress/dist/client/theme-default/support
*/
export function useActiveAnchor(container, marker) {
- const onScroll = throttleAndDebounce(setActiveLink, 100);
+ const setActiveLinkDebounced = throttleAndDebounce(setActiveLink, 100);
let prevActiveLink = null;
onMounted(() => {
requestAnimationFrame(setActiveLink);
- window.addEventListener('scroll', onScroll);
+ window.addEventListener('scroll', setActiveLinkDebounced);
});
onUpdated(() => {
// sidebar update means a route change
activateLink(location.hash);
});
onUnmounted(() => {
- window.removeEventListener('scroll', onScroll);
+ window.removeEventListener('scroll', setActiveLinkDebounced);
});
function setActiveLink() {
const links = [].slice.call(container.value.querySelectorAll('.outline-link'));
@@ -64,9 +64,13 @@ export function useActiveAnchor(container, marker) {
marker.value.style.opacity = '0';
}
}
+
+ return {
+ setActiveLinkDebounced,
+ };
}
-const PAGE_OFFSET = 64;
+const PAGE_OFFSET = 128;
function getAnchorTop(anchor) {
return anchor.parentElement.offsetTop - PAGE_OFFSET;
@@ -74,7 +78,7 @@ function getAnchorTop(anchor) {
function isAnchorActive(index, anchor, nextAnchor) {
const scrollTop = window.scrollY;
if (index === 0 && scrollTop === 0) {
- return [true, null];
+ return [true, anchor.hash];
}
if (scrollTop < getAnchorTop(anchor)) {
return [false, null];
diff --git a/docs/.vitepress/theme/composables/useCategoryView.ts b/docs/.vitepress/theme/composables/useCategoryView.ts
index 72bd41f60..ce80f0e2e 100644
--- a/docs/.vitepress/theme/composables/useCategoryView.ts
+++ b/docs/.vitepress/theme/composables/useCategoryView.ts
@@ -1,4 +1,5 @@
-import { ref, inject, Ref } from 'vue';
+import { useRoute } from 'vitepress';
+import { ref, inject, Ref, onMounted, watch } from 'vue';
export const CATEGORY_VIEW_CONTEXT = Symbol('categoryView');
@@ -8,16 +9,30 @@ interface CategoryViewContext {
}
export const categoryViewContext = {
- selectedCategory: ref(''),
+ selectedCategory: ref(),
categoryCounts: ref({}),
};
export function useCategoryView(): CategoryViewContext {
const context = inject