|
1 | 1 | <template>
|
2 |
| - <NavBar :selected-library="selectedLibrary" /> |
3 |
| - <DemoPage @changedLibrary="updateLibrary" /> |
4 |
| - <FooterBar /> |
| 2 | + <v-app id="home"> |
| 3 | + <!-- ====================================================== App Bar --> |
| 4 | + <AppBar |
| 5 | + :selectedLibrary="selectedLibrary" |
| 6 | + @updated-drawer="toggleDrawer" |
| 7 | + /> |
| 8 | + |
| 9 | + <!-- ====================================================== Navigation Drawer --> |
| 10 | + <v-navigation-drawer |
| 11 | + v-model="drawer" |
| 12 | + :absolute="drawerOptions.absolute" |
| 13 | + :color="drawerOptions.color" |
| 14 | + :elevation="drawerOptions.elevation" |
| 15 | + > |
| 16 | + <MenuComponent :drawerOptions="drawerOptions" /> |
| 17 | + </v-navigation-drawer> |
| 18 | + |
| 19 | + <!-- ====================================================== Main Container --> |
| 20 | + <v-main class="pb-10"> |
| 21 | + <v-container |
| 22 | + class="px-7" |
| 23 | + style="max-width: 90%;" |
| 24 | + > |
| 25 | + <DocsPage |
| 26 | + @changedLibrary="selectedLibrary = $event" |
| 27 | + @changedTheme="selectedTheme = $event" |
| 28 | + /> |
| 29 | + </v-container> |
| 30 | + </v-main> |
| 31 | + </v-app> |
5 | 32 | </template>
|
6 | 33 |
|
7 |
| -<script setup lang="ts"> |
8 |
| -import { ref, provide } from 'vue'; |
9 |
| -import { useCoreStore } from '@/stores/index'; |
10 |
| -import DemoPage from '@/components/DemoPage.vue'; |
11 |
| -import NavBar from '@/components/Layout/NavBar.vue'; |
12 |
| -import FooterBar from '@/components/Layout/FooterBar.vue'; |
| 34 | +<script setup> |
| 35 | +import { provide, ref } from 'vue'; |
| 36 | +import { useDisplay } from 'vuetify'; |
| 37 | +import AppBar from './documentation/layout/AppBar.vue'; |
| 38 | +import MenuComponent from './documentation/components/MenuComponent.vue'; |
| 39 | +import DocsPage from './documentation/DocsPage.vue'; |
| 40 | +import { useCoreStore } from './stores/index'; |
| 41 | +// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars |
| 42 | +import Prism from 'prismjs'; |
| 43 | +import 'prismjs/components/prism-typescript.js'; |
13 | 44 |
|
14 | 45 |
|
15 |
| -provide('styleData', { |
16 |
| - h2ColClass: 'col-12 mb-4', |
17 |
| - fieldWidth: { |
18 |
| - maxWidth: '100%', |
19 |
| - width: '300px', |
20 |
| - }, |
21 |
| -}); |
| 46 | +const { smAndUp } = useDisplay(); |
22 | 47 |
|
| 48 | +const isSmAndUp = computed(() => smAndUp.value); |
23 | 49 | const store = useCoreStore();
|
24 |
| -const selectedLibrary = ref({}); |
| 50 | +const drawer = ref(isSmAndUp.value); |
| 51 | +const drawerOptions = ref({ |
| 52 | + absolute: false, |
| 53 | + color: '', |
| 54 | + elevation: 10, |
| 55 | +}); |
25 | 56 |
|
26 |
| -provide('links', store.links); |
27 |
| -provide('highlightJsLinks', store.highlightJsLinks); |
28 |
| -provide('prismLinks', store.prismLinks); |
| 57 | +const selectedLibrary = ref(store.libraries[1]); |
| 58 | +const selectedTheme = ref('neon-bunny'); |
| 59 | +
|
| 60 | +provide('selectedLibrary', selectedLibrary); |
| 61 | +provide('selectedTheme', selectedTheme); |
29 | 62 |
|
30 | 63 | const codeBlockOptions = ref({
|
31 | 64 | browserWindow: false,
|
32 | 65 | preHeight: '30em',
|
33 | 66 | });
|
34 | 67 |
|
35 |
| -provide('codeBlockOptions', codeBlockOptions); |
| 68 | +provide('codeBlockOptions', codeBlockOptions.value); |
| 69 | +provide('drawerOptions', drawerOptions); |
| 70 | +provide('links', store.links); |
36 | 71 |
|
37 |
| -function updateLibrary(library) { |
38 |
| - selectedLibrary.value = library.value; |
| 72 | +function toggleDrawer() { |
| 73 | + drawer.value = !drawer.value; |
39 | 74 | }
|
40 | 75 | </script>
|
41 | 76 |
|
42 | 77 |
|
43 |
| -<style scoped> |
| 78 | +<style lang="scss"> |
| 79 | +html { |
| 80 | + scroll-behavior: smooth; |
| 81 | + scroll-padding-top: 70px; |
| 82 | +} |
| 83 | +
|
| 84 | +.top-app-bar { |
| 85 | + z-index: 99 !important; |
| 86 | +
|
| 87 | + .nav-drawer-btn { |
| 88 | + .nav-drawer-icon { |
| 89 | + height: 18px; |
| 90 | + width: 18px; |
| 91 | + } |
| 92 | + } |
| 93 | +} |
| 94 | +
|
| 95 | +.v-heading { |
| 96 | + position: relative; |
| 97 | +
|
| 98 | + > a { |
| 99 | + color: rgb(var(--v-theme-primary)); |
| 100 | + display: inline-block; |
| 101 | + inset: 0; |
| 102 | + margin: 0 -0.7em; |
| 103 | + position: absolute; |
| 104 | +
|
| 105 | + &:not(:hover, :focus) { |
| 106 | + opacity: 0; |
| 107 | + } |
| 108 | + } |
| 109 | +} |
| 110 | +
|
| 111 | +.name-item:not(:hover, :focus) span { |
| 112 | + opacity: 0; |
| 113 | +} |
| 114 | +
|
| 115 | +.v-divider { |
| 116 | + margin: 0; |
| 117 | +} |
44 | 118 | </style>
|
| 119 | + |
| 120 | + |
0 commit comments