feat: implement homepage layout

This commit is contained in:
2026-08-15 14:05:11 +03:30
parent b7505380d9
commit 002327d213
265 changed files with 26322 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
$(function () {
"use strict";
// apex chart
var options = {
series: [{
name: 'سری اول',
data: [31, 40, 28, 51, 42, 60, 50]
}, {
name: 'سری دوم',
data: [11, 32, 45, 32, 34, 52, 41]
}],
chart: {
height: 350,
type: 'area'
},
dataLabels: {
enabled: false
},
stroke: {
curve: 'smooth'
},
xaxis: {
type: 'datetime',
categories: ["2018-09-19T00:00:00.000Z", "2018-09-19T01:30:00.000Z", "2018-09-19T02:30:00.000Z", "2018-09-19T03:30:00.000Z", "2018-09-19T04:30:00.000Z", "2018-09-19T05:30:00.000Z", "2018-09-19T06:30:00.000Z"]
},
tooltip: {
x: {
format: 'dd/MM/yy HH:mm'
},
},
};
var chart = new ApexCharts(document.querySelector("#chart"), options);
chart.render();
});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+51
View File
@@ -0,0 +1,51 @@
/*-------------------------
Ajax Contact Form
---------------------------*/
$(function() {
// Get the form.
var form = $('#contact-form');
// Get the messages div.
var formMessages = $('.form-messege');
// Set up an event listener for the contact form.
$(form).submit(function(e) {
// Stop the browser from submitting the form.
e.preventDefault();
// Serialize the form data.
var formData = $(form).serialize();
// Submit the form using AJAX.
$.ajax({
type: 'POST',
url: $(form).attr('action'),
data: formData
})
.done(function(response) {
// Make sure that the formMessages div has the 'success' class.
$(formMessages).removeClass('error');
$(formMessages).addClass('success');
// Set the message text.
$(formMessages).text(response);
// Clear the form.
$('#contact-form input,#contact-form textarea').val('');
})
.fail(function(data) {
// Make sure that the formMessages div has the 'error' class.
$(formMessages).removeClass('success');
$(formMessages).addClass('error');
// Set the message text.
if (data.responseText !== '') {
$(formMessages).text(data.responseText);
} else {
$(formMessages).text('Oops! An error occured and your message could not be sent.');
}
});
});
});
+22
View File
@@ -0,0 +1,22 @@
/*!
* The Final Countdown for jQuery v2.2.0 (http://hilios.github.io/jQuery.countdown/)
* Copyright (c) 2016 Edson Hilios
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";function b(a){if(a instanceof Date)return a;if(String(a).match(g))return String(a).match(/^[0-9]*$/)&&(a=Number(a)),String(a).match(/\-/)&&(a=String(a).replace(/\-/g,"/")),new Date(a);throw new Error("Couldn't cast `"+a+"` to a date object.")}function c(a){var b=a.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(b)}function d(a){return function(b){var d=b.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(d)for(var f=0,g=d.length;f<g;++f){var h=d[f].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),j=c(h[0]),k=h[1]||"",l=h[3]||"",m=null;h=h[2],i.hasOwnProperty(h)&&(m=i[h],m=Number(a[m])),null!==m&&("!"===k&&(m=e(l,m)),""===k&&m<10&&(m="0"+m.toString()),b=b.replace(j,m.toString()))}return b=b.replace(/%%/,"%")}}function e(a,b){var c="s",d="";return a&&(a=a.replace(/(:|;|\s)/gi,"").split(/\,/),1===a.length?c=a[0]:(d=a[0],c=a[1])),Math.abs(b)>1?c:d}var f=[],g=[],h={precision:100,elapse:!1,defer:!1};g.push(/^[0-9]*$/.source),g.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g=new RegExp(g.join("|"));var i={Y:"years",m:"months",n:"daysToMonth",d:"daysToWeek",w:"weeks",W:"weeksToMonth",H:"hours",M:"minutes",S:"seconds",D:"totalDays",I:"totalHours",N:"totalMinutes",T:"totalSeconds"},j=function(b,c,d){this.el=b,this.$el=a(b),this.interval=null,this.offset={},this.options=a.extend({},h),this.firstTick=!0,this.instanceNumber=f.length,f.push(this),this.$el.data("countdown-instance",this.instanceNumber),d&&("function"==typeof d?(this.$el.on("update.countdown",d),this.$el.on("stoped.countdown",d),this.$el.on("finish.countdown",d)):this.options=a.extend({},h,d)),this.setFinalDate(c),this.options.defer===!1&&this.start()};a.extend(j.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var a=this;this.update(),this.interval=setInterval(function(){a.update.call(a)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),f[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(a){this.finalDate=b(a)},update:function(){if(0===this.$el.closest("html").length)return void this.remove();var a,b=new Date;return a=this.finalDate.getTime()-b.getTime(),a=Math.ceil(a/1e3),a=!this.options.elapse&&a<0?0:Math.abs(a),this.totalSecsLeft===a||this.firstTick?void(this.firstTick=!1):(this.totalSecsLeft=a,this.elapsed=b>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),weeksToMonth:Math.floor(this.totalSecsLeft/60/60/24/7)%4,months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-b.getFullYear()),totalDays:Math.floor(this.totalSecsLeft/60/60/24),totalHours:Math.floor(this.totalSecsLeft/60/60),totalMinutes:Math.floor(this.totalSecsLeft/60),totalSeconds:this.totalSecsLeft},void(this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish"))))},dispatchEvent:function(b){var c=a.Event(b+".countdown");c.finalDate=this.finalDate,c.elapsed=this.elapsed,c.offset=a.extend({},this.offset),c.strftime=d(this.offset),this.$el.trigger(c)}}),a.fn.countdown=function(){var b=Array.prototype.slice.call(arguments,0);return this.each(function(){var c=a(this).data("countdown-instance");if(void 0!==c){var d=f[c],e=b[0];j.prototype.hasOwnProperty(e)?d[e].apply(d,b.slice(1)):null===String(e).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(d.setFinalDate.call(d,e),d.start()):a.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,e))}else new j(this,b[0],b[1])})}});
+80
View File
@@ -0,0 +1,80 @@
(function ($) {
$.fn.countTo = function (options) {
options = options || {};
return $(this).each(function () {
// set options for current element
var settings = $.extend({}, $.fn.countTo.defaults, {
from: $(this).data('from'),
to: $(this).data('to'),
speed: $(this).data('speed'),
refreshInterval: $(this).data('refresh-interval'),
decimals: $(this).data('decimals')
}, options);
// how many times to update the value, and how much to increment the value on each update
var loops = Math.ceil(settings.speed / settings.refreshInterval),
increment = (settings.to - settings.from) / loops;
// references & variables that will change with each update
var self = this,
$self = $(this),
loopCount = 0,
value = settings.from,
data = $self.data('countTo') || {};
$self.data('countTo', data);
// if an existing interval can be found, clear it first
if (data.interval) {
clearInterval(data.interval);
}
data.interval = setInterval(updateTimer, settings.refreshInterval);
// initialize the element with the starting value
render(value);
function updateTimer() {
value += increment;
loopCount++;
render(value);
if (typeof(settings.onUpdate) == 'function') {
settings.onUpdate.call(self, value);
}
if (loopCount >= loops) {
// remove the interval
$self.removeData('countTo');
clearInterval(data.interval);
value = settings.to;
if (typeof(settings.onComplete) == 'function') {
settings.onComplete.call(self, value);
}
}
}
function render(value) {
var formattedValue = settings.formatter.call(self, value, settings);
$self.html(formattedValue);
}
});
};
$.fn.countTo.defaults = {
from: 0, // the number the element should start at
to: 0, // the number the element should end at
speed: 1000, // how long it should take to count between the target numbers
refreshInterval: 100, // how often the element should be updated
decimals: 0, // the number of decimal places to show
formatter: formatter, // handler for formatting the value before rendering
onUpdate: null, // callback method for every time the element is updated
onComplete: null // callback method for when the element finishes updating
};
function formatter(value, settings) {
return value.toFixed(settings.decimals);
}
}(jQuery));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
!function(p){p.fn.appear=function(r,e){var d=p.extend({data:void 0,one:!0,accX:0,accY:0},e);return this.each(function(){var l=p(this);if(l.appeared=!1,r){var h=p(window),a=function(){if(l.is(":visible")){var e=h.scrollLeft(),a=h.scrollTop(),r=l.offset(),p=r.left,n=r.top,t=d.accX,c=d.accY,i=l.height(),o=h.height(),f=l.width(),s=h.width();a<=n+i+c&&n<=a+o+c&&e<=p+f+t&&p<=e+s+t?l.appeared||l.trigger("appear",d.data):l.appeared=!1}else l.appeared=!1},e=function(){if(l.appeared=!0,d.one){h.unbind("scroll",a);var e=p.inArray(a,p.fn.appear.checks);0<=e&&p.fn.appear.checks.splice(e,1)}r.apply(this,arguments)};d.one?l.one("appear",d.data,e):l.bind("appear",d.data,e),h.scroll(a),p.fn.appear.checks.push(a),a()}else l.trigger("appear",d.data)})},p.extend(p.fn.appear,{checks:[],timeout:null,checkAll:function(){var e=p.fn.appear.checks.length;if(0<e)for(;e--;)p.fn.appear.checks[e]()},run:function(){p.fn.appear.timeout&&clearTimeout(p.fn.appear.timeout),p.fn.appear.timeout=setTimeout(p.fn.appear.checkAll,20)}}),p.each(["append","prepend","after","before","attr","removeAttr","addClass","removeClass","toggleClass","remove","css","show","hide"],function(e,a){var r=p.fn[a];r&&(p.fn[a]=function(){var e=r.apply(this,arguments);return p.fn.appear.run(),e})})}(jQuery);
+1
View File
@@ -0,0 +1 @@
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],function($){return factory($)})}else if(typeof module==="object"&&typeof module.exports==="object"){exports=factory(require("jquery"))}else{factory(jQuery)}})(function($){$.easing.jswing=$.easing.swing;var pow=Math.pow,sqrt=Math.sqrt,sin=Math.sin,cos=Math.cos,PI=Math.PI,c1=1.70158,c2=c1*1.525,c3=c1+1,c4=2*PI/3,c5=2*PI/4.5;function bounceOut(x){var n1=7.5625,d1=2.75;if(x<1/d1){return n1*x*x}else if(x<2/d1){return n1*(x-=1.5/d1)*x+.75}else if(x<2.5/d1){return n1*(x-=2.25/d1)*x+.9375}else{return n1*(x-=2.625/d1)*x+.984375}}$.extend($.easing,{def:"easeOutQuad",swing:function(x){return $.easing[$.easing.def](x)},easeInQuad:function(x){return x*x},easeOutQuad:function(x){return 1-(1-x)*(1-x)},easeInOutQuad:function(x){return x<.5?2*x*x:1-pow(-2*x+2,2)/2},easeInCubic:function(x){return x*x*x},easeOutCubic:function(x){return 1-pow(1-x,3)},easeInOutCubic:function(x){return x<.5?4*x*x*x:1-pow(-2*x+2,3)/2},easeInQuart:function(x){return x*x*x*x},easeOutQuart:function(x){return 1-pow(1-x,4)},easeInOutQuart:function(x){return x<.5?8*x*x*x*x:1-pow(-2*x+2,4)/2},easeInQuint:function(x){return x*x*x*x*x},easeOutQuint:function(x){return 1-pow(1-x,5)},easeInOutQuint:function(x){return x<.5?16*x*x*x*x*x:1-pow(-2*x+2,5)/2},easeInSine:function(x){return 1-cos(x*PI/2)},easeOutSine:function(x){return sin(x*PI/2)},easeInOutSine:function(x){return-(cos(PI*x)-1)/2},easeInExpo:function(x){return x===0?0:pow(2,10*x-10)},easeOutExpo:function(x){return x===1?1:1-pow(2,-10*x)},easeInOutExpo:function(x){return x===0?0:x===1?1:x<.5?pow(2,20*x-10)/2:(2-pow(2,-20*x+10))/2},easeInCirc:function(x){return 1-sqrt(1-pow(x,2))},easeOutCirc:function(x){return sqrt(1-pow(x-1,2))},easeInOutCirc:function(x){return x<.5?(1-sqrt(1-pow(2*x,2)))/2:(sqrt(1-pow(-2*x+2,2))+1)/2},easeInElastic:function(x){return x===0?0:x===1?1:-pow(2,10*x-10)*sin((x*10-10.75)*c4)},easeOutElastic:function(x){return x===0?0:x===1?1:pow(2,-10*x)*sin((x*10-.75)*c4)+1},easeInOutElastic:function(x){return x===0?0:x===1?1:x<.5?-(pow(2,20*x-10)*sin((20*x-11.125)*c5))/2:pow(2,-20*x+10)*sin((20*x-11.125)*c5)/2+1},easeInBack:function(x){return c3*x*x*x-c1*x*x},easeOutBack:function(x){return 1+c3*pow(x-1,3)+c1*pow(x-1,2)},easeInOutBack:function(x){return x<.5?pow(2*x,2)*((c2+1)*2*x-c2)/2:(pow(2*x-2,2)*((c2+1)*(x*2-2)+c2)+2)/2},easeInBounce:function(x){return 1-bounceOut(1-x)},easeOutBounce:bounceOut,easeInOutBounce:function(x){return x<.5?(1-bounceOut(1-2*x))/2:(1+bounceOut(2*x-1))/2}})});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4
View File
@@ -0,0 +1,4 @@
/* jQuery Nice Select - v1.0
https://github.com/hernansartorio/jquery-nice-select
Made by Hernán Sartorio */
!function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("<div></div>").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html('<span class="current"></span><ul class="list"></ul>'));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("<li></li>").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery);
File diff suppressed because one or more lines are too long
+565
View File
@@ -0,0 +1,565 @@
/* =====================================================
Template Name : MyTrip
Description : Travel Booking HTML5 Template
Author : Themesland
Version : 1.1
=======================================================*/
(function ($) {
"use strict";
// multi level dropdown menu
$('.dropdown-menu a.dropdown-toggle').on('click', function (e) {
if (!$(this).next().hasClass('show')) {
$(this).parents('.dropdown-menu').first().find('.show').removeClass('show');
}
var $subMenu = $(this).next('.dropdown-menu');
$subMenu.toggleClass('show');
$(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function (e) {
$('.dropdown-submenu .show').removeClass('show');
});
return false;
});
// data-background
$(document).on('ready', function () {
$("[data-background]").each(function () {
$(this).css("background-image", "url(" + $(this).attr("data-background") + ")");
});
});
// wow init
new WOW().init();
// hero slider
$('.hero-slider').owlCarousel({
loop: true,
nav: true,
dots: false,
margin: 0,
autoplay: true,
autoplayHoverPause: true,
autoplayTimeout: 5000,
items: 1,
navText: [
"<i class='fas fa-long-arrow-left'></i>",
"<i class='fas fa-long-arrow-right'></i>"
],
onInitialized: function (event) {
var $firstAnimatingElements = $('.owl-item').eq(event.item.index).find("[data-animation]");
doAnimations($firstAnimatingElements);
},
onChanged: function (event) {
var $firstAnimatingElements = $('.owl-item').eq(event.item.index).find("[data-animation]");
doAnimations($firstAnimatingElements);
}
});
//hero slider do animations
function doAnimations(elements) {
var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
elements.each(function () {
var $this = $(this);
var $animationDelay = $this.data('delay');
var $animationDuration = $this.data('duration');
var $animationType = 'animated ' + $this.data('animation');
$this.css({
'animation-delay': $animationDelay,
'-webkit-animation-delay': $animationDelay,
'animation-duration': $animationDuration,
'-webkit-animation-duration': $animationDuration,
});
$this.addClass($animationType).one(animationEndEvents, function () {
$this.removeClass($animationType);
});
});
}
// hero-slider 2
$('.hero-slider-2').owlCarousel({
loop: true,
nav: false,
dots: false,
margin: 0,
animateOut: 'fadeOut',
autoplay: true,
autoplayHoverPause: true,
autoplayTimeout: 5000,
items: 1,
});
// partner-slider
$('.partner-slider').owlCarousel({
loop: true,
margin: 20,
nav: false,
dots: false,
autoplay: true,
responsive: {
0: {
items: 2
},
600: {
items: 3
},
1000: {
items: 6
}
}
});
// listing-slider
$('.listing-slider').owlCarousel({
loop: true,
margin: 0,
nav: true,
dots: false,
navText: [
"<i class='far fa-long-arrow-left'></i>",
"<i class='far fa-long-arrow-right'></i>"
],
autoplay: false,
responsive: {
0: {
items: 1
},
600: {
items: 1
},
1000: {
items: 1
}
}
});
// testimonial-slider
$('.testimonial-slider').owlCarousel({
loop: true,
margin: 30,
nav: true,
dots: true,
autoplay: false,
navText: [
"<i class='far fa-long-arrow-left'></i>",
"<i class='far fa-long-arrow-right'></i>"
],
responsive: {
0: {
items: 1
},
600: {
items: 2
},
1000: {
items: 2
}
}
});
// destination-slider
$('.destination-slider').owlCarousel({
loop: true,
margin: 20,
nav: true,
dots: true,
center: true,
navText: [
"<i class='far fa-long-arrow-left'></i>",
"<i class='far fa-long-arrow-right'></i>"
],
autoplay: false,
responsive: {
0: {
items: 1
},
600: {
items: 2
},
1000: {
items: 4
}
}
});
// hotel-slider
$('.hotel-slider').owlCarousel({
loop: true,
margin: 20,
nav: true,
dots: true,
center: true,
navText: [
"<i class='far fa-long-arrow-left'></i>",
"<i class='far fa-long-arrow-right'></i>"
],
autoplay: false,
responsive: {
0: {
items: 1
},
600: {
items: 2
},
1000: {
items: 4
}
}
});
// car-slider
$('.car-slider').owlCarousel({
loop: true,
margin: 20,
nav: true,
dots: true,
center: true,
navText: [
"<i class='far fa-long-arrow-left'></i>",
"<i class='far fa-long-arrow-right'></i>"
],
autoplay: false,
responsive: {
0: {
items: 1
},
600: {
items: 2
},
1000: {
items: 4
}
}
});
// preloader
$(window).on('load', function () {
$(".preloader").fadeOut("slow");
});
// fun fact counter
$('.counter').countTo();
$('.counter-box').appear(function () {
$('.counter').countTo();
}, {
accY: -100
});
// magnific popup init
$(".popup-gallery").magnificPopup({
delegate: '.popup-img',
type: 'image',
gallery: {
enabled: true
},
});
$(".popup-youtube, .popup-vimeo, .popup-gmaps").magnificPopup({
type: "iframe",
mainClass: "mfp-fade",
removalDelay: 160,
preloader: false,
fixedContentPos: false
});
// scroll to top
$(window).scroll(function () {
if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
$("#scroll-top").fadeIn('slow');
} else {
$("#scroll-top").fadeOut('slow');
}
});
$("#scroll-top").click(function () {
$("html, body").animate({ scrollTop: 0 }, 1500);
return false;
});
$(window).scroll(function () {
if ($(this).scrollTop() > 50) {
$('.navbar').addClass("fixed-top");
} else {
$('.navbar').removeClass("fixed-top");
}
});
// countdown
if ($('#countdown').length) {
$('#countdown').countdown('2028/01/30', function (event) {
$(this).html(event.strftime('' + '<div class="row">' + '<div class="col countdown-single">' + '<h2 class="mb-0">%-D</h2>' + '<h5 class="mb-0">روز</h5>' + '</div>' + '<div class="col countdown-single">' + '<h2 class="mb-0">%H</h2>' + '<h5 class="mb-0">ساعت</h5>' + '</div>' + '<div class="col countdown-single">' + '<h2 class="mb-0">%M</h2>' + '<h5 class="mb-0">دقیقه</h5>' + '</div>' + '<div class="col countdown-single">' + '<h2 class="mb-0">%S</h2>' + '<h5 class="mb-0">ثانیه</h5>' + '</div>' + '</div>'));
});
}
// project filter
$(window).on('load', function () {
if ($(".filter-box").children().length > 0) {
$(".filter-box").isotope({
itemSelector: '.filter-item',
masonry: {
columnWidth: 1
},
isOriginLeft: false,
});
$('.filter-btns').on('click', 'li', function () {
var filterValue = $(this).attr('data-filter');
$(".filter-box").isotope({ filter: filterValue });
});
$(".filter-btns li").each(function () {
$(this).on("click", function () {
$(this).siblings("li.active").removeClass("active");
$(this).addClass("active");
});
});
}
});
// copywrite date
let date = new Date().getFullYear();
$("#date").html(date);
// nice select
$(document).ready(function () {
$('.select').niceSelect();
});
// advanced search
$('.advanced-search').click(function () {
$('.advanced-search-menu').toggle();
});
// price slider
$(function () {
$(".price-range").slider({
step: 500,
range: true,
min: 0,
max: 10000,
values: [1500, 5000],
slide: function (event, ui) { $(".priceRange").val("تومان" + ui.values[0].toLocaleString() + " - تومان" + ui.values[1].toLocaleString()); }
});
$(".priceRange").val("تومان" + $(".price-range").slider("values", 0).toLocaleString() + " - تومان" + $(".price-range").slider("values", 1).toLocaleString());
});
// profile image btn
$(".profile-img-btn").click(function () {
$(".profile-img-file").click();
});
// property images upload
$(".property-img-upload").click(function () {
$(".property-img-file").click();
});
// message bottom scroll
if ($('.message-content-info').length) {
$(function () {
var chatbox = $('.message-content-info');
var chatheight = chatbox[0].scrollHeight;
chatbox.scrollTop(chatheight);
});
}
// search date picker
if ($('.date-picker').length) {
$(".date-picker").datepicker();
}
// find-car time picker
if ($('.time-picker').length) {
$(function () {
$(".time-picker").timepicker();
});
}
// flight type search form
$('.flight-type .form-check-input').change(function (e) {
var ft = $(this).val();
if (ft === "round-way") {
$('.flight-search .search-form-return').show();
$('.have-to-clone').hide();
$('.another-item').remove();
} else if (ft === "multi-city") {
$('.flight-search .search-form-return').hide();
$('.have-to-clone').show();
$('.another-item').remove();
} else {
$('.flight-search .search-form-return').hide();
$('.have-to-clone').hide();
$('.another-item').remove();
}
});
// search selected date
const today = new Date();
var journeyDate = new Date(),
returnDate = new Date();
journeyDate.setDate(today.getDate() + 1);
returnDate.setDate(today.getDate() + 2);
$(".journey-date").val(journeyDate.toLocaleDateString());
$(".return-date").val(returnDate.toLocaleDateString());
$(".journey-day-name").html(journeyDate.toLocaleString('fa', { weekday: 'long' }));
$(".return-day-name").html(returnDate.toLocaleString('fa', { weekday: 'long' }));
$(".journey-date").change(function () {
var ojd = $(this).closest(".search-form-date").find(".journey-date").val();
const journeyDayName = new Date(ojd).toLocaleString('fa', { weekday: 'long' });
$(this).closest(".search-form-date").find(".journey-day-name").html(journeyDayName);
});
$(".return-date").change(function () {
var rd = $(this).closest(".search-form-date").find(".return-date").val();
const returnDayName = new Date(rd).toLocaleString('fa', { weekday: 'long' });
$(this).closest(".search-form-date").find(".return-day-name").html(returnDayName);
});
// passenger box dropdown
$(".passenger-box .dropdown-menu").click(function (e) {
e.stopPropagation();
});
$(".passenger-class-info input[type='radio']").change(function (e) {
var pcn = $(e.target).closest(".form-check").find("input[type='radio']:checked").val();
$(e.target).closest(".passenger-box").find(".passenger-class-name").html(pcn);
});
$(".plus-btn").on("click", function (e) {
var i = $(this).closest(".passenger-qty").children(".qty-amount").get(0).value++,
c = $(this).closest(".passenger-qty").children(".minus-btn");
i >= 0 && c.removeAttr("disabled");
totalPessenger(e);
totalRoom(e);
}),
$(".minus-btn").on("click", function (e) {
var i = $(this).closest(".passenger-qty").children(".qty-amount").get(0).value;
if (i <= 1) {
$(this).attr("disabled", "disabled");
} else {
$(this).closest(".passenger-qty").children(".qty-amount").get(0).value--;
totalPessenger(e);
totalRoom(e);
}
})
function totalPessenger(e) {
var pa = parseInt($(e.target).closest(".passenger-box").find(".passenger-adult").val());
var pc = parseInt($(e.target).closest(".passenger-box").find(".passenger-children").val());
var pi = parseInt($(e.target).closest(".passenger-box").find(".passenger-infant").val());
var tp = pa + pc + pi;
$(e.target).closest(".passenger-box").find(".passenger-total-amount").html(tp);
}
function totalRoom(e) {
var tr = parseInt($(e.target).closest(".passenger-box").find(".passenger-room").val())
$(e.target).closest(".passenger-box").find(".passenger-total-room").html(tr);
}
// search multicity form
$(".multicity-btn").click(function () {
if (document.querySelectorAll('.flight-search-item').length === 5) {
return alert("Maximum Flight Limit Reached!!");
}
$('.flight-multicity-item .date-picker').datepicker('destroy');
var cloneMulticity = $(".have-to-clone").clone();
cloneMulticity.removeClass("have-to-clone");
cloneMulticity.addClass("another-item");
cloneMulticity.find(".multicity-btn").addClass("multicity-item-remove").html(`<div>
<i class="fal fa-circle-xmark"></i> Remove Flight</div>`);
$(".flight-search-content").append(cloneMulticity);
var i = 0;
$('.flight-multicity-item .date-picker').each(function () {
$(this).attr("id", 'date' + i).datepicker();
i++;
});
});
$(document).on('click', '.multicity-item-remove', function () {
$(this).parent().closest('.flight-multicity-item').remove();
});
$(document).on('change', '.flight-multicity-item .date-picker', function (e) {
var jd = $(e.target).val();
const journeyDayName = new Date(jd).toLocaleString('en-us', { weekday: 'long' });
$(e.target).closest(".flight-multicity-item").find('.journey-day-name').html(journeyDayName);
});
// swap search form value
$(document).on('click', '.flight-search-item .search-form-swap', function (e) {
var swapFrom = $(e.target).closest(".flight-search-item").find('.swap-from').val();
var swapTo = $(e.target).closest(".flight-search-item").find('.swap-to').val();
$(e.target).closest(".flight-search-item").find('.swap-from').val(swapTo);
$(e.target).closest(".flight-search-item").find('.swap-to').val(swapFrom);
});
})(jQuery);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2
View File
File diff suppressed because one or more lines are too long