1093 lines
30 KiB
JavaScript
1093 lines
30 KiB
JavaScript
var hideChartLable = getWidth() < 508 ? false : true;
|
|
|
|
var Bdata = null;
|
|
var WindowWidth = null;
|
|
WindowWidth = $(window).width();
|
|
console.log(WindowWidth);
|
|
Chart.defaults.global.defaultFontFamily = "IRANSansFaNum";
|
|
var chartColors = [
|
|
"#4929ac",
|
|
"#202be0",
|
|
"#4962ac",
|
|
"#4286d3",
|
|
"#000c7f",
|
|
"#2aa9db",
|
|
"#8690ef",
|
|
"#00587a",
|
|
"#88b3cb",
|
|
"rgba(255, 64, 255, 1)",
|
|
"rgba(159, 159, 64, 1)",
|
|
"#ff5c0f",
|
|
"#4962ac",
|
|
];
|
|
var Chartmostgreen = [
|
|
"rgba(204, 255, 102)",
|
|
"rgba(204, 255, 0)",
|
|
"rgba(204, 255, 204)",
|
|
];
|
|
var chartleastred = [
|
|
"rgba(255, 153, 102)",
|
|
"rgba(204, 102, 102)",
|
|
"rgba(255, 0, 0)",
|
|
];
|
|
$(document).ready(function () {
|
|
if (WindowWidth <= 800) {
|
|
$(".logoPart").empty();
|
|
$(".logoPart").append(
|
|
'<div class="callusfirst">\
|
|
<img src = "./dist/images/new-design/instagramLogo.svg">\
|
|
<img src="./dist/images/new-design/watsappLogo.svg">\
|
|
</div>\
|
|
<div class="callusec">\
|
|
<img src="./dist/images/new-design/microLine.svg">\
|
|
<span>تماس با ما</span>\
|
|
<img src="./dist/images/new-design/microLine.svg">\
|
|
</div>'
|
|
);
|
|
}
|
|
$.ajax({
|
|
url: "https://rms.rmto.ir/public/bama-homepage",
|
|
type: "GET",
|
|
success: function (result) {
|
|
// console.log(result);
|
|
ShowBi(result);
|
|
Bdata = result.count_all;
|
|
},
|
|
error: function (error) {
|
|
// console.log(error);
|
|
},
|
|
});
|
|
});
|
|
|
|
function ShowBi(res) {
|
|
$(".counter-for-rahdari").each(function () {
|
|
var $this = $(this),
|
|
countTo = res.count_all;
|
|
|
|
$({ countNum: $this.text() }).animate(
|
|
{
|
|
countNum: countTo,
|
|
},
|
|
{
|
|
duration: 2000,
|
|
easing: "linear",
|
|
step: function () {
|
|
$this.text(Math.floor(this.countNum));
|
|
},
|
|
complete: function () {
|
|
$this.text(this.countNum);
|
|
},
|
|
}
|
|
);
|
|
});
|
|
// var num = 0;
|
|
// $("#projectcount").kCounter({ initial: num, duration: 1000 });
|
|
// setInterval(function () {
|
|
// $("#projectcount").kCounter("update", Bdata);
|
|
// }, 1000);
|
|
|
|
var FirstChartLeft = document.getElementById("myChartfirst").getContext("2d");
|
|
|
|
var myChartFirstLeft = new Chart(FirstChartLeft, {
|
|
type: "doughnut",
|
|
data: {
|
|
datasets: [
|
|
{
|
|
data: [
|
|
res.counts.maintenance_project_count,
|
|
res.counts.technical_building_count,
|
|
res.counts.upgrade_safety_count,
|
|
res.counts.danger_prevention_count,
|
|
res.counts.tollhouse_management_count,
|
|
],
|
|
backgroundColor: [
|
|
chartColors[0],
|
|
chartColors[1],
|
|
chartColors[2],
|
|
chartColors[3],
|
|
chartColors[4],
|
|
],
|
|
},
|
|
],
|
|
labels: [
|
|
"روکش آسفالت (نگهداری راه )",
|
|
"ابنیه فنی (نگهداری و ساخت )",
|
|
"ارتقای ایمنی راه ",
|
|
"رفع نقاط حادثه خیز / پرتصادف",
|
|
"راهدارخانه (بهسازی و نوسازی)",
|
|
],
|
|
},
|
|
options: {
|
|
plugins: {
|
|
datalabels: {
|
|
anchor: "center",
|
|
align: "center",
|
|
offset: 10,
|
|
color: "#fffff",
|
|
},
|
|
},
|
|
responsive: true,
|
|
legend: {
|
|
display: hideChartLable,
|
|
position: "left",
|
|
rtl: true,
|
|
labels: {
|
|
boxWidth: 13,
|
|
// fontSize: 20,
|
|
fontStyle: "bold",
|
|
},
|
|
},
|
|
title: {
|
|
display: false,
|
|
text: "تفکیک پروژه های راه روستایی",
|
|
position: "bottom",
|
|
},
|
|
tooltips: {
|
|
enabled: true,
|
|
},
|
|
},
|
|
});
|
|
var SecondChartLeft = document
|
|
.getElementById("myChartsecond")
|
|
.getContext("2d");
|
|
|
|
var myChartSecLeft = new Chart(SecondChartLeft, {
|
|
type: "doughnut",
|
|
data: {
|
|
datasets: [
|
|
{
|
|
data: [
|
|
res.project_status[8],
|
|
res.project_status[5],
|
|
res.project_status[6],
|
|
res.project_status[7],
|
|
res.project_status[2],
|
|
res.project_status[3],
|
|
res.project_status[1],
|
|
res.project_status[0],
|
|
res.project_status[4],
|
|
],
|
|
backgroundColor: [
|
|
chartColors[0],
|
|
chartColors[4],
|
|
chartColors[5],
|
|
chartColors[6],
|
|
chartColors[3],
|
|
chartColors[7],
|
|
chartColors[8],
|
|
chartColors[2],
|
|
chartColors[1],
|
|
],
|
|
label: "Dataset 1",
|
|
},
|
|
],
|
|
labels: [
|
|
"تکمیل و خاتمه یافته و بهره برداری شده ",
|
|
"در حال اجرا /فعال",
|
|
"در حال اجرا متوقف",
|
|
"در حال آماده سازی برای افتتاح",
|
|
"در دست مطالعه و تهیه اسناد مناقصه",
|
|
"در دست مناقصه",
|
|
"در دست برنامه ریزی اولیه",
|
|
"توسط استان بروزرسانی نشده ",
|
|
"در حال تجهیز کارگاه",
|
|
],
|
|
},
|
|
options: {
|
|
plugins: {
|
|
datalabels: {
|
|
anchor: "center",
|
|
align: "end",
|
|
offset: 10,
|
|
color: "#fffff",
|
|
},
|
|
},
|
|
responsive: true,
|
|
legend: {
|
|
display: hideChartLable,
|
|
position: "left",
|
|
labels: {
|
|
boxWidth: 13,
|
|
// fontSize: fonty,
|
|
fontStyle: "bold",
|
|
},
|
|
},
|
|
title: {
|
|
display: false,
|
|
text: "تفکیک پروژه های راه روستایی",
|
|
position: "bottom",
|
|
},
|
|
tooltips: {
|
|
enabled: true,
|
|
},
|
|
},
|
|
});
|
|
var frChart = document.getElementById("frChartFirst").getContext("2d");
|
|
|
|
var myChartFastR = new Chart(
|
|
frChart,
|
|
{
|
|
type: "pie",
|
|
data: {
|
|
datasets: [
|
|
{
|
|
data: [res.project_status[5], res.project_status[6]],
|
|
backgroundColor: [chartColors[12], chartColors[11]],
|
|
label: ["رسیدگی شده", "در حال بررسی"],
|
|
},
|
|
],
|
|
labels: ["رسیدگی شده", "در حال بررسی"],
|
|
},
|
|
options: {
|
|
plugins: {
|
|
datalabels: {
|
|
anchor: "center",
|
|
align: "end",
|
|
offset: 10,
|
|
color: "#fffff",
|
|
},
|
|
},
|
|
responsive: true,
|
|
legendCallback: function (legendarray) {
|
|
var legendHtml = [];
|
|
legendHtml.push('<div class="boxxcontainer">');
|
|
console.log("chishod?", legendarray.data.datasets[0].data.length);
|
|
for (var i = 0; i < legendarray.data.datasets[0].data.length; i++) {
|
|
legendHtml.push(
|
|
'<div id="label' +
|
|
i +
|
|
'" class="containerItem" style="width:' +
|
|
(100 / legendarray.data.datasets[0].data.length - 1) +
|
|
'%;"> <div class="boxx" style="background-color:' +
|
|
legendarray.data.datasets[0].backgroundColor[i] +
|
|
';"></div>'
|
|
);
|
|
if (legendarray.data.datasets[0].label) {
|
|
legendHtml.push(
|
|
'<div class="boxxlabel" onclick="updateLegendAction(event, ' +
|
|
"'" +
|
|
legendarray.legend.legendItems[i].datasetIndex +
|
|
"'" +
|
|
')"> ' +
|
|
legendarray.data.datasets[0].label[i] +
|
|
"</div></div>"
|
|
);
|
|
}
|
|
}
|
|
legendHtml.push("</div>");
|
|
return legendHtml.join("");
|
|
},
|
|
legend: {
|
|
display: false,
|
|
// position: "bottom",
|
|
// labels:{
|
|
// boxWidth: 13
|
|
// }
|
|
},
|
|
title: {
|
|
display: false,
|
|
text: "تفکیک پروژه های راه روستایی",
|
|
position: "bottom",
|
|
},
|
|
tooltips: {
|
|
enabled: true,
|
|
},
|
|
},
|
|
},
|
|
newlegendFirst
|
|
);
|
|
var newlegendFirst = (document.getElementById(
|
|
"htmllegend"
|
|
).innerHTML = myChartFastR.generateLegend());
|
|
|
|
var frChartSecond = document.getElementById("frChartSecond").getContext("2d");
|
|
|
|
var myChartFastRSecond = new Chart(
|
|
frChartSecond,
|
|
{
|
|
type: "pie",
|
|
data: {
|
|
datasets: [
|
|
{
|
|
data: [res.project_status[5], res.project_status[6]],
|
|
backgroundColor: [chartColors[12], chartColors[11]],
|
|
label: ["رسیدگی شده", "در حال بررسی"],
|
|
},
|
|
],
|
|
labels: ["رسیدگی شده", "در حال بررسی"],
|
|
},
|
|
options: {
|
|
plugins: {
|
|
datalabels: {
|
|
anchor: "center",
|
|
align: "end",
|
|
offset: 10,
|
|
color: "#fffff",
|
|
},
|
|
},
|
|
responsive: true,
|
|
legendCallback: function (legendarray) {
|
|
var legendHtml = [];
|
|
legendHtml.push('<div class="boxxcontainer">');
|
|
console.log("chishod?", legendarray.data.datasets[0].data.length);
|
|
for (var i = 0; i < legendarray.data.datasets[0].data.length; i++) {
|
|
legendHtml.push(
|
|
'<div id="label' +
|
|
i +
|
|
'" class="containerItem" style="width:' +
|
|
(100 / legendarray.data.datasets[0].data.length - 1) +
|
|
'%;"> <div class="boxx" style="background-color:' +
|
|
legendarray.data.datasets[0].backgroundColor[i] +
|
|
';"></div>'
|
|
);
|
|
if (legendarray.data.datasets[0].label) {
|
|
legendHtml.push(
|
|
'<div class="boxxlabel" onclick="updateLegendAction(event, ' +
|
|
"'" +
|
|
legendarray.legend.legendItems[i].datasetIndex +
|
|
"'" +
|
|
')"> ' +
|
|
legendarray.data.datasets[0].label[i] +
|
|
"</div></div>"
|
|
);
|
|
}
|
|
}
|
|
legendHtml.push("</div>");
|
|
return legendHtml.join("");
|
|
},
|
|
legend: {
|
|
display: false,
|
|
// position: "bottom",
|
|
// labels:{
|
|
// boxWidth: 13
|
|
// }
|
|
},
|
|
title: {
|
|
display: false,
|
|
text: "تفکیک پروژه های راه روستایی",
|
|
position: "bottom",
|
|
},
|
|
tooltips: {
|
|
enabled: true,
|
|
},
|
|
},
|
|
},
|
|
newlegendSecond
|
|
);
|
|
var newlegendSecond = (document.getElementById(
|
|
"htmllegendSecond"
|
|
).innerHTML = myChartFastRSecond.generateLegend());
|
|
|
|
var frChartThird = document.getElementById("frChartThird").getContext("2d");
|
|
|
|
var myChartFastRThird = new Chart(
|
|
frChartThird,
|
|
{
|
|
type: "pie",
|
|
data: {
|
|
datasets: [
|
|
{
|
|
data: [res.project_status[5], res.project_status[6]],
|
|
backgroundColor: [chartColors[12], chartColors[11]],
|
|
label: ["رسیدگی شده", "در حال بررسی"],
|
|
},
|
|
],
|
|
labels: ["رسیدگی شده", "در حال بررسی"],
|
|
},
|
|
options: {
|
|
plugins: {
|
|
datalabels: {
|
|
anchor: "center",
|
|
align: "end",
|
|
offset: 10,
|
|
color: "#fffff",
|
|
},
|
|
},
|
|
responsive: true,
|
|
legendCallback: function (legendarray) {
|
|
var legendHtml = [];
|
|
legendHtml.push('<div class="boxxcontainer">');
|
|
console.log("chishod?", legendarray.data.datasets[0].data.length);
|
|
for (var i = 0; i < legendarray.data.datasets[0].data.length; i++) {
|
|
legendHtml.push(
|
|
'<div id="label' +
|
|
i +
|
|
'" class="containerItem" style="width:' +
|
|
(100 / legendarray.data.datasets[0].data.length - 1) +
|
|
'%;"> <div class="boxx" style="background-color:' +
|
|
legendarray.data.datasets[0].backgroundColor[i] +
|
|
';"></div>'
|
|
);
|
|
if (legendarray.data.datasets[0].label) {
|
|
legendHtml.push(
|
|
'<div class="boxxlabel" onclick="updateLegendAction(event, ' +
|
|
"'" +
|
|
legendarray.legend.legendItems[i].datasetIndex +
|
|
"'" +
|
|
')"> ' +
|
|
legendarray.data.datasets[0].label[i] +
|
|
"</div></div>"
|
|
);
|
|
}
|
|
}
|
|
legendHtml.push("</div>");
|
|
return legendHtml.join("");
|
|
},
|
|
legend: {
|
|
display: false,
|
|
// position: "bottom",
|
|
// labels:{
|
|
// boxWidth: 13
|
|
// }
|
|
},
|
|
title: {
|
|
display: false,
|
|
text: "تفکیک پروژه های راه روستایی",
|
|
position: "bottom",
|
|
},
|
|
tooltips: {
|
|
enabled: true,
|
|
},
|
|
},
|
|
},
|
|
newlegendThird
|
|
);
|
|
var newlegendThird = (document.getElementById(
|
|
"htmllegendThird"
|
|
).innerHTML = myChartFastRThird.generateLegend());
|
|
|
|
//gharargah
|
|
var ghararfirsttext = document.getElementById("ghararfirst").getContext("2d");
|
|
|
|
var ghararfirst = new Chart(ghararfirsttext, {
|
|
type: "doughnut",
|
|
data: {
|
|
datasets: [
|
|
{
|
|
data: [
|
|
res.counts.maintenance_project_count,
|
|
res.counts.technical_building_count,
|
|
res.counts.upgrade_safety_count,
|
|
res.counts.danger_prevention_count,
|
|
res.counts.tollhouse_management_count,
|
|
],
|
|
backgroundColor: [
|
|
chartColors[0],
|
|
chartColors[1],
|
|
chartColors[2],
|
|
chartColors[3],
|
|
chartColors[4],
|
|
],
|
|
},
|
|
],
|
|
labels: [
|
|
"روکش آسفالت (نگهداری راه )",
|
|
"ابنیه فنی (نگهداری و ساخت )",
|
|
"ارتقای ایمنی راه ",
|
|
"رفع نقاط حادثه خیز / پرتصادف",
|
|
"راهدارخانه (بهسازی و نوسازی)",
|
|
],
|
|
},
|
|
options: {
|
|
plugins: {
|
|
datalabels: {
|
|
anchor: "center",
|
|
align: "center",
|
|
offset: 10,
|
|
color: "#fffff",
|
|
},
|
|
},
|
|
responsive: true,
|
|
legend: {
|
|
display: hideChartLable,
|
|
position: "right",
|
|
rtl: true,
|
|
labels: {
|
|
boxWidth: 13,
|
|
},
|
|
},
|
|
title: {
|
|
display: false,
|
|
text: "تفکیک پروژه های راه روستایی",
|
|
position: "bottom",
|
|
},
|
|
tooltips: {
|
|
enabled: true,
|
|
},
|
|
},
|
|
});
|
|
|
|
var ghararsectext = document.getElementById("ghararsecond").getContext("2d");
|
|
|
|
var ghararsecond = new Chart(ghararsectext, {
|
|
type: "doughnut",
|
|
data: {
|
|
datasets: [
|
|
{
|
|
data: [
|
|
res.counts.maintenance_project_count,
|
|
res.counts.technical_building_count,
|
|
res.counts.upgrade_safety_count,
|
|
res.counts.danger_prevention_count,
|
|
res.counts.tollhouse_management_count,
|
|
],
|
|
backgroundColor: [
|
|
chartColors[0],
|
|
chartColors[1],
|
|
chartColors[2],
|
|
chartColors[3],
|
|
chartColors[4],
|
|
],
|
|
},
|
|
],
|
|
labels: [
|
|
"روکش آسفالت (نگهداری راه )",
|
|
"ابنیه فنی (نگهداری و ساخت )",
|
|
"ارتقای ایمنی راه ",
|
|
"رفع نقاط حادثه خیز / پرتصادف",
|
|
"راهدارخانه (بهسازی و نوسازی)",
|
|
],
|
|
},
|
|
options: {
|
|
plugins: {
|
|
datalabels: {
|
|
anchor: "center",
|
|
align: "center",
|
|
offset: 10,
|
|
color: "#fffff",
|
|
},
|
|
},
|
|
responsive: true,
|
|
legend: {
|
|
display: hideChartLable,
|
|
position: "left",
|
|
rtl: true,
|
|
labels: {
|
|
boxWidth: 13,
|
|
},
|
|
},
|
|
title: {
|
|
display: false,
|
|
text: "تفکیک پروژه های راه روستایی",
|
|
position: "bottom",
|
|
},
|
|
tooltips: {
|
|
enabled: true,
|
|
},
|
|
},
|
|
});
|
|
}
|
|
|
|
function updateLegendAction(e, datasetIndex) {
|
|
var index = datasetIndex;
|
|
var ci = e.view.chart;
|
|
var meta = ci.getDatasetMeta(index);
|
|
// See controller.isDatasetVisible comment
|
|
meta.hidden = meta.hidden === null ? !ci.data.datasets[index].hidden : null;
|
|
document.getElementById("label" + index).style.opacity =
|
|
document.getElementById("label" + index).style.opacity === "0.2"
|
|
? "1"
|
|
: "0.2";
|
|
// We hid a dataset ... rerender the chart
|
|
ci.update();
|
|
}
|
|
//chooseheader
|
|
$("#rahdariproject").on("click", function () {
|
|
$(".projectbody").css("display", "block");
|
|
$(".rozaneproject").css("display", "none");
|
|
$(".fastreaction").css("display", "none");
|
|
$(".gharargahcard").css("display", "none");
|
|
|
|
// rendercountall();
|
|
});
|
|
$("#roozanepro").on("click", function () {
|
|
$(".projectbody").css("display", "none");
|
|
$(".rozaneproject").css("display", "block");
|
|
$(".fastreaction").css("display", "none");
|
|
$(".gharargahcard").css("display", "none");
|
|
|
|
// renderroaditems();
|
|
});
|
|
$("#fastreact").on("click", function () {
|
|
$(".projectbody").css("display", "none");
|
|
$(".rozaneproject").css("display", "none");
|
|
$(".fastreaction").css("display", "block");
|
|
$(".gharargahcard").css("display", "none");
|
|
|
|
// roadvakonesh();
|
|
});
|
|
$("#gharargah").on("click", function () {
|
|
$(".projectbody").css("display", "none");
|
|
$(".rozaneproject").css("display", "none");
|
|
$(".fastreaction").css("display", "none");
|
|
$(".gharargahcard").css("display", "block");
|
|
// roadgharargah();
|
|
});
|
|
|
|
$("#showprojectmodal").on("click", function () {
|
|
$("#modalprojectchoose").modal("show");
|
|
});
|
|
$("#startfaliat").on("click", function () {
|
|
$("#submitproject").modal("show");
|
|
});
|
|
//hover for home header
|
|
var flag = [1, 0, 0, 0];
|
|
//on click start
|
|
$("#rahdariproject").on("click", function () {
|
|
flag = [1, 0, 0, 0];
|
|
$(".headericon1").attr(
|
|
"src",
|
|
"./dist/images/new-design/rahdariProject-active.svg"
|
|
);
|
|
$(".headericon2").attr("src", "./dist/images/new-design/dailyWork.svg");
|
|
$(".headericon3").attr("src", "./dist/images/new-design/fastReaction.svg");
|
|
$(".headericon4").attr(
|
|
"src",
|
|
"./dist/images/new-design/camp&crisisManagement.svg"
|
|
);
|
|
});
|
|
|
|
$("#roozanepro").on("click", function () {
|
|
flag = [0, 1, 0, 0];
|
|
$(".headericon1").attr("src", "./dist/images/new-design/rahdariProject.svg");
|
|
$(".headericon2").attr(
|
|
"src",
|
|
"./dist/images/new-design/dailyWork-active.svg"
|
|
);
|
|
$(".headericon3").attr("src", "./dist/images/new-design/fastReaction.svg");
|
|
$(".headericon4").attr(
|
|
"src",
|
|
"./dist/images/new-design/camp&crisisManagement.svg"
|
|
);
|
|
});
|
|
|
|
$("#fastreact").on("click", function () {
|
|
flag = [0, 0, 1, 0];
|
|
$(".headericon1").attr("src", "./dist/images/new-design/rahdariProject.svg");
|
|
$(".headericon2").attr("src", "./dist/images/new-design/dailyWork.svg");
|
|
$(".headericon3").attr(
|
|
"src",
|
|
"./dist/images/new-design/fastReaction-active.svg"
|
|
);
|
|
$(".headericon4").attr(
|
|
"src",
|
|
"./dist/images/new-design/camp&crisisManagement.svg"
|
|
);
|
|
});
|
|
|
|
$("#gharargah").on("click", function () {
|
|
flag = [0, 0, 0, 1];
|
|
$(".headericon1").attr("src", "./dist/images/new-design/rahdariProject.svg");
|
|
$(".headericon2").attr("src", "./dist/images/new-design/dailyWork.svg");
|
|
$(".headericon3").attr("src", "./dist/images/new-design/fastReaction.svg");
|
|
$(".headericon4").attr(
|
|
"src",
|
|
"./dist/images/new-design/camp&crisisManagement-active.svg"
|
|
);
|
|
});
|
|
//on click end
|
|
if (flag[0] == 1) {
|
|
$(".headericon1").attr(
|
|
"src",
|
|
"./dist/images/new-design/rahdariProject-active.svg"
|
|
);
|
|
}
|
|
$("#rahdariproject").on("mouseenter", function () {
|
|
if (flag[0] != 1) {
|
|
$(".headericon1").attr(
|
|
"src",
|
|
"./dist/images/new-design/rahdariProject-hover.svg"
|
|
);
|
|
}
|
|
});
|
|
$("#rahdariproject").on("mouseleave", function () {
|
|
if (flag[0] != 1) {
|
|
$(".headericon1").attr(
|
|
"src",
|
|
"./dist/images/new-design/rahdariProject.svg"
|
|
);
|
|
}
|
|
});
|
|
|
|
$("#roozanepro").on("mouseenter", function () {
|
|
if (flag[1] != 1) {
|
|
$(".headericon2").attr(
|
|
"src",
|
|
"./dist/images/new-design/dailyWork-hover.svg"
|
|
);
|
|
}
|
|
});
|
|
$("#roozanepro").on("mouseleave", function () {
|
|
if (flag[1] != 1) {
|
|
$(".headericon2").attr("src", "./dist/images/new-design/dailyWork.svg");
|
|
}
|
|
});
|
|
|
|
$("#fastreact").on("mouseenter", function () {
|
|
if (flag[2] != 1) {
|
|
$(".headericon3").attr(
|
|
"src",
|
|
"./dist/images/new-design/fastReaction-hover.svg"
|
|
);
|
|
}
|
|
});
|
|
$("#fastreact").on("mouseleave", function () {
|
|
if (flag[2] != 1) {
|
|
$(".headericon3").attr("src", "./dist/images/new-design/fastReaction.svg");
|
|
}
|
|
});
|
|
|
|
$("#gharargah").on("mouseenter", function () {
|
|
if (flag[3] != 1) {
|
|
$(".headericon4").attr(
|
|
"src",
|
|
"./dist/images/new-design/camp&crisisManagement-hover.svg"
|
|
);
|
|
}
|
|
});
|
|
$("#gharargah").on("mouseleave", function () {
|
|
if (flag[3] != 1) {
|
|
$(".headericon4").attr(
|
|
"src",
|
|
"./dist/images/new-design/camp&crisisManagement.svg"
|
|
);
|
|
}
|
|
});
|
|
|
|
//hover for home header
|
|
//daily activity tab counter start
|
|
$("#roozanepro").on("click", function () {
|
|
$(".counter-for-daily").each(function () {
|
|
var $this = $(this),
|
|
countTo = $this.attr("data-count");
|
|
|
|
$({ countNum: $this.text() }).animate(
|
|
{
|
|
countNum: countTo,
|
|
},
|
|
{
|
|
duration: 2000,
|
|
easing: "linear",
|
|
step: function () {
|
|
$this.text(Math.floor(this.countNum));
|
|
},
|
|
complete: function () {
|
|
$this.text(this.countNum);
|
|
},
|
|
}
|
|
);
|
|
});
|
|
});
|
|
//daily activity tab counter end
|
|
//fast reaction tab counter start
|
|
$("#fastreact").on("click", function () {
|
|
$(".counter-for-fast").each(function () {
|
|
var $this = $(this),
|
|
countTo = $this.attr("data-count");
|
|
|
|
$({ countNum: $this.text() }).animate(
|
|
{
|
|
countNum: countTo,
|
|
},
|
|
{
|
|
duration: 2000,
|
|
easing: "linear",
|
|
step: function () {
|
|
$this.text(Math.floor(this.countNum));
|
|
},
|
|
complete: function () {
|
|
$this.text(this.countNum);
|
|
},
|
|
}
|
|
);
|
|
});
|
|
});
|
|
//fast reaction tab counter end
|
|
|
|
//gharargah tab counter start
|
|
$("#gharargah").on("click", function () {
|
|
$(".counter-for-gharargah").each(function () {
|
|
var $this = $(this),
|
|
countTo = $this.attr("data-count");
|
|
|
|
$({ countNum: $this.text() }).animate(
|
|
{
|
|
countNum: countTo,
|
|
},
|
|
{
|
|
duration: 2000,
|
|
easing: "linear",
|
|
step: function () {
|
|
$this.text(Math.floor(this.countNum));
|
|
},
|
|
complete: function () {
|
|
$this.text(this.countNum);
|
|
},
|
|
}
|
|
);
|
|
});
|
|
});
|
|
//gharargah tab counter end
|
|
|
|
// samm coding start
|
|
|
|
//slider for mobile start
|
|
$(".second-menu-img").click(function () {
|
|
$(".queen-size-nav").toggle({ direction: "right" }, 50);
|
|
if (
|
|
$(".second-menu-img").attr("src") ==
|
|
"./dist/images/new-design/burger-list.svg"
|
|
) {
|
|
$(".second-menu-img").attr("src", "./dist/images/new-design/delete.svg");
|
|
$(".queen-size-nav").css("position", "absolute");
|
|
$(".queen-size-nav").css("z-index", "2");
|
|
$(".queen-size-nav").css("width", "30%");
|
|
$(".queen-size-nav").css("height", "100%");
|
|
$(".second-top-menu").css("z-index", "2");
|
|
} else if (
|
|
$(".second-menu-img").attr("src") == "./dist/images/new-design/delete.svg"
|
|
) {
|
|
$(".second-menu-img").attr(
|
|
"src",
|
|
"./dist/images/new-design/burger-list.svg"
|
|
);
|
|
$(".second-top-menu").css("margin-right", "0px");
|
|
$(".queen-size-nav").css("width", "0%");
|
|
$(".queen-size-nav").css("height", "0%");
|
|
}
|
|
});
|
|
//slider for mobile end
|
|
$(".queen-res").click(function () {
|
|
$(".first-step-res").slideToggle(300);
|
|
if ($(".forth-step-res").css("display") == "block") {
|
|
$(".forth-step-res").slideUp(300);
|
|
} else if ($(".sixth-step-res").css("display") == "block") {
|
|
$(".sixth-step-res").slideUp(300);
|
|
} else if ($(".seventh-step-res").css("display") == "block") {
|
|
$(".seventh-step-res").slideUp(300);
|
|
}
|
|
if ($(".first-step-res").css("display") == "block") {
|
|
$(".arrow-changing1").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-down.svg"
|
|
);
|
|
}
|
|
setTimeout(() => {
|
|
if ($(".first-step-res").css("display") == "none") {
|
|
$(".arrow-changing1").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
setTimeout(() => {
|
|
if ($(".forth-step-res").css("display") == "none") {
|
|
$(".arrow-changing2").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
setTimeout(() => {
|
|
if ($(".sixth-step-res").css("display") == "none") {
|
|
$(".arrow-changing3").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
setTimeout(() => {
|
|
if ($(".seventh-step-res").css("display") == "none") {
|
|
$(".arrow-changing4").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
});
|
|
$(".inside-queen-res").click(function () {
|
|
$(".second-step-res").slideToggle(300);
|
|
if ($(".arrow-changing-inside1").attr("src") == "./dist/images/new-design/arrow-left.svg") {
|
|
$(".arrow-changing-inside1").attr("src", "./dist/images/new-design/arrow-down.svg");
|
|
}else if ($(".arrow-changing-inside1").attr("src") == "./dist/images/new-design/arrow-down.svg") {
|
|
$(".arrow-changing-inside1").attr("src", "./dist/images/new-design/arrow-left.svg");
|
|
}
|
|
});
|
|
$(".again-inside-queen-res").click(function () {
|
|
$(".third-step-res").slideToggle(300);
|
|
if ($(".arrow-changing-inside2").attr("src") == "./dist/images/new-design/arrow-left.svg") {
|
|
$(".arrow-changing-inside2").attr("src", "./dist/images/new-design/arrow-down.svg");
|
|
}else if ($(".arrow-changing-inside2").attr("src") == "./dist/images/new-design/arrow-down.svg") {
|
|
$(".arrow-changing-inside2").attr("src", "./dist/images/new-design/arrow-left.svg");
|
|
}
|
|
});
|
|
$(".second-queen-res").click(function () {
|
|
$(".forth-step-res").slideToggle(300);
|
|
if ($(".first-step-res").css("display") == "block") {
|
|
$(".first-step-res").slideUp(300);
|
|
} else if ($(".sixth-step-res").css("display") == "block") {
|
|
$(".sixth-step-res").slideUp(300);
|
|
} else if ($(".seventh-step-res").css("display") == "block") {
|
|
$(".seventh-step-res").slideUp(300);
|
|
}
|
|
if ($(".forth-step-res").css("display") == "block") {
|
|
$(".arrow-changing2").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-down.svg"
|
|
);
|
|
}
|
|
setTimeout(() => {
|
|
if ($(".forth-step-res").css("display") == "none") {
|
|
$(".arrow-changing2").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
setTimeout(() => {
|
|
if ($(".first-step-res").css("display") == "none") {
|
|
$(".arrow-changing1").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
setTimeout(() => {
|
|
if ($(".sixth-step-res").css("display") == "none") {
|
|
$(".arrow-changing3").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
setTimeout(() => {
|
|
if ($(".seventh-step-res").css("display") == "none") {
|
|
$(".arrow-changing4").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
});
|
|
$(".inside-second-queen-res").click(function () {
|
|
$(".fivth-step-res").slideToggle(300);
|
|
$(".third-step-res").slideToggle(300);
|
|
if ($(".arrow-changing-inside3").attr("src") == "./dist/images/new-design/arrow-left.svg") {
|
|
$(".arrow-changing-inside3").attr("src", "./dist/images/new-design/arrow-down.svg");
|
|
}else if ($(".arrow-changing-inside3").attr("src") == "./dist/images/new-design/arrow-down.svg") {
|
|
$(".arrow-changing-inside3").attr("src", "./dist/images/new-design/arrow-left.svg");
|
|
}
|
|
});
|
|
$(".third-queen-res").click(function () {
|
|
$(".sixth-step-res").slideToggle(300);
|
|
if ($(".forth-step-res").css("display") == "block") {
|
|
$(".forth-step-res").slideUp(300);
|
|
} else if ($(".first-step-res").css("display") == "block") {
|
|
$(".first-step-res").slideUp(300);
|
|
} else if ($(".seventh-step-res").css("display") == "block") {
|
|
$(".seventh-step-res").slideUp(300);
|
|
}
|
|
if ($(".sixth-step-res").css("display") == "block") {
|
|
$(".arrow-changing3").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-down.svg"
|
|
);
|
|
}
|
|
setTimeout(() => {
|
|
if ($(".sixth-step-res").css("display") == "none") {
|
|
$(".arrow-changing3").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
setTimeout(() => {
|
|
if ($(".first-step-res").css("display") == "none") {
|
|
$(".arrow-changing1").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
setTimeout(() => {
|
|
if ($(".forth-step-res").css("display") == "none") {
|
|
$(".arrow-changing2").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
setTimeout(() => {
|
|
if ($(".seventh-step-res").css("display") == "none") {
|
|
$(".arrow-changing4").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
});
|
|
$(".forth-queen-res").click(function () {
|
|
$(".seventh-step-res").slideToggle(300);
|
|
if ($(".forth-step-res").css("display") == "block") {
|
|
$(".forth-step-res").slideUp(300);
|
|
} else if ($(".sixth-step-res").css("display") == "block") {
|
|
$(".sixth-step-res").slideUp(300);
|
|
} else if ($(".first-step-res").css("display") == "block") {
|
|
$(".first-step-res").slideUp(300);
|
|
}
|
|
if ($(".seventh-step-res").css("display") == "block") {
|
|
$(".arrow-changing4").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-down.svg"
|
|
);
|
|
}
|
|
setTimeout(() => {
|
|
if ($(".seventh-step-res").css("display") == "none") {
|
|
$(".arrow-changing4").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
setTimeout(() => {
|
|
if ($(".first-step-res").css("display") == "none") {
|
|
$(".arrow-changing1").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
setTimeout(() => {
|
|
if ($(".forth-step-res").css("display") == "none") {
|
|
$(".arrow-changing2").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
setTimeout(() => {
|
|
if ($(".sixth-step-res").css("display") == "none") {
|
|
$(".arrow-changing3").attr(
|
|
"src",
|
|
"./dist/images/new-design/arrow-left.svg"
|
|
);
|
|
}
|
|
}, 320);
|
|
});
|
|
$(".fivth-queen-res").click(function () {
|
|
$(".eight-step-res").slideToggle(300);
|
|
});
|
|
// samm coding end
|
|
|
|
function getWidth() {
|
|
return Math.max(
|
|
document.body.scrollWidth,
|
|
document.documentElement.scrollWidth,
|
|
document.body.offsetWidth,
|
|
document.documentElement.offsetWidth,
|
|
document.documentElement.clientWidth
|
|
);
|
|
}
|
|
|
|
console.log("Width: " + getWidth());
|