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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user