mirror of
https://github.com/EyeTrackVR/EyeTrackVR-Docs.git
synced 2025-11-04 14:49:44 +08:00
- Added support for dynamic links and arrays of parts to 3d_printed_parts.yml and parts.html
100 lines
3.0 KiB
HTML
100 lines
3.0 KiB
HTML
<!-- Do not edit this file - it is a template. Please edit the faq.yml file -->
|
|
<style>
|
|
.accordion {
|
|
width: 100%;
|
|
margin: 1px auto;
|
|
padding: 5px 5px;
|
|
}
|
|
|
|
.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 .hmd {
|
|
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 .hmd::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 .parts {
|
|
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 hr {
|
|
width: 100%;
|
|
margin-left: 0;
|
|
border: 1px solid grey;
|
|
}
|
|
|
|
/* Unhides the content part when active. Sets the height */
|
|
.accordion .container.active .parts {
|
|
height: 180px;
|
|
}
|
|
|
|
/* Changes from plus sign to negative sign once active */
|
|
.accordion .container.active .hmd::before {
|
|
content: '';
|
|
font-size: 30px;
|
|
}
|
|
</style>
|
|
<h1 class="fs-6 fw-500" align="left">3d Printed Parts For Supported Headsets</h1>
|
|
<div class="accordion-body">
|
|
{% for faq in site.data.3d_printed_parts_yaml.3d_printed_parts %}
|
|
<div class="accordion">
|
|
<hr>
|
|
<div class="container">
|
|
<div class="hmd fw-400">
|
|
<h1 class="fs-5 fw-500">
|
|
{{ faq.hmd }}
|
|
</h1>
|
|
</div>
|
|
<div class="parts">
|
|
<blockquote>
|
|
<span class="answerspan{{ faq.faq_link_id }}">
|
|
{%- capture hyper_link -%}
|
|
<a href="{{ faq.hyper_link }}" target="_blank">{{ faq.link_description }}</a>
|
|
{%- endcapture -%}
|
|
<ul>
|
|
{{ hyper_link }}
|
|
{% for part in faq.parts %}
|
|
<li>{{ part }}</li>
|
|
{% endfor %}
|
|
{{ parts }}
|
|
</ul>
|
|
</span>
|
|
</blockquote>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
<script type="text/javascript">
|
|
const accordion = document.getElementsByClassName('container');
|
|
|
|
for (i = 0; i < accordion.length; i++) {
|
|
accordion[i].addEventListener('click', function () {
|
|
this.classList.toggle('active');
|
|
})
|
|
}
|
|
</script> |