0b177f92 by Jeff Balicki

learning-opportunities done

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent a2bd643b
......@@ -14571,6 +14571,9 @@ input[type=checkbox] {
display: block;
font-size: 18px;
}
.wpcf7 .contact-form input[type=submit]:hover {
background-color: #2C2C2C;
}
.no-bullets {
list-style: none;
......@@ -15152,11 +15155,140 @@ input[type=checkbox] {
content: "" !important;
}
.thumbnail {
label[for=quicksearch] {
font-size: 18px;
line-height: 24px;
color: #0484B8;
text-transform: uppercase;
}
#quicksearch {
width: 600px;
border-bottom: 1px solid #8E908F !important;
}
.filters {
border-bottom: 1px solid #FFA300 !important;
border-top: 1px solid #FFA300 !important;
padding: 10px 0px 10px 0px;
}
.filters .glyphicon-chevron-up::after {
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19.432' height='11.567' viewBox='0 0 19.432 11.567'%3E%3Cpath id='Path_1875' data-name='Path 1875' d='M395.235 274.525a1.19 1.19 0 0 0 1.681.063l9.188-8.526a1.19 1.19 0 0 0 0-1.744l-9.187-8.526a1.19 1.19 0 1 0-1.619 1.744l8.248 7.654-8.248 7.654a1.19 1.19 0 0 0-.063 1.681Z' transform='translate(274.905 -394.917) rotate(90)' fill='%230484b8'/%3E%3C/svg%3E");
}
.filters .glyphicon-chevron-down::after {
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19.631' height='11.905' viewBox='0 0 19.631 11.905'%3E%3Cpath id='Path_1875' data-name='Path 1875' d='M395.235 274.525a1.19 1.19 0 0 0 1.681.063l9.188-8.526a1.19 1.19 0 0 0 0-1.744l-9.187-8.526a1.19 1.19 0 1 0-1.619 1.744l8.248 7.654-8.248 7.654a1.19 1.19 0 0 0-.063 1.681Z' transform='matrix(-0.017 -1 1 -0.017 -248.34 411.22)' fill='%230484b8'/%3E%3C/svg%3E");
}
.filters #filter-more {
font-size: 18px;
line-height: 24px;
color: #0484B8;
text-transform: uppercase;
text-decoration: none;
padding: 10px 0px;
display: block;
}
.filters .filter-group {
display: none;
flex-direction: row;
justify-content: space-between;
margin-bottom: 20px;
}
.filters .filter-group .sort-button-group .btn, .filters .filter-group .sort-button-group .wpcf7 input[type=submit], .wpcf7 .filters .filter-group .sort-button-group input[type=submit], .filters .filter-group .sort-button-group .woocommerce-notices-wrapper .woocommerce-message a.button, .woocommerce-notices-wrapper .woocommerce-message .filters .filter-group .sort-button-group a.button, .filters .filter-group .sort-button-group .woocommerce-info a.button, .woocommerce-info .filters .filter-group .sort-button-group a.button {
border: 1px solid #0081BC;
}
.filters .filter-group.open {
display: flex;
}
.category-filter-group {
display: flex;
flex-direction: row;
}
.category-filter {
display: flex;
flex-direction: row;
font-size: 18px;
font-size: 1.125rem;
color: #515151;
margin: 0.25rem 0;
margin-right: 1rem;
}
.category-filter label {
padding-left: 30px;
padding-right: 10px;
white-space: nowrap;
cursor: pointer;
color: #2C2C2C;
}
.category-filter input[type=checkbox] {
display: inline-block;
margin-left: 30px;
margin-left: 0;
}
.category-filter input[type=checkbox]:focus + label {
outline: -webkit-focus-ring-color auto 1px;
}
.category-filter label:before {
content: "";
cursor: pointer;
height: 25px;
width: 25px;
padding: 2.5px;
display: inline-block;
position: absolute;
background: #FFF;
margin-left: -30px;
border: 2px solid #0081BC;
border-radius: 4px;
}
.category-filter input:checked + label:before {
background: #0081BC !important;
border: 2px solid #0081BC;
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15.078' height='18.352' viewBox='0 0 15.078 18.352'%3E%3Cpath id='Path_1871' data-name='Path 1871' d='M137.622 43.1l1.28 2.211 6.924-11.987a1.837 1.837 0 0 1 3.2 1.8l-8.5 14.722a1.931 1.931 0 0 1-3.259 0L134.48 44.9a1.812 1.812 0 1 1 3.142-1.8Z' transform='translate(-134.203 -32.392)' fill='%23fff' fill-rule='evenodd'/%3E%3C/svg%3E");
height: 25px;
width: 25px;
padding: 2px 4px;
background-position: 4px;
background-size: 22px;
background-repeat: no-repeat;
position: absolute;
cursor: pointer;
}
.category-filter input[type=checkbox] {
background-color: initial;
cursor: default;
-webkit-appearance: auto;
-moz-appearance: auto;
appearance: auto;
box-sizing: border-box;
margin: 3px 3px 3px 4px;
padding: initial;
border: initial;
position: relative;
}
.category-filter .sr-only {
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px);
padding: 0;
border: 0;
height: 1px;
width: 1px;
overflow: hidden;
}
.card {
background: var(--unnamed-color-ffffff) 0% 0% no-repeat padding-box;
background: #FFFFFF 0% 0% no-repeat padding-box;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1607843137);
border-radius: 0px;
border-width: 0px;
min-height: 526px;
}
.card .thumbnail {
line-height: 1.428571429;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
transition: all 0.2s ease-in-out;
display: inline-block;
max-width: 100%;
......@@ -15166,14 +15298,13 @@ input[type=checkbox] {
padding: 0;
margin: 0;
}
.thumbnail .ribbon {
background: #5cb85c;
.card .thumbnail .ribbon {
background: #E8D44B;
box-shadow: 0 1px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 1px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0 1px rgba(0, 0, 0, 0.2);
color: #fff;
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
color: #2C2C2C;
text-transform: uppercase;
position: absolute;
font-size: 14px;
left: -8px;
......@@ -15182,17 +15313,11 @@ input[type=checkbox] {
padding: 3px 10px;
z-index: 2;
border-radius: 0px;
font-weight: bold;
}
.thumbnail .ribbon.enrolled {
background: #428bca;
}
.thumbnail .ribbon:before {
.card .thumbnail .ribbon:before {
border: 4px solid transparent;
border-top: 4px solid #348c34;
border-right: 4px solid #348c34;
border-top: 4px solid #C3B241;
border-right: 4px solid #C3B241;
content: "";
position: absolute;
left: 0;
......@@ -15200,97 +15325,7 @@ input[type=checkbox] {
border-radius: 0px;
bottom: -8px;
}
.thumbnail .ribbon.enrolled:before {
border-top: 4px solid #357ebd;
border-right: 4px solid #357ebd;
}
.entry-title {
margin: 0 !important;
}
.entry-content {
margin-bottom: 10px;
padding: 0;
}
.items-wrapper_button {
margin: 5px 0 !important;
width: 100%;
}
.items-wrapper_button a {
text-decoration: none !important;
width: 100%;
}
.thumbnail a.btn-primary {
color: white;
}
.btn, .wpcf7 input[type=submit], .woocommerce-notices-wrapper .woocommerce-message a.button, .woocommerce-info a.button {
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 14px;
font-weight: normal;
line-height: 1.428571429;
text-align: center;
vertical-align: middle;
cursor: pointer;
border: 1px solid transparent;
border-radius: 4px;
white-space: nowrap;
-webkit-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
}
.btn:focus, .wpcf7 input[type=submit]:focus, .woocommerce-notices-wrapper .woocommerce-message a.button:focus, .woocommerce-info a.button:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.btn:hover, .wpcf7 input[type=submit]:hover, .woocommerce-notices-wrapper .woocommerce-message a.button:hover, .woocommerce-info a.button:hover, .learndash-course-grid .btn:focus, .learndash-course-grid .wpcf7 input[type=submit]:focus, .wpcf7 .learndash-course-grid input[type=submit]:focus, .learndash-course-grid .woocommerce-notices-wrapper .woocommerce-message a.button:focus, .woocommerce-notices-wrapper .woocommerce-message .learndash-course-grid a.button:focus, .learndash-course-grid .woocommerce-info a.button:focus, .woocommerce-info .learndash-course-grid a.button:focus {
color: #333333;
text-decoration: none;
}
.btn:active, .wpcf7 input[type=submit]:active, .woocommerce-notices-wrapper .woocommerce-message a.button:active, .woocommerce-info a.button:active {
outline: 0;
background-image: none;
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.btn-primary {
color: #ffffff;
background-color: #428bca;
border-color: #357ebd;
}
.btn-primary:hover, .learndash-course-grid .btn-primary:focus, .learndash-course-grid .btn-primary:active {
color: #ffffff;
background-color: #3276b1;
border-color: #285e8e;
}
.btn-primary:active {
background-image: none;
}
.btn-primary {
color: white;
text-decoration: none;
}
.btn-primary:hover {
color: white;
}
.thumbnail img {
.card .thumbnail img {
display: block;
max-width: 100%;
width: 100%;
......@@ -15300,43 +15335,63 @@ input[type=checkbox] {
box-shadow: none;
max-height: 400px;
}
.thumbnail a, .learndash-course-grid .thumbnail a:hover {
box-shadow: none;
.card .content {
padding: 15px;
display: flex;
flex-direction: column;
flex: 1;
}
.thumbnail .caption {
padding: 9px;
color: #333333;
.card .content .entry-title {
margin-top: 0px;
text-transform: uppercase;
text-align: center;
font-size: 18px;
line-height: 24px;
}
.thumbnail .caption a {
text-decoration: none !important;
.card .content .entry-content {
text-align: center;
font-size: 16px;
line-height: 24px;
}
.thumbnail .caption p {
float: none !important;
margin: 15px 0 0 !important;
width: 100% !important;
.card .content .btn, .card .content .wpcf7 input[type=submit], .wpcf7 .card .content input[type=submit], .card .content .woocommerce-notices-wrapper .woocommerce-message a.button, .woocommerce-notices-wrapper .woocommerce-message .card .content a.button, .card .content .woocommerce-info a.button, .woocommerce-info .card .content a.button {
display: flex;
align-self: center;
background-color: #0484B8;
color: #fff;
border-radius: 0px;
font-size: 18px;
margin-top: auto;
margin-bottom: 20px;
}
.card .content .btn:hover, .card .content .wpcf7 input[type=submit]:hover, .wpcf7 .card .content input[type=submit]:hover, .card .content .woocommerce-notices-wrapper .woocommerce-message a.button:hover, .woocommerce-notices-wrapper .woocommerce-message .card .content a.button:hover, .card .content .woocommerce-info a.button:hover, .woocommerce-info .card .content a.button:hover {
background-color: #2C2C2C;
}
.element-item {
.course-list .element-item {
position: relative;
float: left;
width: calc(33% - 30px);
width: calc(33.33% - 30px);
height: 600px;
margin: 5px;
margin: 15px;
padding: 10px;
}
.element-item > * {
margin: 0;
padding: 0;
.view-plan {
width: 100%;
text-align: center;
}
#load-more {
float: right;
margin: 5px;
.view-plan #load-more {
margin: auto;
background-color: #0484B8;
color: #fff;
border-radius: 0px;
font-size: 18px;
margin-top: auto;
margin-bottom: 20px;
text-transform: uppercase;
}
.view-plan #load-more:hover {
background-color: #2C2C2C;
}
.hidden {
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
......@@ -4,8 +4,8 @@
add_shortcode( 'promos', 'promos' );
function promos()
{
function promos(){
$custom_args = array(
'post_type' => 'promo',
'posts_per_page' => 3,
......@@ -13,10 +13,11 @@ function promos()
);
$custom_query = new \WP_Query($custom_args);
ob_start();
ob_start();
$uniqid = uniqid();
if ($custom_query->have_posts()):?>
<div class="carousel">
if ($custom_query->have_posts()):?>
<div class="carousel">
<div id="<?php echo $uniqid; ?>" class="promo-carousel carousel-items">
<div class='swiper-wrapper'>
<?php while ($custom_query->have_posts()): $custom_query->the_post();
......@@ -28,15 +29,15 @@ function promos()
<div class="swiper-button-next" data-id="<?= $uniqid; ?>"></div>
</div>
</div>
<?php endif; ?>
<?php wp_reset_query(); ?>
<?php $output = ob_get_clean();
return $output;
<?php endif;
wp_reset_query();
$output = ob_get_clean();
return $output;
}
function promos_slides($id)
{
function promos_slides($id){
ob_start();
$post = get_post($id);
$link = get_permalink($id);
......@@ -49,8 +50,8 @@ function promos_slides($id)
}
$text = str_replace(']]>', ']]&gt;', apply_filters( 'the_content', strip_shortcodes($post->post_content)));
$excerpt_length = apply_filters( 'excerpt_length', 40 );
$text = wp_trim_words( $text, $excerpt_length, ' ...' );
?>
$text = wp_trim_words( $text, $excerpt_length, ' ...' );?>
<div class="swiper-slide container">
<div class="promo row align-items-center">
<div class="col-lg-4 col-md-12">
......@@ -75,8 +76,8 @@ return $output;
add_shortcode('share-this', 'share_this');
function share_this($atts)
{
function share_this($atts){
$atts = shortcode_atts(array(
'post_id' => '',
), $atts, 'current-cover-articles');
......@@ -107,8 +108,8 @@ return ob_get_clean();
add_shortcode('course-list', 'course_list');
function course_list()
{
function course_list(){
$custom_args = array(
'post_type' => 'sfwd-courses',
'posts_per_page' => -1,
......@@ -119,58 +120,68 @@ function course_list()
ob_start();
$uniqid = uniqid();
if ($custom_query->have_posts()):?>
<p><input type="text" class="quicksearch" placeholder="Search" /></p>
<div class="button-group filters-button-group">
<button class="button is-checked" data-filter="*">Clear</button>
<button class="button" data-filter=".resilience-and-well-being">Resilience and Well-Being</button>
<button class="button" data-filter=".leadership-and-teamwork">Leadership and Teamwork</button>
<button class="button" data-filter=".clinical-skills">Clinical Skills</button>
<button class="button" data-filter=".coaching-and-mentoring">Coaching and Mentoring</button>
<div class="course-list">
<label for="quicksearch">Search programs:</label><input type="text" id="quicksearch" placeholder="" />
<div class="filters">
<a href="#" id="filter-more">FILTERS <span aria-hidden="true" class="glyphicon glyphicon-chevron-up"></span></a>
<div class="filter-group">
<div class="category-filter-group">
<?php $terms = get_terms( array( 'taxonomy' => 'ld_course_category' ,'parent' => 0) );
foreach($terms as $term){ ?>
<div class="category-filter"> <input id="<?php echo $term->slug ; ?>" value=".<?php echo $term->slug ; ?>" type="checkbox" class="sr-only"><label for="<?php echo $term->slug ; ?>"><?php echo $term->name ; ?></label></div>
<?php }; ?>
</div>
<div class="btn-group sort-button-group align-self-end">
<button class="btn btn-light" data-sort-direction="asc" data-sort-value="coursename" type="button">Name <span aria-hidden="true" class="glyphicon glyphicon-chevron-up"></span></button>
<button class="btn btn-light" data-sort-direction="asc" data-sort-value="coursedate" type="button">Date <span aria-hidden="true" class="glyphicon glyphicon-chevron-up"></span></button>
</div>
</div>
</div>
<div class="grid">
<?php while ($custom_query->have_posts()): $custom_query->the_post();
echo course_card(get_the_ID());
endwhile; ?>
</div>
</div>
</div>
<?php endif;
wp_reset_query();
$output = ob_get_clean();
return $output;
wp_reset_query();
$output = ob_get_clean();
return $output;
}
function course_card($id)
{
function course_card($id){
ob_start();
$post = get_post($id);
$link = get_permalink($id);
$text = str_replace(']]>', ']]&gt;', apply_filters( 'the_content', strip_shortcodes($post->post_content)));
$excerpt_length = apply_filters( 'excerpt_length', 40 );
$excerpt_length = apply_filters( 'excerpt_length', 20 );
$text = wp_trim_words( $text, $excerpt_length, ' ...' );
$categories = get_the_terms( $id, 'ld_course_category' );
$cat ="";
foreach( $categories as $category ) { $cat .= " ".$category->slug; }; ?>
$cat =""; foreach( $categories as $category ) { $cat .= " ".$category->slug; }; ?>
<div class="element-item <?php echo $cat; ?> " data-category="<?php echo $cat; ?>">
<article id="post-<?php echo $id; ?>" class="post post-<?php echo $id; ?> sfwd-courses type-sfwd-courses">
<div class="thumbnail"><div class="ribbon"><?php echo get_post_meta( $id, '_learndash_course_grid_custom_ribbon_text', true);?></div>
<div class="image">
<a href="<?php echo $link; ?>" rel="bookmark"> <?php echo get_the_post_thumbnail($id, 'full' ); ?></a>
</div>
</div>
<div class="content">
<h3 class="entry-title"><a href="<?php echo $link; ?>"><?php echo $post->post_title; ?></a></h3>
<div class="entry-content">
<p><?php echo $text; ?></p>
</div>
<div class="button">
<a role="button" href="<?php echo $link; ?>" rel="bookmark"><?php echo get_post_meta( $id, '_learndash_course_grid_custom_button_text', true);?></a>
</div>
</div>
<div class="card">
<div class="thumbnail"><div class="ribbon"><?php echo get_post_meta( $id, '_learndash_course_grid_custom_ribbon_text', true);?></div>
<div class="image">
<?php echo get_the_post_thumbnail($id, 'full' ); ?>
</div>
</div>
<div class="content">
<h3 class="entry-title"><?php echo $post->post_title; ?></h3>
<div class="entry-content">
<p><?php echo $text; ?></p>
</div>
<a class="btn" role="button" href="<?php echo get_permalink($id); ?>" rel="bookmark">LEARN MORE</a>
</div>
</div>
</article>
</div>
<?php
$output = ob_get_clean();
return $output;
$output = ob_get_clean();
return $output;
}
\ No newline at end of file
......
......@@ -17634,25 +17634,21 @@
var $grid = $('.grid').isotope({
itemSelector: '.element-item',
layoutMode: 'fitRows',
getSortData: {
coursename: '.name',
date: '[data-ticks]'
},
filter: function () {
return qsRegex ? $(this).text().match(qsRegex) : true;
var $this = $(this);
var filterText = qsRegex ? $(this).text().match(qsRegex) : true;
var buttonResult = filterValue ? $this.is(filterValue) : true;
return filterText && buttonResult;
}
});
var filterFns = {
// show if number is greater than 50
numberGreaterThan50: function () {
var number = $(this).find('.number').text();
return parseInt(number, 10) > 50;
},
// show if name ends with -ium
ium: function () {
var name = $(this).find('.name').text();
return name.match(/ium$/);
}
};
// use value of search field to filter
var $quicksearch = $('.quicksearch').keyup(debounce(function () {
var $quicksearch = $('#quicksearch').keyup(debounce(function () {
console.log($quicksearch.val());
qsRegex = new RegExp($quicksearch.val(), 'gi');
$grid.isotope();
}, 200));
......@@ -17672,24 +17668,65 @@
};
}
// bind filter button click
$('.filters-button-group').on('click', 'button', function () {
var filterValue = $(this).attr('data-filter');
// use filterFn if matches value
filterValue = filterFns[filterValue] || filterValue;
$grid.isotope({
filter: filterValue
// filter with selects and checkboxes
var $checkboxes = $('.category-filter input');
var filterValue;
$checkboxes.change(function () {
// map input values to an array
var inclusives = [];
// inclusive filters from checkboxes
$checkboxes.each(function (i, elem) {
// if checkbox, use value if checked
if (elem.checked) {
inclusives.push(elem.value);
}
});
});
// change is-checked class on buttons
$('.button-group').each(function (i, buttonGroup) {
var $buttonGroup = $(buttonGroup);
$buttonGroup.on('click', 'button', function () {
$buttonGroup.find('.is-checked').removeClass('is-checked');
$(this).addClass('is-checked');
// combine inclusive filters
filterValue = inclusives.length ? inclusives.join(', ') : '*';
$grid.isotope();
updateFilterCounts();
});
$('.sort-button-group').on('click', 'button', function () {
var sortValue = $(this).attr('data-sort-value');
var direction = $(this).attr('data-sort-direction');
var isAscending = direction == 'asc';
var newDirection = isAscending ? 'desc' : 'asc';
$grid.isotope({
sortBy: sortValue,
sortAscending: isAscending
});
$(this).attr('data-sort-direction', newDirection);
var span = $(this).find('.glyphicon');
span.toggleClass('glyphicon-chevron-up glyphicon-chevron-down');
});
function updateFilterCounts() {
var itemElems = $grid.isotope('getFilteredItemElements');
var count_items = $(itemElems).length;
if (count_items > counter) {
$("#load-more").hide();
} else {
$("#load-more").show();
}
if ($('.element-item').hasClass('hidden')) {
$('.element-item').removeClass('hidden');
}
var index = 0;
$(itemElems).each(function () {
if (index >= counter) {
$(this).addClass('hidden');
}
index++;
});
console.log('updateFilterCounts');
console.log(index);
if (index === 0) {
$("#load-more").hide();
} else {
$("#load-more").show();
}
$grid.isotope('layout');
}
//****************************
// Isotope Load more button
......@@ -17722,7 +17759,7 @@
}
//append load more button
$grid.after('<div class="viewPlan"><a href="#" id="load-more">Load More</a></div>');
$grid.after('<div class="view-plan"><a class="btn" href="#" id="load-more">LOAD MORE programs</a></div>');
//when load more button clicked
$(document).on("click", "#load-more", function (e) {
......@@ -17737,6 +17774,12 @@
counter = counter + initShow;
loadMore(counter);
});
$(document).on("click", "#filter-more", function (e) {
e.preventDefault();
$('.filter-group').toggleClass('open');
var span = $(this).find('.glyphicon');
span.toggleClass('glyphicon-chevron-up glyphicon-chevron-down');
});
});
// Add your custom JS here.
......
This diff could not be displayed because it is too large.
......@@ -173,5 +173,5 @@ function(t){!function(e,i){t.exports?t.exports=i(Hs.exports,Ys.exports):i(e.Isot
* https://isotope.metafizzy.co
* Copyright 2010-2018 Metafizzy
*/
function(t){!function(e,i){t.exports?t.exports=i(e,zs.exports,js.exports,Ws.exports,Bs.exports,Fs.exports,Hs.exports,Gs.exports,Vs.exports,qs.exports):e.Isotope=i(e,e.Outlayer,e.getSize,e.matchesSelector,e.fizzyUIUtils,e.Isotope.Item,e.Isotope.LayoutMode)}(window,(function(t,e,i,n,s,r,o){var a=t.jQuery;var l=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")};var c=e.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});c.Item=r,c.LayoutMode=o;var d=c.prototype;d._create=function(){for(var t in this.itemGUID=0,this._sorters={},this._getSorters(),e.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"],o.modes)this._initLayoutMode(t)},d.reloadItems=function(){this.itemGUID=0,e.prototype.reloadItems.call(this)},d._itemize=function(){var t=e.prototype._itemize.apply(this,arguments);for(var i=0;i<t.length;i++){t[i].id=this.itemGUID++}return this._updateItemsSortData(t),t},d._initLayoutMode=function(t){var e=o.modes[t];var i=this.options[t]||{};this.options[t]=e.options?s.extend(e.options,i):i,this.modes[t]=new e(this)},d.layout=function(){this._isLayoutInited||!this._getOption("initLayout")?this._layout():this.arrange()},d._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},d.arrange=function(t){this.option(t),this._getIsInstant();var e=this._filter(this.items);this.filteredItems=e.matches,this._bindArrangeComplete(),this._isInstant?this._noTransition(this._hideReveal,[e]):this._hideReveal(e),this._sort(),this._layout()},d._init=d.arrange,d._hideReveal=function(t){this.reveal(t.needReveal),this.hide(t.needHide)},d._getIsInstant=function(){var t=this._getOption("layoutInstant");var e=void 0!==t?t:!this._isLayoutInited;return this._isInstant=e,e},d._bindArrangeComplete=function(){var t,e,i;var n=this;function s(){t&&e&&i&&n.dispatchEvent("arrangeComplete",null,[n.filteredItems])}this.once("layoutComplete",(function(){t=!0,s()})),this.once("hideComplete",(function(){e=!0,s()})),this.once("revealComplete",(function(){i=!0,s()}))},d._filter=function(t){var e=this.options.filter;e=e||"*";var i=[];var n=[];var s=[];var r=this._getFilterTest(e);for(var o=0;o<t.length;o++){var a=t[o];if(!a.isIgnored){var l=r(a);l&&i.push(a),l&&a.isHidden?n.push(a):l||a.isHidden||s.push(a)}}return{matches:i,needReveal:n,needHide:s}},d._getFilterTest=function(t){return a&&this.options.isJQueryFiltering?function(e){return a(e.element).is(t)}:"function"==typeof t?function(e){return t(e.element)}:function(e){return n(e.element,t)}},d.updateSortData=function(t){var e;t?(t=s.makeArray(t),e=this.getItems(t)):e=this.items,this._getSorters(),this._updateItemsSortData(e)},d._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=u(i)}},d._updateItemsSortData=function(t){var e=t&&t.length;for(var i=0;e&&i<e;i++){t[i].updateSortData()}};var u=function(){function t(t){if("string"!=typeof t)return t;var i=l(t).split(" ");var n=i[0];var s=n.match(/^\[(.+)\]$/);var r=e(s&&s[1],n);var o=c.sortDataParsers[i[1]];return t=o?function(t){return t&&o(r(t))}:function(t){return t&&r(t)}}function e(t,e){return t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&i.textContent}}return t}();function p(t,e){return function(i,n){for(var s=0;s<t.length;s++){var r=t[s];var o=i.sortData[r];var a=n.sortData[r];if(o>a||o<a)return(o>a?1:-1)*((void 0!==e[r]?e[r]:e)?1:-1)}return 0}}c.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},d._sort=function(){if(this.options.sortBy){var t=s.makeArray(this.options.sortBy);this._getIsSameSortBy(t)||(this.sortHistory=t.concat(this.sortHistory));var e=p(this.sortHistory,this.options.sortAscending);this.filteredItems.sort(e)}},d._getIsSameSortBy=function(t){for(var e=0;e<t.length;e++)if(t[e]!=this.sortHistory[e])return!1;return!0},d._mode=function(){var t=this.options.layoutMode;var e=this.modes[t];if(!e)throw new Error("No layout mode: "+t);return e.options=this.options[t],e},d._resetLayout=function(){e.prototype._resetLayout.call(this),this._mode()._resetLayout()},d._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},d._manageStamp=function(t){this._mode()._manageStamp(t)},d._getContainerSize=function(){return this._mode()._getContainerSize()},d.needsResizeLayout=function(){return this._mode().needsResizeLayout()},d.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},d.prepended=function(t){var e=this._itemize(t);if(e.length){this._resetLayout(),this._manageStamps();var i=this._filterRevealAdded(e);this.layoutItems(this.filteredItems),this.filteredItems=i.concat(this.filteredItems),this.items=e.concat(this.items)}},d._filterRevealAdded=function(t){var e=this._filter(t);return this.hide(e.needHide),this.reveal(e.matches),this.layoutItems(e.matches,!0),e.matches},d.insert=function(t){var e=this.addItems(t);if(e.length){var i,n;var s=e.length;for(i=0;i<s;i++)n=e[i],this.element.appendChild(n.element);var r=this._filter(e).matches;for(i=0;i<s;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;i<s;i++)delete e[i].isLayoutInstant;this.reveal(r)}};var h=d.remove;return d.remove=function(t){t=s.makeArray(t);var e=this.getItems(t);h.call(this,t);var i=e&&e.length;for(var n=0;i&&n<i;n++){var r=e[n];s.removeFrom(this.filteredItems,r)}},d.shuffle=function(){for(var t=0;t<this.items.length;t++){this.items[t].sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},d._noTransition=function(t,e){var i=this.options.transitionDuration;this.options.transitionDuration=0;var n=t.apply(this,e);return this.options.transitionDuration=i,n},d.getFilteredItemElements=function(){return this.filteredItems.map((function(t){return t.element}))},c}))}(Ds),$s("isotope",Ds.exports,$),n.default(document).ready((function(t){var e;var i=t(".grid").isotope({itemSelector:".element-item",layoutMode:"fitRows",filter:function(){return!e||t(this).text().match(e)}});var n={numberGreaterThan50:function(){var e=t(this).find(".number").text();return parseInt(e,10)>50},ium:function(){return t(this).find(".name").text().match(/ium$/)}};var s=t(".quicksearch").keyup(r((function(){e=new RegExp(s.val(),"gi"),i.isotope()}),200));function r(t,e){var i;return e=e||100,function(){clearTimeout(i);var n=arguments;var s=this;function r(){t.apply(s,n)}i=setTimeout(r,e)}}t(".filters-button-group").on("click","button",(function(){var e=t(this).attr("data-filter");e=n[e]||e,i.isotope({filter:e})})),t(".button-group").each((function(e,i){var n=t(i);n.on("click","button",(function(){n.find(".is-checked").removeClass("is-checked"),t(this).addClass("is-checked")}))}));var o=3;var a=o;var l=i.data("isotope");function c(e){i.find(".hidden").removeClass("hidden");var n=l.filteredItems.slice(e,l.filteredItems.length).map((function(t){return console.log("hiddenElem"),console.log(t.element),t.element}));t(n).addClass("hidden"),i.isotope("layout"),0==n.length?t("#load-more").hide():t("#load-more").show()}console.log("iso"),console.log(l),console.log(l.elemCount),c(o),i.after('<div class="viewPlan"><a href="#" id="load-more">Load More</a></div>'),t(document).on("click","#load-more",(function(e){e.preventDefault(),t("#filters").data("clicked")&&(a=o,j$("#filters").data("clicked",!1)),c(a+=o)}))}));var Us=document.querySelector(".blur-image");document.addEventListener("DOMContentLoaded",(function(){if(!Us)return!1;var t=Us.getAttribute("data-src"),e=document.querySelector(".full-image"),i=new Image;i.src=t,i.onload=function(){e.classList.add("image-loaded"),e.style.backgroundImage="url("+t+")"}})),document.addEventListener("DOMContentLoaded",(function(){window.addEventListener("scroll",(function(){window.scrollY>57?document.getElementById("main-nav").classList.add("fixed-top"):document.getElementById("main-nav").classList.remove("fixed-top")}))}));let Qs=document.getElementById("btn-back-to-top");function Xs(){document.body.scrollTop>20||document.documentElement.scrollTop>20?Qs.style.display="block":Qs.style.display="none"}function Ks(){document.body.scrollTop=0,document.documentElement.scrollTop=0}window.onscroll=function(){Xs()},Qs.addEventListener("click",Ks),t.Alert=g,t.Button=v,t.Carousel=_,t.Collapse=C,t.Dropdown=$e,t.Modal=Be,t.Offcanvas=Re,t.Popover=qe,t.Scrollspy=Qe,t.Tab=Ke,t.Toast=Je,t.Tooltip=Ve,Object.defineProperty(t,"__esModule",{value:!0})}));
function(t){!function(e,i){t.exports?t.exports=i(e,zs.exports,js.exports,Ws.exports,Bs.exports,Fs.exports,Hs.exports,Gs.exports,Vs.exports,qs.exports):e.Isotope=i(e,e.Outlayer,e.getSize,e.matchesSelector,e.fizzyUIUtils,e.Isotope.Item,e.Isotope.LayoutMode)}(window,(function(t,e,i,n,s,r,o){var a=t.jQuery;var l=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")};var c=e.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});c.Item=r,c.LayoutMode=o;var d=c.prototype;d._create=function(){for(var t in this.itemGUID=0,this._sorters={},this._getSorters(),e.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"],o.modes)this._initLayoutMode(t)},d.reloadItems=function(){this.itemGUID=0,e.prototype.reloadItems.call(this)},d._itemize=function(){var t=e.prototype._itemize.apply(this,arguments);for(var i=0;i<t.length;i++){t[i].id=this.itemGUID++}return this._updateItemsSortData(t),t},d._initLayoutMode=function(t){var e=o.modes[t];var i=this.options[t]||{};this.options[t]=e.options?s.extend(e.options,i):i,this.modes[t]=new e(this)},d.layout=function(){this._isLayoutInited||!this._getOption("initLayout")?this._layout():this.arrange()},d._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},d.arrange=function(t){this.option(t),this._getIsInstant();var e=this._filter(this.items);this.filteredItems=e.matches,this._bindArrangeComplete(),this._isInstant?this._noTransition(this._hideReveal,[e]):this._hideReveal(e),this._sort(),this._layout()},d._init=d.arrange,d._hideReveal=function(t){this.reveal(t.needReveal),this.hide(t.needHide)},d._getIsInstant=function(){var t=this._getOption("layoutInstant");var e=void 0!==t?t:!this._isLayoutInited;return this._isInstant=e,e},d._bindArrangeComplete=function(){var t,e,i;var n=this;function s(){t&&e&&i&&n.dispatchEvent("arrangeComplete",null,[n.filteredItems])}this.once("layoutComplete",(function(){t=!0,s()})),this.once("hideComplete",(function(){e=!0,s()})),this.once("revealComplete",(function(){i=!0,s()}))},d._filter=function(t){var e=this.options.filter;e=e||"*";var i=[];var n=[];var s=[];var r=this._getFilterTest(e);for(var o=0;o<t.length;o++){var a=t[o];if(!a.isIgnored){var l=r(a);l&&i.push(a),l&&a.isHidden?n.push(a):l||a.isHidden||s.push(a)}}return{matches:i,needReveal:n,needHide:s}},d._getFilterTest=function(t){return a&&this.options.isJQueryFiltering?function(e){return a(e.element).is(t)}:"function"==typeof t?function(e){return t(e.element)}:function(e){return n(e.element,t)}},d.updateSortData=function(t){var e;t?(t=s.makeArray(t),e=this.getItems(t)):e=this.items,this._getSorters(),this._updateItemsSortData(e)},d._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=u(i)}},d._updateItemsSortData=function(t){var e=t&&t.length;for(var i=0;e&&i<e;i++){t[i].updateSortData()}};var u=function(){function t(t){if("string"!=typeof t)return t;var i=l(t).split(" ");var n=i[0];var s=n.match(/^\[(.+)\]$/);var r=e(s&&s[1],n);var o=c.sortDataParsers[i[1]];return t=o?function(t){return t&&o(r(t))}:function(t){return t&&r(t)}}function e(t,e){return t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&i.textContent}}return t}();function p(t,e){return function(i,n){for(var s=0;s<t.length;s++){var r=t[s];var o=i.sortData[r];var a=n.sortData[r];if(o>a||o<a)return(o>a?1:-1)*((void 0!==e[r]?e[r]:e)?1:-1)}return 0}}c.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},d._sort=function(){if(this.options.sortBy){var t=s.makeArray(this.options.sortBy);this._getIsSameSortBy(t)||(this.sortHistory=t.concat(this.sortHistory));var e=p(this.sortHistory,this.options.sortAscending);this.filteredItems.sort(e)}},d._getIsSameSortBy=function(t){for(var e=0;e<t.length;e++)if(t[e]!=this.sortHistory[e])return!1;return!0},d._mode=function(){var t=this.options.layoutMode;var e=this.modes[t];if(!e)throw new Error("No layout mode: "+t);return e.options=this.options[t],e},d._resetLayout=function(){e.prototype._resetLayout.call(this),this._mode()._resetLayout()},d._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},d._manageStamp=function(t){this._mode()._manageStamp(t)},d._getContainerSize=function(){return this._mode()._getContainerSize()},d.needsResizeLayout=function(){return this._mode().needsResizeLayout()},d.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},d.prepended=function(t){var e=this._itemize(t);if(e.length){this._resetLayout(),this._manageStamps();var i=this._filterRevealAdded(e);this.layoutItems(this.filteredItems),this.filteredItems=i.concat(this.filteredItems),this.items=e.concat(this.items)}},d._filterRevealAdded=function(t){var e=this._filter(t);return this.hide(e.needHide),this.reveal(e.matches),this.layoutItems(e.matches,!0),e.matches},d.insert=function(t){var e=this.addItems(t);if(e.length){var i,n;var s=e.length;for(i=0;i<s;i++)n=e[i],this.element.appendChild(n.element);var r=this._filter(e).matches;for(i=0;i<s;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;i<s;i++)delete e[i].isLayoutInstant;this.reveal(r)}};var h=d.remove;return d.remove=function(t){t=s.makeArray(t);var e=this.getItems(t);h.call(this,t);var i=e&&e.length;for(var n=0;i&&n<i;n++){var r=e[n];s.removeFrom(this.filteredItems,r)}},d.shuffle=function(){for(var t=0;t<this.items.length;t++){this.items[t].sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},d._noTransition=function(t,e){var i=this.options.transitionDuration;this.options.transitionDuration=0;var n=t.apply(this,e);return this.options.transitionDuration=i,n},d.getFilteredItemElements=function(){return this.filteredItems.map((function(t){return t.element}))},c}))}(Ds),$s("isotope",Ds.exports,$),n.default(document).ready((function(t){var e;var i=t(".grid").isotope({itemSelector:".element-item",layoutMode:"fitRows",getSortData:{coursename:".name",date:"[data-ticks]"},filter:function(){var i=t(this);var n=!e||t(this).text().match(e);var s=!o||i.is(o);return n&&s}});var n=t("#quicksearch").keyup(s((function(){console.log(n.val()),e=new RegExp(n.val(),"gi"),i.isotope()}),200));function s(t,e){var i;return e=e||100,function(){clearTimeout(i);var n=arguments;var s=this;function r(){t.apply(s,n)}i=setTimeout(r,e)}}var r=t(".category-filter input");var o;function a(){var e=i.isotope("getFilteredItemElements");t(e).length>c?t("#load-more").hide():t("#load-more").show(),t(".element-item").hasClass("hidden")&&t(".element-item").removeClass("hidden");var n=0;t(e).each((function(){n>=c&&t(this).addClass("hidden"),n++})),console.log("updateFilterCounts"),console.log(n),0===n?t("#load-more").hide():t("#load-more").show(),i.isotope("layout")}r.change((function(){var t=[];r.each((function(e,i){i.checked&&t.push(i.value)})),o=t.length?t.join(", "):"*",i.isotope(),a()})),t(".sort-button-group").on("click","button",(function(){var e=t(this).attr("data-sort-value");var n="asc"==t(this).attr("data-sort-direction");var s=n?"desc":"asc";i.isotope({sortBy:e,sortAscending:n}),t(this).attr("data-sort-direction",s),t(this).find(".glyphicon").toggleClass("glyphicon-chevron-up glyphicon-chevron-down")}));var l=3;var c=l;var d=i.data("isotope");function u(e){i.find(".hidden").removeClass("hidden");var n=d.filteredItems.slice(e,d.filteredItems.length).map((function(t){return console.log("hiddenElem"),console.log(t.element),t.element}));t(n).addClass("hidden"),i.isotope("layout"),0==n.length?t("#load-more").hide():t("#load-more").show()}console.log("iso"),console.log(d),console.log(d.elemCount),u(l),i.after('<div class="view-plan"><a class="btn" href="#" id="load-more">LOAD MORE programs</a></div>'),t(document).on("click","#load-more",(function(e){e.preventDefault(),t("#filters").data("clicked")&&(c=l,j$("#filters").data("clicked",!1)),u(c+=l)})),t(document).on("click","#filter-more",(function(e){e.preventDefault(),t(".filter-group").toggleClass("open"),t(this).find(".glyphicon").toggleClass("glyphicon-chevron-up glyphicon-chevron-down")}))}));var Us=document.querySelector(".blur-image");document.addEventListener("DOMContentLoaded",(function(){if(!Us)return!1;var t=Us.getAttribute("data-src"),e=document.querySelector(".full-image"),i=new Image;i.src=t,i.onload=function(){e.classList.add("image-loaded"),e.style.backgroundImage="url("+t+")"}})),document.addEventListener("DOMContentLoaded",(function(){window.addEventListener("scroll",(function(){window.scrollY>57?document.getElementById("main-nav").classList.add("fixed-top"):document.getElementById("main-nav").classList.remove("fixed-top")}))}));let Qs=document.getElementById("btn-back-to-top");function Xs(){document.body.scrollTop>20||document.documentElement.scrollTop>20?Qs.style.display="block":Qs.style.display="none"}function Ks(){document.body.scrollTop=0,document.documentElement.scrollTop=0}window.onscroll=function(){Xs()},Qs.addEventListener("click",Ks),t.Alert=g,t.Button=v,t.Carousel=_,t.Collapse=C,t.Dropdown=$e,t.Modal=Be,t.Offcanvas=Re,t.Popover=qe,t.Scrollspy=Qe,t.Tab=Ke,t.Toast=Je,t.Tooltip=Ve,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=child-theme.min.js.map
\ No newline at end of file
......
This diff could not be displayed because it is too large.
......@@ -2,8 +2,6 @@ import jQuery from 'jquery';
import jQueryBridget from 'jquery-bridget';
import Isotope from "isotope-layout";
jQueryBridget( 'isotope', Isotope, $ );
jQuery( document ).ready(function($) {
......@@ -15,27 +13,23 @@ var qsRegex;
var $grid = $('.grid').isotope({
itemSelector: '.element-item',
layoutMode: 'fitRows',
getSortData: {
coursename: '.name',
date: '[data-ticks]',
},
filter: function() {
return qsRegex ? $(this).text().match( qsRegex ) : true;
var $this = $(this);
var filterText = qsRegex ? $(this).text().match( qsRegex ) : true;
var buttonResult = filterValue ? $this.is( filterValue ) : true;
return filterText && buttonResult;
}
});
var filterFns = {
// show if number is greater than 50
numberGreaterThan50: function() {
var number = $(this).find('.number').text();
return parseInt( number, 10 ) > 50;
},
// show if name ends with -ium
ium: function() {
var name = $(this).find('.name').text();
return name.match( /ium$/ );
}
};
// use value of search field to filter
var $quicksearch = $('.quicksearch').keyup( debounce( function() {
var $quicksearch = $('#quicksearch').keyup( debounce( function() {
console.log($quicksearch.val());
qsRegex = new RegExp( $quicksearch.val(), 'gi' );
$grid.isotope();
}, 200 ) );
......@@ -56,80 +50,141 @@ function debounce( fn, threshold ) {
}
// filter with selects and checkboxes
var $checkboxes = $('.category-filter input');
var filterValue;
$checkboxes.change( function() {
// map input values to an array
var inclusives = [];
// inclusive filters from checkboxes
$checkboxes.each( function( i, elem ) {
// if checkbox, use value if checked
if ( elem.checked ) {
inclusives.push( elem.value );
}
});
// bind filter button click
$('.filters-button-group').on( 'click', 'button', function() {
var filterValue = $( this ).attr('data-filter');
// use filterFn if matches value
filterValue = filterFns[ filterValue ] || filterValue;
$grid.isotope({ filter: filterValue });
// combine inclusive filters
filterValue = inclusives.length ? inclusives.join(', ') : '*';
$grid.isotope();
updateFilterCounts();
});
// change is-checked class on buttons
$('.button-group').each( function( i, buttonGroup ) {
var $buttonGroup = $( buttonGroup );
$buttonGroup.on( 'click', 'button', function() {
$buttonGroup.find('.is-checked').removeClass('is-checked');
$( this ).addClass('is-checked');
});
$('.sort-button-group').on( 'click', 'button', function() {
var sortValue = $(this).attr('data-sort-value');
var direction = $(this).attr('data-sort-direction');
var isAscending = (direction == 'asc');
var newDirection = (isAscending) ? 'desc' : 'asc';
$grid.isotope({ sortBy: sortValue, sortAscending: isAscending });
$(this).attr('data-sort-direction', newDirection);
var span = $(this).find('.glyphicon');
span.toggleClass('glyphicon-chevron-up glyphicon-chevron-down');
});
function updateFilterCounts() {
var itemElems = $grid.isotope('getFilteredItemElements');
var count_items = $(itemElems).length;
if (count_items > counter) {
$("#load-more").hide();
}else {
$("#load-more").show();
}
if ($('.element-item').hasClass('hidden')) {
$('.element-item').removeClass('hidden');
}
var index = 0;
$(itemElems).each(function () {
if (index >= counter) {
$(this).addClass('hidden');
}
index++;
});
console.log('updateFilterCounts');
console.log(index);
if(index === 0){
$("#load-more").hide();
}else{
$("#load-more").show();
}
$grid.isotope('layout');
}
//****************************
// Isotope Load more button
//****************************
var initShow = 3; //number of images loaded on init & onclick load more button
var counter = initShow; //counter for load more button
var iso = $grid.data('isotope'); // get Isotope instance
console.log('iso');
console.log(iso);
console.log(iso.elemCount);
loadMore(initShow); //execute function onload
function loadMore(toShow) {
$grid.find(".hidden").removeClass("hidden");
var hiddenElems = iso.filteredItems.slice(toShow, iso.filteredItems.length).map(function(item) {
console.log('hiddenElem');
console.log(item.element);
return item.element;
});
$(hiddenElems).addClass('hidden');
$grid.isotope('layout');
//when no more to load, hide show more button
if (hiddenElems.length == 0) {
$("#load-more").hide();
}
else {
$("#load-more").show();
};
}
//append load more button
$grid.after('<div class="viewPlan"><a href="#" id="load-more">Load More</a></div>');
//when load more button clicked
$(document).on("click", "#load-more", function(e) {
e.preventDefault();
if ($('#filters').data('clicked')) {
//when filter button clicked, set initial value for counter
counter = initShow;
j$('#filters').data('clicked', false);
} else {
counter = counter;
};
counter = counter + initShow;
loadMore(counter);
});
//****************************
// Isotope Load more button
//****************************
var initShow = 3; //number of images loaded on init & onclick load more button
var counter = initShow; //counter for load more button
var iso = $grid.data('isotope'); // get Isotope instance
console.log('iso');
console.log(iso);
console.log(iso.elemCount);
loadMore(initShow); //execute function onload
function loadMore(toShow) {
$grid.find(".hidden").removeClass("hidden");
var hiddenElems = iso.filteredItems.slice(toShow, iso.filteredItems.length).map(function(item) {
console.log('hiddenElem');
console.log(item.element);
return item.element;
});
$(hiddenElems).addClass('hidden');
$grid.isotope('layout');
//when no more to load, hide show more button
if (hiddenElems.length == 0) {
$("#load-more").hide();
} else {
$("#load-more").show();
};
}
//append load more button
$grid.after('<div class="view-plan"><a class="btn" href="#" id="load-more">LOAD MORE programs</a></div>');
//when load more button clicked
$(document).on("click", "#load-more", function(e) {
e.preventDefault();
if ($('#filters').data('clicked')) {
//when filter button clicked, set initial value for counter
counter = initShow;
j$('#filters').data('clicked', false);
} else {
counter = counter;
};
counter = counter + initShow;
loadMore(counter);
});
$(document).on("click", "#filter-more", function(e) {
e.preventDefault();
$('.filter-group').toggleClass('open');
var span = $(this).find('.glyphicon');
span.toggleClass('glyphicon-chevron-up glyphicon-chevron-down');
});
});
......
......@@ -108,6 +108,9 @@ max-width: 100% !important;
font-size: 18px;
}
input[type=submit]:hover{
background-color: #2C2C2C;
}
}
}
......
.thumbnail{
line-height:1.428571429;
background-color:#ffffff;
border:1px solid #dddddd;
border-radius:4px;
-webkit-transition:all 0.2s ease-in-out;
transition:all 0.2s ease-in-out;
display:inline-block;
max-width:100%;
height:auto;
display:block;
position:relative;
padding:0;
margin:0;
label[for=quicksearch]{
font-size: 18px;
line-height: 24px;
color: #0484B8;
text-transform: uppercase;
}
.thumbnail .ribbon{
background:#5cb85c;
box-shadow:0 1px rgba(0,0,0,0.2);
-moz-box-shadow:0 1px rgba(0,0,0,0.2);
-webkit-box-shadow:0 1px rgba(0,0,0,0.2);
color:#fff;
text-shadow:0 1px rgba(0,0,0,0.3);
position:absolute;
font-size:14px;
left:-8px;
right: unset;
top:10px;
padding:3px 10px;
z-index:2;
border-radius: 0px;
font-weight:bold;
#quicksearch{
width: 600px;
border-bottom:1px solid #8E908F !important;
}
.thumbnail .ribbon.enrolled{
background:#428bca;
}
.thumbnail .ribbon:before{
border:4px solid transparent;
border-top:4px solid #348c34;
border-right:4px solid #348c34;
content:"";
position:absolute;
left:0;
right: unset;
border-radius: 0px;
bottom:-8px;
}
.thumbnail .ribbon.enrolled:before{
border-top:4px solid #357ebd;
border-right:4px solid #357ebd;
}
.entry-title{
margin:0!important;
}
.entry-content{
margin-bottom:10px;
padding:0;
}
.items-wrapper_button{
margin:5px 0!important;
width:100%;
}
.items-wrapper_button a{
text-decoration:none!important;
width:100%;
}
.thumbnail a.btn-primary{
color:white;
}
.btn{
display:inline-block;
padding:6px 12px;
margin-bottom:0;
font-size:14px;
font-weight:normal;
line-height:1.428571429;
text-align:center;
vertical-align:middle;
cursor:pointer;
border:1px solid transparent;
border-radius:4px;
white-space:nowrap;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
-o-user-select:none;
user-select:none;
}
.btn:focus{
outline:thin dotted #333;
outline:5px auto -webkit-focus-ring-color;
outline-offset:-2px;
}
.btn:hover,.learndash-course-grid .btn:focus{
color:#333333;
text-decoration:none;
}
.btn:active{
outline:0;
background-image:none;
-webkit-box-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.btn-primary{
color:#ffffff;
background-color:#428bca;
border-color:#357ebd;
}
.btn-primary:hover,.learndash-course-grid .btn-primary:focus,.learndash-course-grid .btn-primary:active{
color:#ffffff;
background-color:#3276b1;
border-color:#285e8e;
}
.btn-primary:active{
background-image:none;
}
.btn-primary{
color:white;
text-decoration:none;
}
.btn-primary:hover{
color:white;
}
.thumbnail img{
display:block;
max-width:100%;
width:100%;
height:auto;
margin-left:auto;
margin-right:auto;
box-shadow:none;
max-height: 400px;
}
.thumbnail a,.learndash-course-grid .thumbnail a:hover{
box-shadow:none;
}
.thumbnail .caption{
padding:9px;
color:#333333;
.filters{
border-bottom:1px solid #FFA300 !important;
border-top:1px solid #FFA300 !important;
padding: 10px 0px 10px 0px;
.glyphicon-chevron-up::after{
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19.432' height='11.567' viewBox='0 0 19.432 11.567'%3E%3Cpath id='Path_1875' data-name='Path 1875' d='M395.235 274.525a1.19 1.19 0 0 0 1.681.063l9.188-8.526a1.19 1.19 0 0 0 0-1.744l-9.187-8.526a1.19 1.19 0 1 0-1.619 1.744l8.248 7.654-8.248 7.654a1.19 1.19 0 0 0-.063 1.681Z' transform='translate(274.905 -394.917) rotate(90)' fill='%230484b8'/%3E%3C/svg%3E");
}
.glyphicon-chevron-down::after{
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19.631' height='11.905' viewBox='0 0 19.631 11.905'%3E%3Cpath id='Path_1875' data-name='Path 1875' d='M395.235 274.525a1.19 1.19 0 0 0 1.681.063l9.188-8.526a1.19 1.19 0 0 0 0-1.744l-9.187-8.526a1.19 1.19 0 1 0-1.619 1.744l8.248 7.654-8.248 7.654a1.19 1.19 0 0 0-.063 1.681Z' transform='matrix(-0.017 -1 1 -0.017 -248.34 411.22)' fill='%230484b8'/%3E%3C/svg%3E");
}
#filter-more{
font-size: 18px;
line-height: 24px;
color: #0484B8;
text-transform: uppercase;
text-decoration: none;
padding: 10px 0px;
display: block;
}
.filter-group{
display:none;
flex-direction: row ;
justify-content: space-between;
margin-bottom: 20px;
.sort-button-group {
.btn{
border:1px solid #0081BC;
}
}
}
.filter-group.open{
display:flex;
}
}
.thumbnail .caption a{
text-decoration:none!important;
.category-filter-group{
display:flex;
flex-direction: row ;
}
.thumbnail .caption p{
float:none!important;
margin:15px 0 0!important;
width:100%!important;
.category-filter{
display:flex;
flex-direction: row ;
font-size:18px;
font-size:1.125rem;
color:#515151;
margin:.25rem 0;
margin-right:1rem;
label{
padding-left:30px;
padding-right:10px;
white-space:nowrap;
cursor:pointer;
color: #2C2C2C;
}
input[type=checkbox]{
display:inline-block;
margin-left:30px;
margin-left:0;
}
input[type=checkbox]:focus+label{
outline:-webkit-focus-ring-color auto 1px;
}
label:before{
content:'';
cursor:pointer;
height:25px;
width:25px;
padding:2.5px;
display:inline-block;
position:absolute;
background:#FFF;
margin-left:-30px;
border:2px solid #0081BC;
border-radius: 4px;
}
input:checked+label:before{
background:#0081BC !important;
border:2px solid #0081BC;
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15.078' height='18.352' viewBox='0 0 15.078 18.352'%3E%3Cpath id='Path_1871' data-name='Path 1871' d='M137.622 43.1l1.28 2.211 6.924-11.987a1.837 1.837 0 0 1 3.2 1.8l-8.5 14.722a1.931 1.931 0 0 1-3.259 0L134.48 44.9a1.812 1.812 0 1 1 3.142-1.8Z' transform='translate(-134.203 -32.392)' fill='%23fff' fill-rule='evenodd'/%3E%3C/svg%3E");
height:25px;
width:25px;
padding: 2px 4px;
background-position:4px;
background-size:22px;
background-repeat:no-repeat;
position:absolute;
cursor:pointer;
}
input[type=checkbox]{
background-color:initial;
cursor:default;
-webkit-appearance:auto;
-moz-appearance:auto;
appearance:auto;
-webkit-box-sizing:border-box;
box-sizing:border-box;
margin:3px 3px 3px 4px;
padding:initial;
border:initial;
position:relative;
}
.sr-only{
position: absolute !important;
clip:rect(1px,1px,1px,1px);
padding:0;
border:0;
height:1px;
width:1px;
overflow:hidden;
}
}
.element-item {
position: relative;
float: left;
width: calc(33% - 30px);
height: 600px;
margin: 5px;
padding: 10px;
.card{
background: var(--unnamed-color-ffffff) 0% 0% no-repeat padding-box;
background: #FFFFFF 0% 0% no-repeat padding-box;
box-shadow: 0px 3px 6px #00000029;
border-radius: 0px;
border-width: 0px;
min-height: 526px;
.thumbnail{
line-height:1.428571429;
background-color:#ffffff;
border:1px solid #dddddd;
-webkit-transition:all 0.2s ease-in-out;
transition:all 0.2s ease-in-out;
display:inline-block;
max-width:100%;
height:auto;
display:block;
position:relative;
padding:0;
margin:0;
.ribbon{
background:#E8D44B;
box-shadow:0 1px rgba(0,0,0,0.2);
-moz-box-shadow:0 1px rgba(0,0,0,0.2);
-webkit-box-shadow:0 1px rgba(0,0,0,0.2);
color:#2C2C2C;
text-transform: uppercase;
position:absolute;
font-size:14px;
left:-8px;
right: unset;
top:10px;
padding:3px 10px;
z-index:2;
border-radius: 0px;
}
.ribbon:before{
border:4px solid transparent;
border-top:4px solid #C3B241;
border-right:4px solid #C3B241;
content:"";
position:absolute;
left:0;
right: unset;
border-radius: 0px;
bottom:-8px;
}
img{
display:block;
max-width:100%;
width:100%;
height:auto;
margin-left:auto;
margin-right:auto;
box-shadow:none;
max-height: 400px;
}
}
.content{
padding: 15px;
display: flex;
flex-direction: column;
flex: 1;
.entry-title{
margin-top: 0px;
text-transform: uppercase;
text-align: center;
font-size: 18px;
line-height: 24px;
}
.entry-content{
text-align: center;
font-size: 16px;
line-height: 24px;
}
.btn{
display: flex;
align-self:center;
background-color: #0484B8;
color: #fff;
border-radius: 0px;
font-size: 18px;
margin-top: auto;
margin-bottom: 20px;
}
.btn:hover{
background-color: #2C2C2C;
}
}
}
.element-item > * {
margin: 0;
padding: 0;
.course-list{
.element-item {
position: relative;
float: left;
width: calc(33.33% - 30px);
height: 600px;
margin: 15px;
padding: 10px;
}
}
#load-more{
float:right;
margin:5px;
.view-plan{
width: 100%;
text-align: center;
#load-more{
margin: auto;
background-color: #0484B8;
color: #fff;
border-radius: 0px;
font-size: 18px;
margin-top: auto;
margin-bottom: 20px;
text-transform: uppercase;
}
#load-more:hover{
background-color: #2C2C2C;
}
}
.hidden{
visibility:hidden;
width:0px!important;
height:0px!important;
margin:0px!important;
padding:0px!important;
display:none;
visibility:hidden;
width:0px!important;
height:0px!important;
margin:0px!important;
padding:0px!important;
display:none;
}
\ No newline at end of file
......