docs/.vitepress/theme/components/SidebarCard.vue
46 lines · 1523 bytes
1<!--
2 Copyright (c) 2024 taskylizard
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15-->
16<script setup lang="ts">
17import { ref } from 'vue'
18
19import LegendModal from './LegendModal.vue'
20
21const isModalOpen = ref(false)
22
23const focusLegendModal = () => {
24 isModalOpen.value = true
25}
26</script>
27
28<template>
29 <div
30 class="bg-$vp-c-bg hover:bg-$vp-c-bg/40 border-$vp-c-default-soft hover:border-primary transition-border relative z-0 rounded-lg border-2 border-solid p-5 duration-500 mt-2"
31 >
32 <button class="w-full text-left" @click="isModalOpen = true">
33 <div class="align-center flex items-center gap-2">
34 <div
35 class="i-material-symbols-info-outline-rounded text-$vp-c-text-2"
36 />
37 <div class="text-$vp-c-text-1 lh-relaxed text-sm font-bold">Legend</div>
38 </div>
39 <div class="text-$vp-c-text-2 text-xs mt-1">
40 Click to view all icons and their meanings
41 </div>
42 </button>
43
44 <LegendModal :is-open="isModalOpen" @close="isModalOpen = false" />
45 </div>
46</template>