-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add instructions accordion to /minecraft
- Loading branch information
Showing
3 changed files
with
130 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<script setup> | ||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; | ||
import { ref } from 'vue'; | ||
const props = defineProps({ | ||
title: { type: String, required: true }, | ||
ariaTitle: { type: String, required: true } | ||
}); | ||
const showPanel = ref(false); | ||
const togglePanel = (event) => { | ||
showPanel.value = !showPanel.value; | ||
} | ||
</script> | ||
|
||
<template> | ||
<div class="border-2 rounded-lg"> | ||
<button | ||
:arial-controls="'accordion-content-' + ariaTitle" | ||
:id="'accordion-control-' + ariaTitle" | ||
@click.prevent="togglePanel" | ||
class="font-poppins py-4 w-full font-medium text-gray-500 flex flex-row items-center justify-between bg-transparent border-solid border-t-2 border-b-0 border-x-0 border-gray-100"> | ||
{{ title }} | ||
<FontAwesomeIcon | ||
v-if="showPanel" | ||
class="rotate-180" | ||
:icon="['fas', 'chevron-down']" | ||
/> | ||
<FontAwesomeIcon | ||
v-else | ||
:icon="['fas', 'chevron-down']" | ||
/> | ||
</button> | ||
<Transition> | ||
<div | ||
:aria-hidden="!showPanel" | ||
:id="'content-' + ariaTitle" | ||
class="p-4" | ||
v-if="showPanel"> | ||
<slot></slot> | ||
</div> | ||
</Transition> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters