Skip to content

Commit a5daba3

Browse files
Add accordion to troubleshootings section
1 parent f4d8be9 commit a5daba3

1 file changed

Lines changed: 40 additions & 15 deletions

File tree

gh-pages/pages/user-guide.vue

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ const troubleshootingItems = [
7474
],
7575
},
7676
]
77+
78+
const openTroubleshootingIndex = ref(0)
79+
80+
function toggleTroubleshootingItem(index) {
81+
openTroubleshootingIndex.value =
82+
openTroubleshootingIndex.value === index ? null : index
83+
}
7784
</script>
7885

7986
<template>
@@ -443,24 +450,42 @@ const troubleshootingItems = [
443450
If something is not working as expected, these are the most common issues and the fastest steps to try first.
444451
</p>
445452

446-
<div class="space-y-4">
453+
<div class="space-y-3">
447454
<div
448-
v-for="item in troubleshootingItems"
455+
v-for="(item, index) in troubleshootingItems"
449456
:key="item.title"
450-
class="rounded-2xl border border-ln-border bg-black/10 p-5"
457+
class="border border-ln-border rounded-2xl overflow-hidden transition-colors duration-200"
458+
:class="openTroubleshootingIndex === index
459+
? 'border-ln-pink/30 bg-ln-card'
460+
: 'bg-ln-card/50 hover:border-ln-pink/20'"
451461
>
452-
<h3 class="font-display font-semibold text-ln-text text-lg mb-3">
453-
{{ item.title }}
454-
</h3>
455-
<ul class="list-disc list-inside space-y-2">
456-
<li
457-
v-for="step in item.solution"
458-
:key="step"
459-
class="font-display text-ln-muted text-sm leading-relaxed"
460-
>
461-
{{ step }}
462-
</li>
463-
</ul>
462+
<button
463+
class="w-full flex items-center justify-between gap-4 px-5 py-4 text-left"
464+
@click="toggleTroubleshootingItem(index)"
465+
>
466+
<span class="font-display font-semibold text-ln-text text-base sm:text-lg">
467+
{{ item.title }}
468+
</span>
469+
<span
470+
class="text-ln-muted text-xl flex-shrink-0 transition-transform duration-200"
471+
:class="openTroubleshootingIndex === index ? 'rotate-45' : ''"
472+
>+</span>
473+
</button>
474+
475+
<div
476+
v-show="openTroubleshootingIndex === index"
477+
class="px-5 pb-5"
478+
>
479+
<ul class="list-disc list-inside space-y-2">
480+
<li
481+
v-for="step in item.solution"
482+
:key="step"
483+
class="font-display text-ln-muted text-sm leading-relaxed"
484+
>
485+
{{ step }}
486+
</li>
487+
</ul>
488+
</div>
464489
</div>
465490
</div>
466491
</section>

0 commit comments

Comments
 (0)