修改相關
This commit is contained in:
@@ -4,10 +4,14 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<title>上海丙维科技有限公司</title>
|
<title>上海丙维科技有限公司</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
var isMobile = isMobileWidth();
|
|
||||||
var isPhone = isPhoneWidth();
|
var isMobile = null;
|
||||||
|
var isPhone = null;
|
||||||
var wasMobile = isMobile;
|
var wasMobile = isMobile;
|
||||||
var wasDesktop = !isMobile;
|
var wasDesktop = !isMobile;
|
||||||
|
|
||||||
@@ -7,441 +8,420 @@ var isMiniHeader = false;
|
|||||||
|
|
||||||
var myLocationLat = null;
|
var myLocationLat = null;
|
||||||
var myLocationLong = null;
|
var myLocationLong = null;
|
||||||
|
|
||||||
$(document).ready(function() {
|
|
||||||
|
|
||||||
initListeners();
|
|
||||||
initHeader();
|
|
||||||
initForms();
|
|
||||||
initMobileMenu();
|
|
||||||
adjustElementsForScreen();
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
//create trigger to resizeEnd event, called after event is finished
|
class Common {
|
||||||
$(window).resize(function() {
|
constructor(name, age) {
|
||||||
if(this.resizeTO) clearTimeout(this.resizeTO);
|
this.name = name;
|
||||||
this.resizeTO = setTimeout(function() {
|
this.age = age;
|
||||||
$(this).trigger('resizeEnd');
|
}
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
|
|
||||||
//cdetermine scren type and call style functions after window resize is completed
|
init() {
|
||||||
$(window).on('resizeEnd', function() {
|
|
||||||
|
|
||||||
adjustElementsForScreen();
|
var self=this;
|
||||||
|
|
||||||
});
|
isMobile = common.isMobileWidth();
|
||||||
|
isPhone = common.isPhoneWidth();
|
||||||
|
|
||||||
$(window).scroll(function() {
|
//create trigger to resizeEnd event, called after event is finished
|
||||||
if($(window).scrollTop() > 200) {
|
$(window).resize(function () {
|
||||||
if(isMiniHeader === false && !isMobileWidth()) {
|
if (this.resizeTO) clearTimeout(this.resizeTO);
|
||||||
$('.header').addClass('mini');
|
this.resizeTO = setTimeout(function () {
|
||||||
isMiniHeader = true;
|
$(this).trigger('resizeEnd');
|
||||||
}
|
}, 100);
|
||||||
} else {
|
});
|
||||||
if(isMiniHeader === true) {
|
|
||||||
|
//cdetermine scren type and call style functions after window resize is completed
|
||||||
|
$(window).on('resizeEnd', function () {
|
||||||
|
|
||||||
|
self.adjustElementsForScreen();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$(window).scroll(function () {
|
||||||
|
if ($(window).scrollTop() > 200) {
|
||||||
|
if (isMiniHeader === false && !self.isMobileWidth()) {
|
||||||
|
$('.header').addClass('mini');
|
||||||
|
isMiniHeader = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isMiniHeader === true) {
|
||||||
|
$('.header').removeClass('mini');
|
||||||
|
isMiniHeader = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//var scroll = $(window).scrollTop();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$.scrollToElement = function ($element) {
|
||||||
|
|
||||||
|
var adjustment = 0;
|
||||||
|
if (isMiniHeader) {
|
||||||
|
adjustment = 35;
|
||||||
|
}
|
||||||
|
var $header = $('.header:first');
|
||||||
|
$('html,body').animate({ scrollTop: $element.offset().top - ($header.length > 0 ? $header.height() : 0) - adjustment }, 'slow');
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
adjustElementsForScreen() {
|
||||||
|
|
||||||
|
isMobile = this.isMobileWidth();
|
||||||
|
isPhone = this.isPhoneWidth();
|
||||||
|
|
||||||
|
if (!this.isMobileWidth()) {
|
||||||
|
$(".mobileContent").hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isMobile) wasMobile = true;
|
||||||
|
if (!isMobile) wasDesktop = true;
|
||||||
|
|
||||||
|
if (wasDesktop && isMobile) {
|
||||||
|
if (location.pathname.indexOf("index.php") === -1 && location.pathname.indexOf(".php") > -1) {
|
||||||
|
handleActivePage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (wasMobile && !isMobile) location.reload();
|
||||||
|
|
||||||
|
if (isMobile && isMiniHeader === true) {
|
||||||
$('.header').removeClass('mini');
|
$('.header').removeClass('mini');
|
||||||
isMiniHeader = false;
|
isMiniHeader = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
//var scroll = $(window).scrollTop();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
//adjust 'find us' Google Maps links as user location not always located accurately on desktop
|
||||||
|
if (isMobile) {
|
||||||
|
$(".findUsSweden").attr("href", "https://www.google.com/maps/dir/?api=1&destination=Pythagoras+AB,+S%C3%B6der+M%C3%A4larstrand+27+B,+118+25+Stockholm");
|
||||||
|
$(".findUsUK").attr("href", "https://www.google.com/maps/dir/?api=1&destination=180+Piccadilly,+St.+James's,+London+W1J+9HF,+UK");
|
||||||
|
$(".findUsNorway").attr("href", "https://www.google.com/maps/dir/?api=1&destination=Skogliveien+4a,+3047+Drammen,+Norway");
|
||||||
|
} else {
|
||||||
|
$(".findUsSweden").attr("href", "https://www.google.com/maps/dir//Pythagoras+AB,+S%C3%B6der+M%C3%A4larstrand+27+B,+118+25+Stockholm");
|
||||||
|
$(".findUsUK").attr("href", "https://www.google.com/maps/dir//180+Piccadilly,+St.+James's,+London+W1J+9HF,+UK");
|
||||||
|
$(".findUsNorway").attr("href", "https://www.google.com/maps/dir//Skogliveien+4a,+3047+Drammen,+Norway");
|
||||||
|
}
|
||||||
|
|
||||||
function adjustElementsForScreen() {
|
this.adjustContentBannersForScreen();
|
||||||
|
|
||||||
isMobile = isMobileWidth();
|
|
||||||
isPhone = isPhoneWidth();
|
|
||||||
|
|
||||||
if (!isMobileWidth()) {
|
|
||||||
$(".mobileContent").hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isMobile) wasMobile = true;
|
|
||||||
if (!isMobile) wasDesktop = true;
|
|
||||||
|
|
||||||
if (wasDesktop && isMobile) {
|
|
||||||
if (location.pathname.indexOf("index.php") === -1 && location.pathname.indexOf(".php") > -1) {
|
|
||||||
handleActivePage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (wasMobile && !isMobile) location.reload();
|
|
||||||
|
|
||||||
if (isMobile && isMiniHeader === true) {
|
initHeader() {
|
||||||
$('.header').removeClass('mini');
|
|
||||||
isMiniHeader = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//adjust 'find us' Google Maps links as user location not always located accurately on desktop
|
//go to main page if not there on logo click
|
||||||
if (isMobile) {
|
$(".logoCell .logo").on("click", function () {
|
||||||
$(".findUsSweden").attr("href", "https://www.google.com/maps/dir/?api=1&destination=Pythagoras+AB,+S%C3%B6der+M%C3%A4larstrand+27+B,+118+25+Stockholm");
|
if (window.location.href.indexOf("index.php") === -1) {
|
||||||
$(".findUsUK").attr("href", "https://www.google.com/maps/dir/?api=1&destination=180+Piccadilly,+St.+James's,+London+W1J+9HF,+UK");
|
window.location.href = "index.php";
|
||||||
$(".findUsNorway").attr("href", "https://www.google.com/maps/dir/?api=1&destination=Skogliveien+4a,+3047+Drammen,+Norway");
|
}
|
||||||
}else{
|
|
||||||
$(".findUsSweden").attr("href", "https://www.google.com/maps/dir//Pythagoras+AB,+S%C3%B6der+M%C3%A4larstrand+27+B,+118+25+Stockholm");
|
|
||||||
$(".findUsUK").attr("href", "https://www.google.com/maps/dir//180+Piccadilly,+St.+James's,+London+W1J+9HF,+UK");
|
|
||||||
$(".findUsNorway").attr("href", "https://www.google.com/maps/dir//Skogliveien+4a,+3047+Drammen,+Norway");
|
|
||||||
}
|
|
||||||
|
|
||||||
adjustContentBannersForScreen();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function initHeader() {
|
|
||||||
|
|
||||||
//go to main page if not there on logo click
|
|
||||||
$(".logoCell .logo").on("click", function() {
|
|
||||||
if (window.location.href.indexOf("index.php") === -1) {
|
|
||||||
window.location.href = "index.php";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
//show/hide main menu dropdowns on hover
|
|
||||||
$(".mainMenu > tbody > tr > td")
|
|
||||||
.on("mouseenter", function(e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
$(".dropDown").hide();
|
|
||||||
$("table.mainMenu > tbody > tr > td.selected").css("box-shadow", "none");
|
|
||||||
$(this).find(".dropDown").addClass("droppedDown");
|
|
||||||
$(this).find(".dropDown").slideDown();
|
|
||||||
})
|
|
||||||
.on("mouseleave", function(e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
$(this).find(".dropDown").removeClass("droppedDown");
|
|
||||||
$(this).find(".dropDown").hide();
|
|
||||||
$("table.mainMenu > tbody > tr > td.selected").css("box-shadow", "0 -3px 0 #ff0000 inset");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
highlightHeaderCategory();
|
//show/hide main menu dropdowns on hover
|
||||||
|
$(".mainMenu > tbody > tr > td")
|
||||||
|
.on("mouseenter", function (e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
$(".dropDown").hide();
|
||||||
|
$("table.mainMenu > tbody > tr > td.selected").css("box-shadow", "none");
|
||||||
|
$(this).find(".dropDown").addClass("droppedDown");
|
||||||
|
$(this).find(".dropDown").slideDown();
|
||||||
|
})
|
||||||
|
.on("mouseleave", function (e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
$(this).find(".dropDown").removeClass("droppedDown");
|
||||||
|
$(this).find(".dropDown").hide();
|
||||||
|
$("table.mainMenu > tbody > tr > td.selected").css("box-shadow", "0 -3px 0 #ff0000 inset");
|
||||||
|
});
|
||||||
|
|
||||||
}
|
this.highlightHeaderCategory();
|
||||||
|
|
||||||
//highlight the appproprate main header meny category by examing url
|
|
||||||
function highlightHeaderCategory() {
|
|
||||||
|
|
||||||
var myLocation = location.pathname;
|
|
||||||
|
|
||||||
//console.log("My location: " + myLocation);
|
|
||||||
|
|
||||||
if (myLocation.indexOf("index.php") !== -1) {
|
|
||||||
$("#mainMenuGroup0").addClass("selected");
|
|
||||||
}else if (
|
|
||||||
myLocation.indexOf("/fm-") !== -1 ||
|
|
||||||
myLocation.indexOf("/prs-") !== -1 ||
|
|
||||||
myLocation.indexOf("/lvh-") !== -1 ||
|
|
||||||
myLocation.indexOf("/fas-") !== -1 ||
|
|
||||||
myLocation.indexOf("/sb-") !== -1 ||
|
|
||||||
myLocation.indexOf("/tek-") !== -1) {
|
|
||||||
$("#mainMenuGroup1").addClass("selected");
|
|
||||||
}else if (
|
|
||||||
myLocation.indexOf("/mobila-losningar.php") !== -1 ||
|
|
||||||
myLocation.indexOf("/ifrs16.php") !== -1 ||
|
|
||||||
myLocation.indexOf("/gdpr.php") !== -1) {
|
|
||||||
$("#mainMenuGroup2").addClass("selected");
|
|
||||||
}else if (
|
|
||||||
myLocation.indexOf("/det-har-ar-pythagoras.php") !== -1 ||
|
|
||||||
myLocation.indexOf("/kontakta-oss.php") !== -1 ||
|
|
||||||
myLocation.indexOf("/jobba-hos-oss.php") !== -1) {
|
|
||||||
$("#mainMenuGroup3").addClass("selected");
|
|
||||||
}else if (myLocation.indexOf(".php") === -1){
|
|
||||||
$("#mainMenuGroup0").addClass("selected");
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//event listners for elements
|
highlightHeaderCategory() {
|
||||||
function initListeners() {
|
|
||||||
|
|
||||||
$("#hamburger").on("click", function() {
|
var myLocation = location.pathname;
|
||||||
|
|
||||||
if ($("#mobileLanguageMenu").hasClass("showing")) {
|
//console.log("My location: " + myLocation);
|
||||||
$("#mobileLanguageMenu").hide();
|
|
||||||
$("#mobileLanguageMenu").removeClass("showing");
|
if (myLocation.indexOf("index.php") !== -1) {
|
||||||
|
$("#mainMenuGroup0").addClass("selected");
|
||||||
|
} else if (
|
||||||
|
myLocation.indexOf("/fm-") !== -1 ||
|
||||||
|
myLocation.indexOf("/prs-") !== -1 ||
|
||||||
|
myLocation.indexOf("/lvh-") !== -1 ||
|
||||||
|
myLocation.indexOf("/fas-") !== -1 ||
|
||||||
|
myLocation.indexOf("/sb-") !== -1 ||
|
||||||
|
myLocation.indexOf("/tek-") !== -1) {
|
||||||
|
$("#mainMenuGroup1").addClass("selected");
|
||||||
|
} else if (
|
||||||
|
myLocation.indexOf("/mobila-losningar.php") !== -1 ||
|
||||||
|
myLocation.indexOf("/ifrs16.php") !== -1 ||
|
||||||
|
myLocation.indexOf("/gdpr.php") !== -1) {
|
||||||
|
$("#mainMenuGroup2").addClass("selected");
|
||||||
|
} else if (
|
||||||
|
myLocation.indexOf("/det-har-ar-pythagoras.php") !== -1 ||
|
||||||
|
myLocation.indexOf("/kontakta-oss.php") !== -1 ||
|
||||||
|
myLocation.indexOf("/jobba-hos-oss.php") !== -1) {
|
||||||
|
$("#mainMenuGroup3").addClass("selected");
|
||||||
|
} else if (myLocation.indexOf(".php") === -1) {
|
||||||
|
$("#mainMenuGroup0").addClass("selected");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($("#mobileMenu").hasClass("showing")) {
|
initListeners() {
|
||||||
hideMobileMenu();
|
|
||||||
}else{
|
|
||||||
showMobileMenu();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#mobileLanguage").on("click", function(e) {
|
$("#hamburger").on("click", function () {
|
||||||
|
|
||||||
if ($("#mobileMenu").hasClass("showing")) {
|
if ($("#mobileLanguageMenu").hasClass("showing")) {
|
||||||
$("#mobileMenu").hide();
|
$("#mobileLanguageMenu").hide();
|
||||||
$("#mobileMenu").removeClass("showing");
|
$("#mobileLanguageMenu").removeClass("showing");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($("#mobileLanguageMenu").hasClass("showing")) {
|
if ($("#mobileMenu").hasClass("showing")) {
|
||||||
hideMobileLanguageMenu();
|
hideMobileMenu();
|
||||||
}else{
|
} else {
|
||||||
showMobileLanguageMenu();
|
showMobileMenu();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
$("#mobileLanguage").on("click", function (e) {
|
||||||
|
|
||||||
$("#screenOverlayBehindHeader, .linkGoBack").on("click", function(e) {
|
if ($("#mobileMenu").hasClass("showing")) {
|
||||||
if ($("#mobileMenu").hasClass("showing")) {
|
$("#mobileMenu").hide();
|
||||||
hideMobileMenu();
|
$("#mobileMenu").removeClass("showing");
|
||||||
}
|
}
|
||||||
if ($("#mobileLanguageMenu").hasClass("showing")) {
|
|
||||||
hideMobileLanguageMenu();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#mobileLanguageMenu a").on("click", function(e) {
|
if ($("#mobileLanguageMenu").hasClass("showing")) {
|
||||||
e.preventDefault();
|
hideMobileLanguageMenu();
|
||||||
});
|
} else {
|
||||||
|
showMobileLanguageMenu();
|
||||||
|
}
|
||||||
|
|
||||||
//show support form
|
});
|
||||||
$("a.linkSupport").on("click", function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
showForm("support");
|
|
||||||
});
|
|
||||||
|
|
||||||
//show contact form
|
|
||||||
$("a.linkContactUs").on("click", function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
showForm("contact");
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#scrollToBoxes").on("click", function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
$.scrollToElement($("#pageBoxesContainer"));
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$('.cookiesInfo').children('input[type=button]').on('click', function(){
|
$("#screenOverlayBehindHeader, .linkGoBack").on("click", function (e) {
|
||||||
$(this).parent().remove();
|
if ($("#mobileMenu").hasClass("showing")) {
|
||||||
});
|
hideMobileMenu();
|
||||||
|
}
|
||||||
|
if ($("#mobileLanguageMenu").hasClass("showing")) {
|
||||||
|
hideMobileLanguageMenu();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
//location
|
$("#mobileLanguageMenu a").on("click", function (e) {
|
||||||
/*$("#ourLocationSweden").on("click", function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
navigateTo("sweden", $(this));
|
|
||||||
});*/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function initMobileMenu() {
|
|
||||||
$("#mobileMenu a").on("click", function(e) {
|
|
||||||
|
|
||||||
if ($(this).hasClass("hasSubmenu")) {
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$("#mobileMenu .subMenu").not($(this).siblings()).slideUp();
|
|
||||||
$(".hasSubmenu").not($(this)).css("font-weight", "normal");
|
|
||||||
$(this).css("font-weight", "bold");
|
|
||||||
//$(this).parent().css("border-bottom", "none");
|
|
||||||
$(this).parent().find(".subMenu").slideDown();
|
|
||||||
|
|
||||||
}else{
|
|
||||||
hideMobileMenu();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function initForms() {
|
|
||||||
|
|
||||||
|
|
||||||
$(".btnQuitForm").on("click", function() {
|
|
||||||
$("#forms").hide();
|
|
||||||
$("#screenOverlay").hide();
|
|
||||||
$("#formContactContainer").hide();
|
|
||||||
$("#formSupportContainer").hide();
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#formSupport").on("submit", function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
submitSupportForm($(this));
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#formContact").on("submit", function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
submitContactForm($(this));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function showForm(formName) {
|
|
||||||
|
|
||||||
$("#forms").show();
|
|
||||||
$("#screenOverlay").show();
|
|
||||||
|
|
||||||
$(".contactTable").show();
|
|
||||||
$(".formInputContainer").show();
|
|
||||||
$(".formResultContainer").hide();
|
|
||||||
|
|
||||||
if (formName === "contact") {
|
|
||||||
var $conCommentsTitle = $("label[for='conComments']");
|
|
||||||
console.log($(".contentTableRight").find("[data-contact-link]").data("contact-link"));
|
|
||||||
if ($(".contentTableRight").find("[data-contact-link]").length) {
|
|
||||||
$conCommentsTitle.html("Berätta vad du vill veta mer om gällande " +
|
|
||||||
$(".contentTableRight").find("[data-contact-link]").data("contact-link") + ": *");
|
|
||||||
}else{
|
|
||||||
$conCommentsTitle.html("Vad vill du veta mer om: ");
|
|
||||||
}
|
|
||||||
$("#formContactContainer").show();
|
|
||||||
} else if (formName === "support") {
|
|
||||||
$("#formSupportContainer").show();
|
|
||||||
}
|
|
||||||
|
|
||||||
scrollToTop();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function submitSupportForm(form) {
|
|
||||||
|
|
||||||
$.post("http://biz199.inmotionhosting.com/~rustyt6/pythagoras/php/submit_support_form.php",
|
|
||||||
{
|
|
||||||
subject: $("#supSubject").val(),
|
|
||||||
company: $("#supCompany").val(),
|
|
||||||
name: $("#supName").val(),
|
|
||||||
email: $("#supEmail").val(),
|
|
||||||
phone: $("#supPhone").val(),
|
|
||||||
product: $("#supProduct").val(),
|
|
||||||
comments: $("#supComments").val()
|
|
||||||
},
|
|
||||||
function(data) {
|
|
||||||
console.log(data);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
$(".formInputContainer").hide();
|
|
||||||
$(".formResultContainer").show();
|
|
||||||
scrollToTop();
|
|
||||||
|
|
||||||
$("#supSubject").val("");
|
|
||||||
$("#supCompany").val("");
|
|
||||||
$("#supName").val("");
|
|
||||||
$("#supEmail").val("");
|
|
||||||
$("#supPhone").val("");
|
|
||||||
$("#supProduct").val("");
|
|
||||||
$("#supComments").val("");
|
|
||||||
}
|
|
||||||
|
|
||||||
function submitContactForm(form) {
|
|
||||||
|
|
||||||
$.post("http://biz199.inmotionhosting.com/~rustyt6/pythagoras/php/submit_contact_form.php",
|
|
||||||
{
|
|
||||||
name: $("#conName").val(),
|
|
||||||
email: $("#conEmail").val(),
|
|
||||||
phone: $("#conPhone").val(),
|
|
||||||
comments: $("#conComments").val()
|
|
||||||
},
|
|
||||||
function(data) {
|
|
||||||
console.log(data);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
$(".contactTable").hide();
|
|
||||||
$(".formResultContainer").show();
|
|
||||||
scrollToTop();
|
|
||||||
|
|
||||||
$("#conName").val("");
|
|
||||||
$("#conEmail").val("");
|
|
||||||
$("#conPhone").val("");
|
|
||||||
$("#conComments").val("");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function adjustContentBannersForScreen() {
|
|
||||||
|
|
||||||
if (isMobileWidth()) {
|
|
||||||
$("#pageBannerImage1").attr("src", "images/banner_page_mobile_solutions_mobile.jpg");
|
|
||||||
$("#pageBannerImage2").attr("src", "images/banner_page_ifrs16_mobile.jpg");
|
|
||||||
$("#pageBannerImage3").attr("src", "images/banner_page_gdpr_mobile.jpg");
|
|
||||||
}else{
|
|
||||||
$("#pageBannerImage1").attr("src", "images/banner_page_mobile_solutions.jpg");
|
|
||||||
$("#pageBannerImage2").attr("src", "images/banner_page_ifrs16.jpg");
|
|
||||||
$("#pageBannerImage3").attr("src", "images/banner_page_gdpr.jpg");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*function navigateTo(destination, $element) {
|
|
||||||
|
|
||||||
var baseAddress = "https://www.google.com/maps/dir/";
|
|
||||||
|
|
||||||
var addressSweden = "Pythagoras+AB,+S%C3%B6der+M%C3%A4larstrand+27+B,+118+25+Stockholm";
|
|
||||||
|
|
||||||
if (myLocationLat == null || myLocationLong == null) {
|
|
||||||
getUserLocationForDirections();
|
|
||||||
}else{
|
|
||||||
if ($element.attr("href").length <= 1) {
|
|
||||||
$element.attr("href", baseAddress + myLocationLat + "," + myLocationLong + "/" + addressSweden);
|
|
||||||
}
|
|
||||||
console.log($element.attr("href"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function getUserLocationForDirections() {
|
|
||||||
$.post("https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyB04D7_YYzWb3y3TDtVr-FR3rkBHSV6oOg",
|
|
||||||
function(data){
|
|
||||||
console.log(data);
|
|
||||||
myLocationLat = data.location.lat;
|
|
||||||
myLocationLong = data.location.lng;
|
|
||||||
console.log(myLocationLat, myLocationLong);
|
|
||||||
//setupDirections();
|
|
||||||
//https://www.google.com/maps/dir/?api=1&destination=Pythagoras+AB,+S%C3%B6der+M%C3%A4larstrand+27+B,+118+25+Stockholm
|
|
||||||
});
|
});
|
||||||
}*/
|
|
||||||
|
|
||||||
function showMobileMenu() {
|
//show support form
|
||||||
$("#screenOverlayBehindHeader").show();
|
$("a.linkSupport").on("click", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
showForm("support");
|
||||||
|
});
|
||||||
|
|
||||||
$("#mobileMenu").slideDown();
|
//show contact form
|
||||||
$("#mobileMenu").addClass("showing");
|
$("a.linkContactUs").on("click", function (e) {
|
||||||
}
|
e.preventDefault();
|
||||||
|
showForm("contact");
|
||||||
|
});
|
||||||
|
|
||||||
function hideMobileMenu() {
|
$("#scrollToBoxes").on("click", function (e) {
|
||||||
$("#mobileMenu").slideUp(function(){
|
e.preventDefault();
|
||||||
$("#screenOverlayBehindHeader").hide();
|
$.scrollToElement($("#pageBoxesContainer"));
|
||||||
});
|
});
|
||||||
$("#mobileMenu").removeClass("showing");
|
|
||||||
}
|
|
||||||
|
|
||||||
function showMobileLanguageMenu() {
|
|
||||||
$("#screenOverlayBehindHeader").show();
|
|
||||||
|
|
||||||
$("#mobileLanguageMenu").slideDown();
|
$('.cookiesInfo').children('input[type=button]').on('click', function () {
|
||||||
$("#mobileLanguageMenu").addClass("showing");
|
$(this).parent().remove();
|
||||||
}
|
});
|
||||||
|
|
||||||
function hideMobileLanguageMenu() {
|
|
||||||
$("#mobileLanguageMenu").slideUp(function(){
|
|
||||||
$("#screenOverlayBehindHeader").hide();
|
|
||||||
});
|
|
||||||
$("#mobileLanguageMenu").removeClass("showing");
|
|
||||||
}
|
|
||||||
|
|
||||||
$.scrollToElement = function($element){
|
|
||||||
|
|
||||||
var adjustment = 0;
|
|
||||||
if (isMiniHeader) {
|
|
||||||
adjustment = 35;
|
|
||||||
}
|
}
|
||||||
var $header = $('.header:first');
|
|
||||||
$('html,body').animate({scrollTop: $element.offset().top-($header.length > 0 ? $header.height() : 0) - adjustment}, 'slow');
|
|
||||||
};
|
|
||||||
|
|
||||||
//scroll page to top
|
initMobileMenu() {
|
||||||
function scrollToTop() {
|
$("#mobileMenu a").on("click", function (e) {
|
||||||
$("body,html").animate({ scrollTop: 0 }, "slow");
|
|
||||||
|
if ($(this).hasClass("hasSubmenu")) {
|
||||||
|
e.preventDefault();
|
||||||
|
$("#mobileMenu .subMenu").not($(this).siblings()).slideUp();
|
||||||
|
$(".hasSubmenu").not($(this)).css("font-weight", "normal");
|
||||||
|
$(this).css("font-weight", "bold");
|
||||||
|
//$(this).parent().css("border-bottom", "none");
|
||||||
|
$(this).parent().find(".subMenu").slideDown();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
hideMobileMenu();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
initForms() {
|
||||||
|
|
||||||
|
|
||||||
|
$(".btnQuitForm").on("click", function () {
|
||||||
|
$("#forms").hide();
|
||||||
|
$("#screenOverlay").hide();
|
||||||
|
$("#formContactContainer").hide();
|
||||||
|
$("#formSupportContainer").hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#formSupport").on("submit", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
submitSupportForm($(this));
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#formContact").on("submit", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
submitContactForm($(this));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
showForm(formName) {
|
||||||
|
|
||||||
|
$("#forms").show();
|
||||||
|
$("#screenOverlay").show();
|
||||||
|
|
||||||
|
$(".contactTable").show();
|
||||||
|
$(".formInputContainer").show();
|
||||||
|
$(".formResultContainer").hide();
|
||||||
|
|
||||||
|
if (formName === "contact") {
|
||||||
|
var $conCommentsTitle = $("label[for='conComments']");
|
||||||
|
console.log($(".contentTableRight").find("[data-contact-link]").data("contact-link"));
|
||||||
|
if ($(".contentTableRight").find("[data-contact-link]").length) {
|
||||||
|
$conCommentsTitle.html("Berätta vad du vill veta mer om gällande " +
|
||||||
|
$(".contentTableRight").find("[data-contact-link]").data("contact-link") + ": *");
|
||||||
|
} else {
|
||||||
|
$conCommentsTitle.html("Vad vill du veta mer om: ");
|
||||||
|
}
|
||||||
|
$("#formContactContainer").show();
|
||||||
|
} else if (formName === "support") {
|
||||||
|
$("#formSupportContainer").show();
|
||||||
|
}
|
||||||
|
|
||||||
|
scrollToTop();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
submitSupportForm(form) {
|
||||||
|
|
||||||
|
$.post("http://biz199.inmotionhosting.com/~rustyt6/pythagoras/php/submit_support_form.php",
|
||||||
|
{
|
||||||
|
subject: $("#supSubject").val(),
|
||||||
|
company: $("#supCompany").val(),
|
||||||
|
name: $("#supName").val(),
|
||||||
|
email: $("#supEmail").val(),
|
||||||
|
phone: $("#supPhone").val(),
|
||||||
|
product: $("#supProduct").val(),
|
||||||
|
comments: $("#supComments").val()
|
||||||
|
},
|
||||||
|
function (data) {
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
$(".formInputContainer").hide();
|
||||||
|
$(".formResultContainer").show();
|
||||||
|
scrollToTop();
|
||||||
|
|
||||||
|
$("#supSubject").val("");
|
||||||
|
$("#supCompany").val("");
|
||||||
|
$("#supName").val("");
|
||||||
|
$("#supEmail").val("");
|
||||||
|
$("#supPhone").val("");
|
||||||
|
$("#supProduct").val("");
|
||||||
|
$("#supComments").val("");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
submitContactForm(form) {
|
||||||
|
|
||||||
|
$.post("http://biz199.inmotionhosting.com/~rustyt6/pythagoras/php/submit_contact_form.php",
|
||||||
|
{
|
||||||
|
name: $("#conName").val(),
|
||||||
|
email: $("#conEmail").val(),
|
||||||
|
phone: $("#conPhone").val(),
|
||||||
|
comments: $("#conComments").val()
|
||||||
|
},
|
||||||
|
function (data) {
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
$(".contactTable").hide();
|
||||||
|
$(".formResultContainer").show();
|
||||||
|
scrollToTop();
|
||||||
|
|
||||||
|
$("#conName").val("");
|
||||||
|
$("#conEmail").val("");
|
||||||
|
$("#conPhone").val("");
|
||||||
|
$("#conComments").val("");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
adjustContentBannersForScreen() {
|
||||||
|
|
||||||
|
if (this.isMobileWidth()) {
|
||||||
|
$("#pageBannerImage1").attr("src", "images/banner_page_mobile_solutions_mobile.jpg");
|
||||||
|
$("#pageBannerImage2").attr("src", "images/banner_page_ifrs16_mobile.jpg");
|
||||||
|
$("#pageBannerImage3").attr("src", "images/banner_page_gdpr_mobile.jpg");
|
||||||
|
} else {
|
||||||
|
$("#pageBannerImage1").attr("src", "images/banner_page_mobile_solutions.jpg");
|
||||||
|
$("#pageBannerImage2").attr("src", "images/banner_page_ifrs16.jpg");
|
||||||
|
$("#pageBannerImage3").attr("src", "images/banner_page_gdpr.jpg");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
showMobileMenu() {
|
||||||
|
$("#screenOverlayBehindHeader").show();
|
||||||
|
|
||||||
|
$("#mobileMenu").slideDown();
|
||||||
|
$("#mobileMenu").addClass("showing");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
hideMobileMenu() {
|
||||||
|
$("#mobileMenu").slideUp(function () {
|
||||||
|
$("#screenOverlayBehindHeader").hide();
|
||||||
|
});
|
||||||
|
$("#mobileMenu").removeClass("showing");
|
||||||
|
}
|
||||||
|
|
||||||
|
showMobileLanguageMenu() {
|
||||||
|
$("#screenOverlayBehindHeader").show();
|
||||||
|
|
||||||
|
$("#mobileLanguageMenu").slideDown();
|
||||||
|
$("#mobileLanguageMenu").addClass("showing");
|
||||||
|
}
|
||||||
|
|
||||||
|
hideMobileLanguageMenu() {
|
||||||
|
$("#mobileLanguageMenu").slideUp(function () {
|
||||||
|
$("#screenOverlayBehindHeader").hide();
|
||||||
|
});
|
||||||
|
$("#mobileLanguageMenu").removeClass("showing");
|
||||||
|
}
|
||||||
|
|
||||||
|
scrollToTop() {
|
||||||
|
$("body,html").animate({ scrollTop: 0 }, "slow");
|
||||||
|
}
|
||||||
|
|
||||||
|
isMobileWidth() {
|
||||||
|
return $('#mobile_indicator').is(':visible');
|
||||||
|
}
|
||||||
|
|
||||||
|
isPhoneWidth() {
|
||||||
|
return $('#phone_indicator').is(':visible');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//is screen mobile? (<= 768 px)
|
|
||||||
//#mobile_indicator is show/hidden via media query
|
|
||||||
function isMobileWidth() {
|
|
||||||
return $('#mobile_indicator').is(':visible');
|
|
||||||
}
|
|
||||||
|
|
||||||
//is screen phone? (<= 480 px)
|
export const common = new Common();
|
||||||
//#mobile_indicator is show/hidden via media query
|
|
||||||
function isPhoneWidth() {
|
|
||||||
return $('#phone_indicator').is(':visible');
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -87,11 +87,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { common } from "../assets/static/common";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
menus: window.config.menus
|
menus: window.config.menus
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
mounted: function() {
|
||||||
|
common.init();
|
||||||
|
common.initListeners();
|
||||||
|
common.initHeader();
|
||||||
|
common.initForms();
|
||||||
|
common.initMobileMenu();
|
||||||
|
common.adjustElementsForScreen();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'swiper/dist/css/swiper.css'
|
|||||||
|
|
||||||
import './assets/static/config.js'
|
import './assets/static/config.js'
|
||||||
import './assets/static/jquery.js'
|
import './assets/static/jquery.js'
|
||||||
|
import './assets/static/common.js'
|
||||||
|
|
||||||
import 'es6-promise/auto'
|
import 'es6-promise/auto'
|
||||||
|
|
||||||
|
|||||||
@@ -110,10 +110,10 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onSlideChangeStart(currentPage) {
|
onSlideChangeStart(currentPage) {
|
||||||
console.log("onSlideChangeStart", currentPage);
|
|
||||||
},
|
},
|
||||||
onSlideChangeEnd(currentPage) {
|
onSlideChangeEnd(currentPage) {
|
||||||
console.log("onSlideChangeEnd", currentPage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<ihead></ihead>
|
<ihead></ihead>
|
||||||
<div class="contentPage">
|
<div class="contentPage">
|
||||||
|
|
||||||
<div class="contentTable">
|
<div class="contentTable">
|
||||||
<leftMenu> </leftMenu>
|
<leftMenu> </leftMenu>
|
||||||
<icontent></icontent>
|
<icontent></icontent>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ifooter></ifooter>
|
<ifooter></ifooter>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<ihead></ihead>
|
<ihead></ihead>
|
||||||
<div class="contentPage">
|
<div class="contentPage">
|
||||||
|
|
||||||
<div class="contentTable">
|
<div class="contentTable">
|
||||||
<leftMenu> </leftMenu>
|
<leftMenu> </leftMenu>
|
||||||
<icontent></icontent>
|
<icontent></icontent>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<ifooter></ifooter>
|
|
||||||
</div>
|
</div>
|
||||||
|
<ifooter></ifooter>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
Reference in New Issue
Block a user