-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Roles): Accordions in About page for roles. Closes #182
- Loading branch information
1 parent
dd48bf3
commit f3b58ca
Showing
5 changed files
with
94 additions
and
17 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
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,11 @@ | ||
.accordion { | ||
.card { | ||
background-color: #3a3a3a; | ||
border: 1px solid #6e6e6e; | ||
transition: all 0.25s ease; | ||
|
||
&:hover { | ||
background-color: #303030; | ||
} | ||
} | ||
} |
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
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,76 @@ | ||
<template> | ||
<div class="about-role card" @click.prevent="toggleCollapse"> | ||
<div :id="`role-heading-${role.name}`" class="role-heading card-header"> | ||
<button class="btn w-100 h-100 text-left text-white d-flex align-items-center" type="button" data-toggle="collapse" | ||
:data-target="`#role-collapse-${role.name}`" | ||
aria-expanded="true" :aria-controls="`role-collapse-${role.name}`"> | ||
<span class="d-flex flex-grow-1 align-items-center"> | ||
<RoleImage :role="role.name"/> | ||
<RoleText :role="role.name" prefix="the" class="font-weight-bold ml-2"/> | ||
</span> | ||
<i class="fa fa-chevron-down about-role-chevron" :class="{ 'fa-rotate-180': isCollapsed }"/> | ||
</button> | ||
</div> | ||
<div :id="`role-collapse-${role.name}`" class="collapse" :aria-labelledby="`role-heading-${role.name}`"> | ||
<div class="card-body"> | ||
<div class="row d-flex align-items-center"> | ||
<div class="col-md-2 col-4 d-flex flex-column align-items-center"> | ||
<RoleImage :role="role.name"/> | ||
<RoleTypeBadge :role="role" class="mt-2"/> | ||
</div> | ||
<RoleText :role="role.name" prefix="the" class="col-md-2 col-8 text-center font-weight-bold cursor-text"/> | ||
<div class="col-md-8 mt-md-0 col-12 mt-3"> | ||
<p v-for="paragraph of $t(`Role.description.${role.name}`)" | ||
:key="paragraph" v-html="paragraph"/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Role from "@/classes/Role"; | ||
import RoleImage from "@/components/shared/Game/Role/RoleImage"; | ||
import RoleTypeBadge from "@/components/shared/Game/Role/RoleTypeBadge"; | ||
import RoleText from "@/components/shared/Game/Role/RoleText"; | ||
export default { | ||
name: "AboutRole", | ||
components: { RoleText, RoleTypeBadge, RoleImage }, | ||
props: { | ||
role: { | ||
type: Role, | ||
required: true, | ||
}, | ||
}, | ||
data() { | ||
return { isCollapsed: false }; | ||
}, | ||
methods: { | ||
toggleCollapse() { | ||
this.isCollapsed = !this.isCollapsed; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import "../../../node_modules/bootstrap/scss/bootstrap"; | ||
@import "../../assets/scss/variables"; | ||
.role-heading { | ||
padding: 0; | ||
button { | ||
@include font-size(1.25rem); | ||
.about-role-chevron { | ||
transition: all ease 0.25s; | ||
} | ||
} | ||
img { | ||
width: 40px; | ||
height: 40px; | ||
} | ||
} | ||
</style> |