1
0
mirror of https://github.com/sendevia/website.git synced 2026-03-05 23:32:45 +08:00

opt: code quality

This commit is contained in:
2025-11-16 17:26:23 +08:00
parent 736584e6be
commit e247341e93
3 changed files with 24 additions and 4 deletions

View File

@@ -52,7 +52,8 @@ const props = withDefaults(defineProps<Props>(), {
cursor: pointer;
overflow: hidden;
transition: border-radius var(--md-sys-motion-spring-fast-spatial-duration) var(--md-sys-motion-spring-fast-spatial);
transition: border-radius var(--md-sys-motion-spring-fast-spatial-standard-duration)
var(--md-sys-motion-spring-fast-spatial-standard);
&::after {
content: "";
@@ -82,6 +83,8 @@ const props = withDefaults(defineProps<Props>(), {
}
&:active {
transition: border-radius var(--md-sys-motion-spring-fast-spatial-duration) var(--md-sys-motion-spring-fast-spatial);
&::after {
background-color: var(--md-sys-state-pressed-state-layer);
}

View File

@@ -255,13 +255,25 @@ if (typeof window !== "undefined") {
<div
class="indicator"
:style="{ top: indicator.top, left: indicator.left, width: indicator.width, height: indicator.height, opacity: indicator.opacity }"
:style="{
top: indicator.top,
left: indicator.left,
width: indicator.width,
height: indicator.height,
opacity: indicator.opacity,
}"
aria-hidden="true"
></div>
<div class="indicator-container">
<span v-for="h in grouped" :key="h.id" :data-id="h.id" :class="[{ active: h.id === headingsActiveId }]">
<a :href="`#${h.id}`" @click.prevent="navigateTo(h.id)" role="link" :aria-current="h.id === headingsActiveId ? 'true' : undefined">{{ h.text }}</a>
<a
:href="`#${h.id}`"
@click.prevent="navigateTo(h.id)"
role="link"
:aria-current="h.id === headingsActiveId ? 'true' : undefined"
>{{ h.text }}</a
>
</span>
</div>
</div>

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { ref, onMounted, onBeforeUnmount } from "vue";
const showImageViewer = ref(false);
const currentImageIndex = ref(0);
@@ -123,6 +123,11 @@ if (typeof window !== "undefined") {
characterData: true,
});
}
onBeforeUnmount(() => {
observer.disconnect();
window.removeEventListener("resize", ulCustomBullets);
});
});
}
</script>