forked from LiveCarta/LiveCartaWP
educators 2
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -51,10 +51,48 @@ window.addEventListener('DOMContentLoaded', function(){
|
||||
}
|
||||
// home page scripts end
|
||||
|
||||
// catalog
|
||||
|
||||
const catalogSearchBtn = document.getElementById('catalogSearchBtn');
|
||||
const catalogSearchInput = document.getElementById('catalogSearchInput');
|
||||
const catalogSearchClear = document.getElementById('catalogSearchClear');
|
||||
|
||||
catalogSearchBtn.addEventListener('click', function(){
|
||||
let searchText = catalogSearchInput.value;
|
||||
top.location = 'https://app.livecarta.com/catalog?tab=books-tab&search=' + searchText;
|
||||
})
|
||||
|
||||
catalogSearchClear.addEventListener('click', function(){
|
||||
catalogSearchInput.value = '';
|
||||
})
|
||||
|
||||
catalogSearchInput.addEventListener('keyup', function(e){
|
||||
if (e.keyCode === 13) {
|
||||
let searchText = catalogSearchInput.value;
|
||||
top.location = 'https://app.livecarta.com/catalog?tab=books-tab&search=' + searchText;
|
||||
}
|
||||
})
|
||||
|
||||
// sliders
|
||||
|
||||
document.querySelectorAll('.splide').forEach(slider => {
|
||||
new Splide( slider, {
|
||||
if (document.querySelector('.catalog-slider')) {
|
||||
const catalogSlider = new Splide( '.catalog-slider', {
|
||||
type: 'loop',
|
||||
perPage: 5,
|
||||
perMove: 1,
|
||||
pagination: false,
|
||||
gap: 10,
|
||||
drag: 'free',
|
||||
breakpoints: {
|
||||
740: { perPage: 2 },
|
||||
1060: { perPage: 3 },
|
||||
1280: { perPage: 4 }
|
||||
}
|
||||
} ).mount();
|
||||
}
|
||||
|
||||
if (document.querySelector('.pc-slider .splide')) {
|
||||
const reviewsSlider = new Splide('.pc-slider .splide', {
|
||||
type: 'loop',
|
||||
perPage: 3,
|
||||
perMove: 1,
|
||||
@@ -66,7 +104,36 @@ window.addEventListener('DOMContentLoaded', function(){
|
||||
768: { perPage: 1, gap: 0 },
|
||||
}
|
||||
}).mount();
|
||||
});
|
||||
}
|
||||
|
||||
// scary animations
|
||||
|
||||
document.addEventListener('click', (event) => {
|
||||
if (event.target.closest('.set-icon') || event.classList.contains('set-icon')) {
|
||||
event.preventDefault();
|
||||
const elem = event.target.closest('.set-icon') || event.classList.contains('set-icon');
|
||||
if (elem.classList.contains('selected')) return;
|
||||
const states = {
|
||||
remix: { remix: 'selected', custom: 'rt', bundle: 'rb', copylink: 'lb', publish: 'lt' },
|
||||
custom: { remix: 'lt', custom: 'selected', bundle: 'rt', copylink: 'rb', publish: 'lb' },
|
||||
bundle: { remix: 'lb', custom: 'lt', bundle: 'selected', copylink: 'rt', publish: 'rb' },
|
||||
copylink: { remix: 'rb', custom: 'lb', bundle: 'lt', copylink: 'selected', publish: 'rt' },
|
||||
publish: { remix: 'rt', custom: 'rb', bundle: 'lb', copylink: 'lt', publish: 'selected' }
|
||||
}
|
||||
const state = states[elem.dataset.icon];
|
||||
const icons = document.querySelectorAll('.scary-icon');
|
||||
icons.forEach(icon => {
|
||||
const iconType = icon.dataset.icon;
|
||||
icon.className = 'scary-icon' + ' ' + state[iconType];
|
||||
})
|
||||
|
||||
const hoverBlocks = document.querySelectorAll('.hover-block');
|
||||
hoverBlocks.forEach(block => {
|
||||
block.classList.remove('selected');
|
||||
})
|
||||
elem.classList.add('selected')
|
||||
}
|
||||
})
|
||||
|
||||
// blog page
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ add_action('wp_enqueue_scripts', function () {
|
||||
// wp_enqueue_script('lawcarta-js', get_theme_file_uri('/assets/js/faqSearch.js'), ['custom-jquery'], null, true);
|
||||
// wp_enqueue_style('lawcarta-libs', get_theme_file_uri('/assets/css/libs.min.css'), [], '100');
|
||||
|
||||
wp_enqueue_style('lawcarta-style-index', get_theme_file_uri('/assets/css/styles-main-page.min.css'), null, '117');
|
||||
wp_enqueue_style('lawcarta-style-index', get_theme_file_uri('/assets/css/styles-main-page.min.css'), null, '118');
|
||||
|
||||
// if(is_front_page()){
|
||||
// wp_enqueue_style('lawcarta-style-index', get_theme_file_uri('/assets/css/main-page.min.css'),['lawcarta-libs'], '101');
|
||||
|
||||
Reference in New Issue
Block a user