update
This commit is contained in:
@ -1,194 +1,71 @@
|
||||
// marquee
|
||||
function handleMarquee() {
|
||||
const marquee = document.querySelectorAll('.marquee');
|
||||
let speed = 1;
|
||||
let lastScrollPos = 0;
|
||||
let timer;
|
||||
|
||||
|
||||
marquee.forEach(function (el) {
|
||||
// stop animation on mouseenter
|
||||
mouseEntered = false;
|
||||
document.querySelector('.inner').addEventListener('mouseenter', function () {
|
||||
mouseEntered = true;
|
||||
})
|
||||
document.querySelector('.inner').addEventListener('mouseleave', function () {
|
||||
mouseEntered = false
|
||||
})
|
||||
|
||||
const container = el.querySelector('.inner');
|
||||
const content = el.querySelector('.inner > *');
|
||||
//Get total width
|
||||
const elWidth = content.offsetWidth;
|
||||
|
||||
//Duplicate content
|
||||
let clone = content.cloneNode(true);
|
||||
container.appendChild(clone);
|
||||
|
||||
let progress = 1;
|
||||
|
||||
function loop() {
|
||||
if (mouseEntered === false) {
|
||||
progress = progress - speed;
|
||||
}
|
||||
if (progress <= elWidth * -1) {
|
||||
progress = 0;
|
||||
}
|
||||
container.style.transform = 'translateX(' + progress + 'px)';
|
||||
window.requestAnimationFrame(loop);
|
||||
$('body').on('click', '.remove-item', function (e) {
|
||||
e.preventDefault();
|
||||
let url = $(this).data('link');
|
||||
let id = $(this).data('id');
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
success: function (response) {
|
||||
location.reload();
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
loop();
|
||||
});
|
||||
|
||||
function handleSpeedClear() {
|
||||
speed = 4;
|
||||
}
|
||||
};
|
||||
|
||||
handleMarquee();
|
||||
|
||||
//DROPDOWN
|
||||
|
||||
const $dropdown = $(".dropdown");
|
||||
const $dropdownToggle = $(".dropdown-toggle");
|
||||
const $dropdownMenu = $(".dropdown-menu");
|
||||
const showClass = "show";
|
||||
|
||||
$(window).on("load resize", function () {
|
||||
if (this.matchMedia("(min-width: 768px)").matches) {
|
||||
$dropdown.hover(
|
||||
function () {
|
||||
const $this = $(this);
|
||||
$this.addClass(showClass);
|
||||
$this.find($dropdownToggle).attr("aria-expanded", "true");
|
||||
$this.find($dropdownMenu).addClass(showClass);
|
||||
},
|
||||
function () {
|
||||
const $this = $(this);
|
||||
$this.removeClass(showClass);
|
||||
$this.find($dropdownToggle).attr("aria-expanded", "false");
|
||||
$this.find($dropdownMenu).removeClass(showClass);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
$dropdown.off("mouseenter mouseleave");
|
||||
}
|
||||
});
|
||||
// SIDE NAV
|
||||
function openNav() {
|
||||
document.getElementById("mySidenav").style.width = "320px";
|
||||
}
|
||||
|
||||
function closeNav() {
|
||||
document.getElementById("mySidenav").style.width = "0";
|
||||
}
|
||||
$(document).ready(function () {
|
||||
$('textarea#body').summernote({
|
||||
height: '300px'
|
||||
});
|
||||
});
|
||||
// SCROLL TO TOP
|
||||
|
||||
mybutton = document.getElementById("myBtn");
|
||||
window.onscroll = function () {
|
||||
scrollFunction()
|
||||
};
|
||||
function scrollFunction() {
|
||||
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
|
||||
mybutton.style.display = "block";
|
||||
} else {
|
||||
mybutton.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
function topFunction() {
|
||||
document.body.scrollTop = 0;
|
||||
document.documentElement.scrollTop = 0;
|
||||
}
|
||||
|
||||
//FOR SIDENAV DROPDOWN
|
||||
$(".feat-btn").click(function () {
|
||||
$("nav ul .feat-show").toggleClass("show");
|
||||
$("nav ul .first").toggleClass("rotate");
|
||||
});
|
||||
$(".samachar-btn").click(function () {
|
||||
$("nav ul .samachar-show").toggleClass("show1");
|
||||
$("nav ul .second").toggleClass("rotate");
|
||||
});
|
||||
$(".jeewan-btn").click(function () {
|
||||
$("nav ul .jeewan-show").toggleClass("show2");
|
||||
$("nav ul .third").toggleClass("rotate");
|
||||
});
|
||||
$(".artha-btn").click(function () {
|
||||
$("nav ul .artha-show").toggleClass("show3");
|
||||
$("nav ul .fourth").toggleClass("rotate");
|
||||
});
|
||||
$(".suchana-btn").click(function () {
|
||||
$("nav ul .suchana-show").toggleClass("show4");
|
||||
$("nav ul .fifth").toggleClass("rotate");
|
||||
});
|
||||
$(".khelkud-btn").click(function () {
|
||||
$("nav ul .khelkud-show").toggleClass("show5");
|
||||
$("nav ul .sixth").toggleClass("rotate");
|
||||
});
|
||||
$(".kala-btn").click(function () {
|
||||
$("nav ul .kala-show").toggleClass("show6");
|
||||
$("nav ul .seventh").toggleClass("rotate");
|
||||
});
|
||||
$(".bichar-btn").click(function () {
|
||||
$("nav ul .bichar-show").toggleClass("show7");
|
||||
$("nav ul .eight").toggleClass("rotate");
|
||||
});
|
||||
|
||||
//SHOW HIDE FOR PRADESH
|
||||
$(document).ready(function() {
|
||||
$('#show-hidden-menu').click(function() {
|
||||
$('.hidden-menu').slideToggle("slow");
|
||||
// Alternative animation for example
|
||||
// slideToggle("fast");
|
||||
});
|
||||
});
|
||||
|
||||
//PHOTO GALLERY
|
||||
$('.owl-carousel.photo-gallery-carousel').owlCarousel({
|
||||
loop:true,
|
||||
margin:10,
|
||||
nav:false,
|
||||
autoplay: true,
|
||||
responsive:{
|
||||
0:{
|
||||
items:2
|
||||
},
|
||||
600:{
|
||||
items:3
|
||||
},
|
||||
1000:{
|
||||
items:4
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
//MATCH HEIGHT
|
||||
//ANTARBARTA TITLE
|
||||
$(document).ready(function(){
|
||||
$('.antarbartaTitle').matchHeight();
|
||||
})
|
||||
|
||||
//ANTARBARTA PARAGRAPH
|
||||
$(document).ready(function(){
|
||||
$('.antarbartaPara').matchHeight();
|
||||
})
|
||||
|
||||
//PRADESH
|
||||
$(document).ready(function(){
|
||||
$('.pradesh-image').matchHeight();
|
||||
})
|
||||
// FIXED NAVBAR
|
||||
$(window).scroll(function () {
|
||||
if ($(this).scrollTop() > 120) {
|
||||
$(".header-wrapper").addClass("fixed");
|
||||
} else {
|
||||
$(".header-wrapper").removeClass("fixed");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
//initialize ckeditor
|
||||
document.querySelectorAll('.ckeditor-classic').forEach(editor => {
|
||||
ClassicEditor
|
||||
.create(editor)
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// //initialize select2
|
||||
// $('.dropify').dropify();
|
||||
|
||||
// //initialize select2
|
||||
// $('.select2').select2();
|
||||
|
||||
// $('body').on('keyup', '.numeric', function () {
|
||||
// this.value = this.value.replace(/[^0-9\.]/g, '');
|
||||
// });
|
||||
|
||||
// $(".flatpickr-date").flatpickr({
|
||||
// enableTime: false,
|
||||
// dateFormat: "Y-m-d",
|
||||
// altInput: true,
|
||||
// altFormat: "Y-m-d",
|
||||
// defaultDate: "",
|
||||
// });
|
||||
|
||||
// $(".flatpickr-time").flatpickr({
|
||||
// enableTime: true,
|
||||
// noCalendar: false,
|
||||
// dateFormat: "H:i",
|
||||
// time_24hr: false,
|
||||
// });
|
||||
|
Reference in New Issue
Block a user