-
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.
Created FAQ component skeleton (CarletonComputerScienceSociety#9)
- Loading branch information
1 parent
3473277
commit 9614fd6
Showing
1 changed file
with
127 additions
and
0 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,127 @@ | ||
--- | ||
const { index = 0, question, answer, source = 'nosrc' } = Astro.props; | ||
--- | ||
|
||
<div class="faq"> | ||
<div class="faq-title"> | ||
<div class="accordion-section-title"> <!-- TODO: add href attribute linking to answer div --> | ||
{question} | ||
</div> | ||
<!-- TODO: add rotating chevron --> | ||
</div> | ||
<div class="accordion-section-content"> <!-- TODO: add id attr for linking to --> | ||
<p> | ||
{answer} | ||
</p> | ||
{source != 'nosrc' && | ||
<p> | ||
Visit <a href={source}>this page</a> for more information. | ||
</p> | ||
} | ||
</div> | ||
</div> | ||
|
||
<style> | ||
.faq-section { | ||
width: 100%; | ||
height: fit-content; | ||
display: flex; | ||
justify-content: center; | ||
margin-top: 5rem; | ||
margin-bottom: 5rem; | ||
|
||
h1 { | ||
margin-bottom: 2rem; | ||
} | ||
|
||
.faq-container { | ||
width: $page-width; | ||
margin: 0.5rem; | ||
} | ||
|
||
a { | ||
text-decoration: underline; | ||
color: #b62a2a; | ||
} | ||
|
||
a:hover { | ||
color: #ff0000; | ||
} | ||
} | ||
|
||
@media screen and (max-width: 855px) { | ||
.faq-section { | ||
align-items: center; | ||
margin: auto; | ||
|
||
.faq-container { | ||
width: 600px; | ||
} | ||
} | ||
} | ||
|
||
@media screen and (max-width: 855px) { | ||
.faq-section { | ||
align-items: center; | ||
margin: auto; | ||
|
||
.faq-container { | ||
width: 600px; | ||
} | ||
} | ||
} | ||
|
||
.faq { | ||
margin: 1rem 0; | ||
border-radius: 0.1rem; | ||
background: #f0efef; | ||
transition: all linear 0.1s; | ||
border-left: 4px solid #f0efef; | ||
cursor: pointer; | ||
} | ||
|
||
.faq-title { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
|
||
.faq-chevron { | ||
margin: 1rem; | ||
margin-right: 1.5rem; | ||
} | ||
|
||
.accordion { | ||
overflow: hidden; | ||
border-radius: 4px; | ||
} | ||
.accordion-section-title { | ||
width: 100%; | ||
padding: 15px; | ||
} | ||
.accordion-section-title { | ||
width: 100%; | ||
display: inline-block; | ||
transition: all linear 0.1s; | ||
padding: 1.3rem 15px; | ||
text-decoration: none; | ||
font-weight: 600; | ||
} | ||
.faq.active { | ||
border-left: 4px solid #e62828; | ||
text-decoration: none; | ||
} | ||
.faq:hover { | ||
border-left: 4px solid #e62828; | ||
text-decoration: none; | ||
} | ||
.accordion-section:last-child .accordion-section-title { | ||
border-bottom: none; | ||
} | ||
.accordion-section-content { | ||
padding: 15px; | ||
padding-top: 0; | ||
display: none; | ||
} | ||
</style> |