updated mobile filter modal

This commit is contained in:
Jake
2022-11-21 12:39:57 -07:00
parent 8f911c2e24
commit 19035162a4
4 changed files with 511 additions and 379 deletions

View File

@@ -0,0 +1,8 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<line x1="4" y1="6.375" x2="20" y2="6.375" stroke="white"/>
<line x1="4" y1="12" x2="20" y2="12" stroke="white"/>
<line x1="4" y1="17.75" x2="20" y2="17.75" stroke="white"/>
<rect x="9.5" y="10.25" width="3.5" height="3.5" rx="0.5" fill="#111112" stroke="white"/>
<rect x="13.625" y="16" width="3.5" height="3.5" rx="0.5" fill="#111112" stroke="white"/>
<rect x="14.375" y="4.5" width="3.5" height="3.5" rx="0.5" fill="#111112" stroke="white"/>
</svg>

After

Width:  |  Height:  |  Size: 548 B

View File

@@ -11,7 +11,6 @@ $(document).ready(() => {
$(`#use_case_companies_list .card-uses.category_${category}`).show()
}
const featured_count = show_cats_arr.filter( (current) => {
return current == "infrastructure" || current == "developer_tooling"
})
@@ -24,28 +23,40 @@ $(document).ready(() => {
// update category counts
if (featured_count.length === 0) {
$("#featured_count").hide()
$(".featured_count").hide()
}else {
$("#featured_count").html(featured_count.length)
$("#featured_count").show()
$(".featured_count").html(featured_count.length)
$(".featured_count").show()
}
if (other_count.length === 0) {
$("#other_count").hide()
$(".other_count").hide()
}else{
$("#other_count").html(other_count.length)
$("#other_count").show()
$(".other_count").html(other_count.length)
$(".other_count").show()
}
if(show_cats_arr.length === 0) {
$(".total_count").hide()
}else {
$(".total_count").html(show_cats_arr.length)
$(".total_count").show()
}
}
$(".cat_checkbox input").change((event) => {
const lang = $(event.target).val().toLowerCase().split(' ').join('_')
// const lang = $(event.target).val().toLowerCase().split(' ').join('_')
const lang = $(event.target).val()
const lang_checked = $(event.target).prop("checked")
$(".input_"+lang).prop("checked", lang_checked)
if (lang_checked) {
show_cats_arr.push(lang)
if ( show_cats_arr.indexOf(lang) === -1){
show_cats_arr.push(lang)
}
} else {
show_cats_arr.indexOf(lang) !== -1 && show_cats_arr.splice(show_cats_arr.indexOf(lang), 1)
}