|
12 | 12 | </button> |
13 | 13 | <!-- table of contents --> |
14 | 14 | <button |
15 | | - v-for="t in toc" |
| 15 | + v-for="(t, i) in toc" |
16 | 16 | :key="t" |
17 | 17 | class="py-1 px-2 rounded-md hover:bg-blade-800 flex justify-start items-center gap-2" |
18 | | - @click="scrollTo(dashCase(t.text))" |
| 18 | + @click="scrollTo(null, i)" |
19 | 19 | > |
20 | 20 | <icon-bookmark class="w-5 h-5 stroke-1.5" /> |
21 | 21 | <span>{{ t.text }}</span> |
|
27 | 27 | <div class="flex flex-col gap-12"> |
28 | 28 | <!-- heading --> |
29 | 29 | <div class="flex flex-col justify-center items-center gap-4"> |
30 | | - <img class="w-32" src="@/assets/logo.svg" alt="SongDrive Song Management Tool" /> |
| 30 | + <img class="w-24 md:w-32" src="@/assets/logo.svg" alt="SongDrive Song Management Tool" /> |
31 | 31 | <div class="text-3xl uppercase text-spring-600">{{ t('app.name') }}</div> |
32 | | - <div class="text-2xl">{{ t('app.summary') }}</div> |
| 32 | + <div class="text-lg md:text-2xl text-center">{{ t('app.summary') }}</div> |
33 | 33 | </div> |
34 | 34 | <!-- features --> |
35 | | - <div class="grid grid-cols-3 gap-8"> |
| 35 | + <div class="grid grid-cols-1 sm:grid-cols-3 gap-8"> |
36 | 36 | <div class="flex flex-col justify-start items-center gap-4"> |
37 | 37 | <icon-bolt class="w-12 h-12 stroke-1" /> |
38 | | - <div class="text-xl uppercase tracking-widest">{{ t('docu.features.0.title') }}</div> |
| 38 | + <div class="text-xl uppercase tracking-widest text-center"> |
| 39 | + {{ t('docu.features.0.title') }} |
| 40 | + </div> |
39 | 41 | <div class="text-center">{{ t('docu.features.0.description') }}</div> |
40 | 42 | </div> |
41 | 43 | <div class="flex flex-col justify-center items-center gap-4"> |
42 | 44 | <icon-microphone class="w-12 h-12 stroke-1" /> |
43 | | - <div class="text-xl uppercase tracking-widest">{{ t('docu.features.1.title') }}</div> |
| 45 | + <div class="text-xl uppercase tracking-widest text-center"> |
| 46 | + {{ t('docu.features.1.title') }} |
| 47 | + </div> |
44 | 48 | <div class="text-center">{{ t('docu.features.1.description') }}</div> |
45 | 49 | </div> |
46 | 50 | <div class="flex flex-col justify-center items-center gap-4"> |
47 | 51 | <icon-tools class="w-12 h-12 stroke-1" /> |
48 | | - <div class="text-xl uppercase tracking-widest">{{ t('docu.features.2.title') }}</div> |
| 52 | + <div class="text-xl uppercase tracking-widest text-center"> |
| 53 | + {{ t('docu.features.2.title') }} |
| 54 | + </div> |
49 | 55 | <div class="text-center">{{ t('docu.features.2.description') }}</div> |
50 | 56 | </div> |
51 | 57 | </div> |
@@ -114,8 +120,12 @@ const dashCase = (text) => { |
114 | 120 | }; |
115 | 121 |
|
116 | 122 | // scroll to element of given id |
117 | | -const scrollTo = (id) => { |
118 | | - document.getElementById(id).scrollIntoView({ behavior: "smooth" }); |
| 123 | +const scrollTo = (id, h2=null) => { |
| 124 | + if (id) { |
| 125 | + document.getElementById(id).scrollIntoView({ behavior: "smooth" }); |
| 126 | + } else { |
| 127 | + document.querySelectorAll('h2')[h2].scrollIntoView({ behavior: "smooth" }); |
| 128 | + } |
119 | 129 | }; |
120 | 130 |
|
121 | 131 | // generate table of contents from h2's |
|
0 commit comments