EyeTrackVR-Docs/docs/_includes/custom/FAQ/faq_template.html
ZanzyTHEbar 9f029fc8f1 Fix FAQ to have section support, change the type to add a new section
Fix dark-mode toggle button (now works great)
2022-07-08 17:22:36 +01:00

91 lines
3.0 KiB
HTML

<style>
.accordion-{{ include.type }} {
width: 100%;
margin: 1px auto;
padding: 5px 5px;
}
.accordion-{{ include.type }} .accordion-container {
position: relative;
margin: 5px 5px;
}
/* Positions the labels relative to the .container. Adds padding to the top and bottom and increases font size. Also makes its cursor a pointer */
.accordion-{{ include.type }} .question-{{ include.type }} {
position: relative;
padding: 5px 0;
font-size: 30px;
cursor: pointer;
}
/* Positions the plus sign 5px from the right. Centers it using the transform property. */
.accordion-{{ include.type }} .question-{{ include.type }}::before {
content: '\2304';
position: absolute;
top: 50%;
right: 5px;
font-size: 30px;
transform: translateY(-50%);
}
/* Hides the content (height: 0), decreases font size, justifies text and adds transition */
.accordion-{{ include.type }} .answer-{{ include.type }} {
position: relative;
height: 0;
font-size: 20px;
text-align: justify;
width: 100%;
transition: 0.5s;
overflow: hidden;
}
/* Adds a horizontal line between the contents */
.accordion-{{ include.type }} hr {
width: 100%;
margin-left: 0;
border: 1px solid grey;
}
/* Unhides the content part when active. Sets the height */
.accordion-{{ include.type }} .accordion-container.active .answer-{{ include.type }} {
height: 180px;
}
/* Changes from plus sign to negative sign once active */
.accordion-{{ include.type }} .accordion-container.active .question{{ include.type }}::before {
content: '';
font-size: 30px;
}
</style>
<div class="accordion-body-{{ include.type }}">
{% for faq in site.data.faq_yaml.frequently_asked_questions %}
{% if faq.type == include.type %}
{% if faq.question != null and faq.question != "" %}
<div class="accordion-{{ include.type }}">
<hr>
<div class="accordion-container" onclick=" this.classList.toggle('active');">
<div class="question-{{ include.type }} fw-400">
<h1 class="fs-5 fw-500">
{{ faq.question }}
</h1>
</div>
<div class="answer-{{ include.type }}">
<blockquote>
<span class="answerspan{{ faq.faq_link_id }}">
{% capture editable_part %}
<a href="{{ faq.hyper_link }}" target="_blank">{{ faq.link_description }}</a>
{% endcapture %}
{% if faq.answer contains 'aaaa ' %}
{{ faq.answer | replace: 'aaaa ', editable_part }}
{% else %}
{{ faq.answer }}
{% endif %}
</span>
</blockquote>
</div>
</div>
</div>
{% endif %}
{% endif %}
{% endfor %}
</div>