Some notes and file clean up. JJSV Templates
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
{% assign catalog_courses = courses.in_catalog %}
|
||||
|
||||
{% include "header" %}
|
||||
|
||||
<div class="row subpage-intro">
|
||||
@ -13,14 +15,18 @@
|
||||
<div class="content-disclaimer np-subpage-container">The content you access on this website is intended for Healthcare Professionals practicing in the U.S. and is consistent with U.S. labeling.</div>
|
||||
|
||||
<main class="np-main np-catalog np-subpage-container np-max-width">
|
||||
|
||||
<a class="mobile-filter-link np-hidden-desktop">Filter by Category <i class="fas fa-filter"></i></a>
|
||||
<div class="np-hidden-desktop mobile-filter-sidebar">
|
||||
<i class="fal fa-times"></i>
|
||||
{% include 'category_filter_sidebar_product_page', catalog_courses: catalog_courses %}
|
||||
</div>
|
||||
<div class="row np-flex-center">
|
||||
<div class="col-xs-12 col-sm-3">
|
||||
{% include 'category_filter_sidebar' %}
|
||||
<div class="col-xs-12 col-sm-3 np-hidden-mobile">
|
||||
{% include 'category_filter_sidebar_product_page', catalog_courses: catalog_courses %}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
{% include "courses_catalog" %}
|
||||
{% include "courses_catalog_product_education", catalog_courses: catalog_courses %}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
@ -34,6 +40,7 @@
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
padding: 64px 16px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.color-layer {
|
||||
@ -66,6 +73,44 @@
|
||||
background-color:#cc0033;
|
||||
}
|
||||
|
||||
.category-hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mobile-filter-link {
|
||||
margin-bottom: 32px;
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
color: #009999;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.mobile-filter-sidebar {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
background-color: #fff;
|
||||
height: 100vh;
|
||||
top: 0;
|
||||
padding: 60px 32px;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
transform: translateX(-300px);
|
||||
transition: transform 0.3s;
|
||||
z-index: 20;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.mobile-filter-sidebar.sidebar-open {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
.mobile-filter-sidebar i.fa-times {
|
||||
position: relative;
|
||||
float: right;
|
||||
top: -30px;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
@media (min-width:768px) {
|
||||
.subpage-intro {
|
||||
min-height:400px;
|
||||
@ -78,4 +123,41 @@
|
||||
font-size: 50px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
<script>
|
||||
/* convert values to same format */
|
||||
$('[data-category]').each(function(){
|
||||
$(this).attr('data-category', $(this).attr('data-category').replaceAll(' ', '').replaceAll('+', ' ').toLowerCase());
|
||||
});
|
||||
|
||||
/* add action to filters on click */
|
||||
$('.filter-element-category').click(function(){
|
||||
filterCatalogCourses($(this))
|
||||
});
|
||||
|
||||
function filterCatalogCourses(elmnt) {
|
||||
const selectedCategory = elmnt.data('category')
|
||||
|
||||
$('.category-selected').removeClass('category-selected');
|
||||
elmnt.addClass('category-selected');
|
||||
|
||||
if (selectedCategory == 'all') {
|
||||
$('.catalog-card').removeClass('category-hidden');
|
||||
} else {
|
||||
$('.catalog-card').removeClass('category-hidden');
|
||||
/* hides all cards without selected category if the 'All' wasn't selected */
|
||||
$('.catalog-card').each(function(index, card) {
|
||||
$(`.catalog-card:not([data-category*="${selectedCategory}"])`).addClass('category-hidden')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
$(".mobile-filter-link").click(function() {
|
||||
$(".mobile-filter-sidebar").addClass("sidebar-open")
|
||||
})
|
||||
|
||||
$(".mobile-filter-sidebar i.fa-times").click(function() {
|
||||
$(".mobile-filter-sidebar").removeClass("sidebar-open")
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user