Newer
Older
<div
id="title"
class="text-container title-text"
>
<button class="accordion households-accordion active"><span v-html="t('text.components.mapText.p1Title')"></span><span class="symbol">-</span></button>
<p v-html="t('text.components.mapText.paragraph1')"></p>
<img src="@/assets/images/avg_household_size_2022_en.png" alt="Choropleth map of average household size, of occupied housing units, at the county-level across the contiguous U.S.. The greatest average housing size were in Oglala Lakota County, South Dakota (5), Madison County, Idaho (3.9) and Todd County, South Dakota (3.8) (U.S. Census Bureau, 2022).">
<figcaption><p v-html="t('text.components.mapText.caption1')"></p></figcaption>
<button class="accordion latino-accordion"><span v-html="t('text.components.mapText.p4Title')"></span><span class="symbol">+</span></button>
<p v-html="t('text.components.mapText.paragraph4')"></p>
<img src="@/assets/images/perc_hispanic_census_2022_en.png" alt="Choropleth map of percent of Hispanic populations at the county-level across the contiguous U.S.. The greatest percent Hispanic were in Kenedy County, Texas (96.6%), Starr County, Texas (96.2%) and Webb County, Texas (95.4%) (U.S. Census Bureau, 2022).">
<figcaption><p v-html="t('text.components.mapText.caption4')"></p></figcaption>
<button class="accordion disability-accordion"><span v-html="t('text.components.mapText.p5Title')"></span><span class="symbol">+</span></button>
<p v-html="t('text.components.mapText.paragraph5')"></p>
<img src="@/assets/images/perc_disabled_census_2022_en.png" alt="Choropleth map of percent with a disability of total civilian noninstitutionalized population at the county-level across the contiguous U.S.. The greatest percent disabled were in Catron County, New Mexico (41%), Mora County, New Mexico (34%) and Kinney County, Texas (34%) (U.S. Census Bureau, 2022).">
<figcaption><p v-html="t('text.components.mapText.caption5')"></p></figcaption>
<button class="accordion income-accordion"><span v-html="t('text.components.mapText.p2Title')"></span><span class="symbol">+</span></button>
<p v-html="t('text.components.mapText.paragraph2')"></p>
<img src="@/assets/images/med_income_census_2022_en.png" alt="Choropleth map of median household income in the past 12 months (in 2022 inflation-adjusted dollars) at the county-level across the contiguous U.S.. The greatest median incomes include Santa Clara County, California ($153,792), San Mateo County, California ($149,907) and Marin County, California ($142,019) (U.S. Census Bureau, 2022).">
<figcaption><p v-html="t('text.components.mapText.caption2')"></p></figcaption>
<button class="accordion renters-accordion"><span v-html="t('text.components.mapText.p3Title')"></span><span class="symbol">+</span></button>
<p v-html="t('text.components.mapText.paragraph3')"></p>
<img src="@/assets/images/median_rent_2022_en.png" alt="Choropleth map of median gross rent at the county-level across the contiguous U.S.. The greatest median gross rents include San Mateo County, California ($2,805), Santa Clara County, California ($2,719) and Marin County, California ($2,487) (U.S. Census Bureau, 2022)">
<figcaption><p v-html="t('text.components.mapText.caption3')"></p></figcaption>
Carr, Amanda Nicole
committed
</div>
<script setup>
import { onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
onMounted(() => {
const acc = document.getElementsByClassName("accordion");
for (let i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function () {
this.classList.toggle("active");
const panel = this.nextElementSibling;
const symbol = this.querySelector('.symbol');
if (panel.style.display === "block") {
panel.style.display = "none";
symbol.textContent = "+";
} else {
panel.style.display = "block";
symbol.textContent = "-";
}
});
}
});
<style scoped>
.accordion {
background-color: #eee;
color: #fff;
cursor: pointer;
width: 100%;
border: none;
text-align: left;
outline: none;
transition: 0.4s;
display: flex;
justify-content: space-between;
align-items: center;
font-family: 'Source Sans Pro', sans-serif;
position: relative;
border: 2px solid transparent;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
.accordion.disability-accordion {
.accordion::before {
content: "";
position: absolute;
top: -2px;
left: -2px;
right: -2px;
bottom: -2px;
border: 2px solid transparent;
z-index: -1;
transition: border-color 0.3s;
}
.accordion:hover::before, .accordion.active::before {
border-color: rgba(217, 217, 217, 0.95);
margin-bottom: 15px;
margin-top: -15px;
border-top-width: 0;
border-radius: 0 0 10px 10px;
.panel p {
margin: 20px;
}
.households-accordion.active + .households-panel {
display: block;
}
figcaption {
background-color: white;
color: black;
padding: 16px;
width: 100%;
text-align: left;
line-height: 1.2;
font-size: 2 rem;
font-family: 'Source Sans Pro', sans-serif;
margin-top: 8px;
}
<style lang="scss">
#choropleth-map-tooltip {
margin-left: -120px;
}