'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
$(document).ready(function () {
window.lang = document.documentElement.lang;
$.plugin = {
NUMBER_plus: function NUMBER_plus(obj, set_num, speed) {
if (!speed) speed = 60;
if (!set_num) set_num = 50;
var scroll_lock = true;
$(window).scroll(function () {
if ($(document).scrollTop() + $(window).height() > obj.offset().top && obj.offset().top + obj.innerHeight() > $(document).scrollTop() && scroll_lock) {
scroll_lock = false;
var time_lock = 0,
This = obj.find('li'),
// 获取对象
num = []; // 数据容器
var set_plus = setInterval(function () {
// 数字相加
This.each(function (index) {
if (!num[index]) num[index] = $(this).find('em').attr('data-num') * 1 / set_num;else num[index] += $(this).find('em').attr('data-num') * 1 / set_num;
$(this).find('em').text(parseInt(num[index]));
if (num[index] > $(this).find('em').attr('data-num') * 1) {
$(this).find('em').text($(this).find('em').attr('data-num') * 1);
time_lock++;
}
});
if (time_lock >= num.length) {
// 清理多余执行
clearInterval(set_plus);
}
}, speed);
}
});
},
BG_parallax: function BG_parallax(obj, speed) {
if (!speed) speed = .5;
$(window).scroll(function () {
obj.css({
'background-position-y': (obj.offset().top + obj.innerHeight() / 2 - ($(document).scrollTop() + $(window).height() / 2)) * speed
});
});
},
Interval_Fun: function Interval_Fun(obj, means, cycle, position) {
if (!position) position = 2;
if (!cycle) var cycle_num = 0;
$(window).scroll(function () {
if (obj.offset().top + obj.innerHeight() / position < $(document).scrollTop() + $(window).height() && obj.offset().top + obj.innerHeight() / position > $(document).scrollTop()) {
cycle_num++;
if (!cycle && cycle_num <= 1) means();else if (cycle) means();
}
});
},
Video_open: function Video_open(obj) {
var src,
btn,
img,
tag,
method = obj.attr('data-mode');
if (obj.attr('data-src')) src = obj.attr('data-src');else return;
if (obj.attr('data-img')) img = obj.attr('data-img');
btn = obj.attr('data-btn') ? obj.attr('data-btn') : '#000';
if (!method) tag = ' ';else tag = '';
var video = "
" + tag + "
",
css = "";
obj.click(function () {
$("body").append(video).append(css).animate(200, function () {
$(".video_box").add($(".video_mask")).removeClass('active');
});
$("i.video_mask").add($("i.video_close")).one('click', function () {
$(".video_box").add($("i.video_mask")).add($("#video_css")).remove();
});
});
},
Pop_Ups: function Pop_Ups(obj, model, btn_, lang) {
lang = {
lang: window.lang,
title: 'Submit feedback',
name: 'Name',
mail: 'Email',
phone: 'Phone',
message: 'Message',
send: 'Send'
};
switch (lang.lang) {
case 'cn':
lang['title'] = '留言反馈';lang['name'] = '姓名';lang['mail'] = '邮箱';lang['phone'] = '电话';lang['message'] = '留言内容';lang['send'] = '立即提交';
break;
case 'ru':
lang['title'] = 'Обратная связь';lang['name'] = 'Имя';lang['mail'] = 'Почта';lang['phone'] = 'телефон';lang['message'] = 'Содержание сообщения';lang['send'] = 'Отправить сейчас';
break;
case 'es':
lang['title'] = 'Realimentación';lang['name'] = 'Nombre';lang['mail'] = 'Correo';lang['phone'] = 'Teléfono';lang['message'] = 'Contenido del mensaje';lang['send'] = 'Aplique ahora';
break;
case 'sa':
lang['title'] = 'ردود الفعل';lang['name'] = 'اسم';lang['mail'] = 'بريد';lang['phone'] = 'هاتف';lang['message'] = 'محتوى الرسالة';lang['send'] = 'أرسل الآن';
break;
case 'de':
lang['title'] = 'Feedback';lang['name'] = 'Name';lang['mail'] = 'Email';lang['phone'] = 'Telefon';lang['message'] = 'Nachrichteninhalt';lang['send'] = 'Jetzt Absenden';
break;
case 'jp':
lang['title'] = 'フィードバック';lang['name'] = '名前';lang['mail'] = 'Eメール';lang['phone'] = '電話';lang['message'] = 'メッセージの内容';lang['send'] = 'メッセージを送る';
break;
case 'kr':
lang['title'] = '피드백';lang['name'] = '이름';lang['mail'] = '우편';lang['phone'] = '전화';lang['message'] = '메시지 내용';lang['send'] = '지금 제출';
break;
case 'fr':
lang['title'] = 'Retour d\'information';lang['name'] = 'Nom';lang['mail'] = 'Courrier';lang['phone'] = 'Téléphone';lang['message'] = 'Contenu du message';lang['send'] = 'Soumettre maintenant';
break;
}
var css = '',
html = '\n' + '
' + lang.title + ' \n' + '
\n' + '
',
btn = '
',
lock = true,
model_form = false,
model_url = '';
$("body").append(css).append(html);
$.getScript('/static/js/layer/layer.js', function (response, status) {
if (status === 'success') {
lock = false;
}
});
if (btn_) {
$("body").append(btn);
}
(obj ? obj : $("#Pop_UpsBtn")).on('click', function (e) {
if (model && !model_form) {
e.preventDefault();
e.stopPropagation();
model_url = $(this).attr('href') ? $(this).attr('href') : $(this).find('a').attr('href');
}
if (!model_form) $("#pups_from").stop().fadeToggle(200);
});
$("#pups_from i.close").on('click', function () {
$("#pups_from").stop().fadeToggle(200);
});
$("#pups_from form input[type=submit]").on('click', function () {
layer.load(0, { shade: 0.1, shadeClose: false });
$.ajax({
type: 'post',
url: '/Api/contact/submit/uid/1.html',
data: $("#pups_from form").serialize(),
dataType: 'json',
success: function success(data) {
layer.closeAll();
if (data.status == 200) {
layer.msg(data.result, { icon: 1, time: 4000 });
if (model && !model_form) {
model_form = true;
$("#pups_from").stop().fadeToggle(200);
var a = document.createElement('a');
a.setAttribute('href', model_url);
a.setAttribute('download', '');
document.body.appendChild(a);
a.click();
a.remove();
}
} else {
layer.msg(data.result, { icon: 2, time: 4000 });
}
}
});
});
},
resumeForm: function resumeForm(obj) {
var html = '应聘岗位* : 填表日期* :
' + ' ';
$("body").append(html);
$(document).on('click', '#resume input[type="button"].close', function () {
$("#resume").fadeOut(200);
});
obj.click(function () {
$("#resume").fadeIn(200);
});
var file = document.body.querySelector("#resume input[type='file']");
file.onchange = function () {
if (window.FileReader) {
var reader = new FileReader();
reader.readAsDataURL(file.files[0]);
//监听文件读取结束后事件
reader.onloadend = function (e) {
var base64String = e.target.result;
$("#resume label[for='img']").html(' ');
};
}
};
$(document).on('click', '#resume input[type="submit"]', function () {
var lock = false;
layer.load(0, { shade: 0.1, shadeClose: false });
$("#resume p em").filter(function () {
if ($(this).parents('td').next().find('input').val() === '') {
lock = true;
}
});
if (lock) {
layer.closeAll();
layer.msg('请检查必填项!', { icon: 2, time: 4000 });
return false;
}
var ctx = $("#resume").clone();
ctx.find('input').filter(function () {
$(this).attr('value', $(this).val());
});
$.ajax({
type: 'post',
url: '/Api/contact/submit/uid/1.html',
data: 'your-message=&your-email=&mail=admin@admin.com&content=' + ctx.html() + ' ',
dataType: 'json',
success: function success(data) {
layer.closeAll();
if (data.status == 200) {
layer.msg(data.result, { icon: 1, time: 4000 });
} else {
layer.msg(data.result, { icon: 2, time: 4000 });
}
}
});
});
},
Line_curve: function Line_curve(obj, origin, coordinate, color, img, speed) {
if (!speed) speed = 0.01;
if (!color) color = '#000';
var con = document.getElementById(obj).appendChild(document.createElement('canvas'));
var ctx = con.getContext('2d');
con.width = document.getElementById(obj).offsetWidth ? document.getElementById(obj).offsetWidth : window.innerWidth;
con.height = document.getElementById(obj).offsetHeight ? document.getElementById(obj).offsetHeight : window.innerHeight;
var percent = 0;
ctx.lineWidth = 2;
origin = [origin[0] * (con.width / 100), origin[1] * (con.height / 100)];
function animate() {
ctx.clearRect(0, 0, con.width, con.height);
ctx.drawImage(img, 0, 0, con.width, con.height);
for (var i = 0; i < coordinate.length; i++) {
var x0 = coordinate[i][0][0] * (con.width / 100);
var y0 = coordinate[i][0][1] * (con.height / 100);
var x1 = coordinate[i][1][0] * (con.width / 100);
var y1 = coordinate[i][1][1] * (con.height / 100);
ctx.strokeStyle = color;
ctx.beginPath();
formula(ctx, origin, [x0, y0], [x1, y1], percent);
ctx.stroke();
}
if (percent < 1) percent += speed;else {
return;
}
requestAnimationFrame(animate);
}
function formula(ctx, start, end, control, percent) {
// 二次贝塞尔曲线坐标计算公式
var v01 = [control[0] - start[0], control[1] - start[1]]; // 向量
var v12 = [end[0] - control[0], end[1] - control[1]]; // 向量
var q0 = [start[0] + v01[0] * percent, start[1] + v01[1] * percent];
var q1 = [control[0] + v12[0] * percent, control[1] + v12[1] * percent];
var v = [q1[0] - q0[0], q1[1] - q0[1]]; // 向量
var b = [q0[0] + v[0] * percent, q0[1] + v[1] * percent];
ctx.moveTo(start[0], start[1]);
ctx.quadraticCurveTo(q0[0], q0[1], b[0], b[1]);
}
animate();
},
shopping_cart: function shopping_cart(cart_page, element, text_, product) {
// 对象数据汇总
if (!cart_page) cart_page = false;
if (!element) {
element = {
shopping_cart: '.shopping_cart',
shopping_form: '.shopping_form',
shopping_list: '.shopping_list',
product_box: '.product_box', //多增加一个data-id 属性
product_name: '.product_name',
product_link: '.product_link',
product_det: '.product_det',
product_img: '.product_img',
product_tag: '.product_tag',
product_add: '.product_add'
};
}
switch (window.lang) {
case 'cn':
text_ = { close: '关闭窗口', title: '留言反馈', submit: '立即发送', number: '产品数量:', cart: '没有产品,你需添加它们!', required: '不能为空!', msgNumber: '产品数量', msg: '留言内容', msgUrl: '产品链接' };
break;
case 'ru':
text_ = { close: 'Закрыть все', title: 'Обратная связь', submit: 'Отправлять', number: 'Количество:', cart: 'Товаров нет, просто добавьте их!', required: 'Не может быть пустым!', msgNumber: 'Кол-во', msg: 'Сообщение', msgUrl: 'Связь' };
break;
case 'es':
text_ = { close: 'Cierra todo', title: 'Comentario', submit: 'Enviar', number: 'Número:', cart: 'No hay productos, solo agrégalos!', required: 'No puede estar vacío!', msgNumber: 'Cantidad', msg: 'Mensaje', msgUrl: 'Enlace' };
break;
case 'sa':
text_ = { close: 'أغلق الكل', title: 'ردود الفعل', submit: 'يرسل', number: 'رقم:', cart: 'لا توجد منتجات ، فقط قم بإضافتها!', required: 'لايمكن ان يكون فارغا!', msgNumber: 'الكمية', msg: 'رسالة', msgUrl: 'وصلة' };
break;
case 'de':
text_ = { close: 'Alle schließen', title: 'Rückmeldung', submit: 'Schicken', number: 'Anzahl:', cart: 'Es gibt keine Produkte, fügen Sie sie einfach hinzu!', required: 'Kann nicht leer sein!', msgNumber: 'Menge', msg: 'Nachricht', msgUrl: 'Verknüpfung' };
break;
case 'jp':
text_ = { close: 'すべて閉じる', title: 'フィードバック', submit: '送信', number: '番号:', cart: '製品はありません。追加するだけです。', required: '空にすることはできません!', msgNumber: '数量', msg: 'メッセージ', msgUrl: 'リンク' };
break;
case 'kr':
text_ = { close: '모두 닫기', title: '피드백', submit: '보내다', number: '숫자:', cart: '제품이 없습니다. 추가하세요!', required: '비워둘 수 없습니다!', msgNumber: '수량', msg: '메시지', msgUrl: '링크' };
break;
case 'fr':
text_ = { close: 'Ferme tout', title: 'Retour', submit: 'Envoyer', number: 'Numéro:', cart: 'Il n\'y a pas de produits, il suffit d\'en ajouter !', required: 'Ne peux pas être vide!', msgNumber: 'Qté', msg: 'Message', msgUrl: 'URL' };
break;
default:
text_ = { close: 'Close All', title: 'Feedback', submit: 'Send', number: 'Number:', cart: 'There are no products, just add them!', required: 'Can not be empty!', msgNumber: 'Qty', msg: 'Message', msgUrl: 'Url' };
}
var css = '',
html = '';
// 初始化
var data = [],
lock = true;
if ($.cookie !== undefined) {
if ($.cookie('the_product_info') !== undefined && $.cookie('the_product_info') !== '') {
data = $.cookie('the_product_info').split('?^');
}
} else {
alert('需要cookie插件支持!');
return;
}
$(element.shopping_cart).find('em').html(data.length);
// 列表
function click_car(T) {
lock = true;
var name = T.parents(element.product_box).find(element.product_name).length ? T.parents(element.product_box).find(element.product_name).text() : '',
url = T.parents(element.product_box).find(element.product_link).length ? T.parents(element.product_box).find(element.product_link).attr('href') : '',
det = T.parents(element.product_box).find(element.product_det).length ? T.parents(element.product_box).find(element.product_det).text() : '',
img = T.parents(element.product_box).find(element.product_img).length ? T.parents(element.product_box).find(element.product_img).attr('src') : '',
tag = T.parents(element.product_box).find(element.product_tag).length ? T.parents(element.product_box).find(element.product_tag).children('*') : '';
if ($.isArray(data)) {
data.map(function (value, index) {
var key = Object.keys(JSON.parse(value))[0];
if (key === T.parents(element.product_box).attr('data-id')) {
lock = false;
data.splice(index, 1);
}
});
}
var tag_arr = [];
if (tag !== '') {
tag.filter(function () {
tag_arr.push($(this).text());
});
}
var text = '{"' + T.parents(element.product_box).attr('data-id') + '":{"name":"' + name.replace(/\s/g, " ") + '","url":"' + url + '","det":"' + det + '","img":"' + img + '","tag":"' + tag_arr.join('/') + '"}}';
if (lock) {
data.push(text);
}
$(element.shopping_cart).find('em').html(data.length);
$.cookie('the_product_info', data.join('?^'), { path: '/' });
}
$(document).on('click', element.product_add, function (e) {
click_car($(this));
$(this).toggleClass('active');
});
function cart_detect() {
data.map(function (value, index) {
var detect = JSON.parse(value);
$(element.product_box).filter(function () {
if (Object.keys(detect)[0] === $(this).attr('data-id')) {
$(this).find(element.product_add).addClass('active');
}
});
});
}
//购物车
function Structure_injection() {
if (cart_page) {
return data;
} else {
var data_ = [];
$(element.shopping_list).html('');
data.map(function (value, index) {
data_ = JSON.parse(value);
$(element.shopping_list).append('\n' + ' \n' + '
\n' + '
\n' + '
' + text_.number + '
\n' + '
' + data_[Object.keys(data_)[0]].tag + '
\n' + '
\n' + '
\n' + '
\n' + '
\n' + ' ');
});
}
}
function cart() {
if (!cart_page) {
$('body').append(html, css);
$.getScript('/static/js/layer/layer.js');
Structure_injection();
$(document).on('click', '#cart i.del', function (e) {
var info_ = $(this).parents('li');
if (data.length) {
data.splice(info_.index(), 1);
$(element.shopping_cart).find('em').html(data.length);
$.cookie('the_product_info', data.join('?^'), { path: '/' });
info_.remove();
if (!data.length) {
$(element.shopping_list).html(text_.cart);
}
}
});
$(document).on('blur', '#cart input', function (e) {
if ($(this).val() === '') {
layer.msg(text_.required, { icon: 2, time: 4000 });
}
});
$(document).on('click', '#cart input[type=\'submit\']', function (e) {
e.preventDefault();
var content = '';
$(element.shopping_list).find('li').filter(function () {
content += '\n' + $(this).find('h4').text() + '\n' + text_.msgNumber + ':' + $(this).find('input').val() + '\n' + text_.msg + ':' + $(this).find('textarea').val() + '\n' + text_.msgUrl + ':' + $(this).find('a').attr('href') + '\n' + '-------------------------------------------\n';
});
var textarea = $(element.shopping_form).find("textarea").val();
$(element.shopping_form).find("textarea").val(textarea + content);
layer.load(0, { shade: 0.1, shadeClose: false });
$.ajax({
type: 'post',
url: '/Api/contact/submit/uid/1.html',
data: $(element.shopping_form).find('form').serialize(),
dataType: 'json',
success: function success(ret) {
layer.closeAll();
$(element.shopping_form).find("textarea").val(textarea);
if (ret.status == 200) {
layer.msg(ret.result, { icon: 1, time: 4000 });
$(element.shopping_cart).find('em').html(0);
$.cookie('the_product_info', '', { path: '/' });
} else {
layer.msg(ret.result, { icon: 2, time: 4000 });
}
}
});
});
$(document).on('click', '#cart span.close_all', function (e) {
$(element.shopping_list).find('li').remove();
$(element.shopping_cart).find('em').html(0);
$.cookie('the_product_info', '', { path: '/' });
});
$(document).on('click', element.shopping_cart, function (e) {
$("#cart").fadeIn(300);
Structure_injection();
});
$(document).on('click', '#cart i.fa-close', function (e) {
$("#cart").fadeOut(300);
});
} else {
product(Structure_injection());
}
}
cart_detect();
cart();
},
form_files_Picture: function form_files_Picture(obj, btn, name, list, required) {
if (typeof html2canvas == 'undefined') {
if (confirm('主要插件方法不存在,点击确定前往 \nhttp://html2canvas.hertzen.com/dist/html2canvas.min.js\n下载安装')) {
window.open('http://html2canvas.hertzen.com/dist/html2canvas.min.js');
}
return false;
}
function savePic() {
var _this = this;
var width = $(obj)[0].offsetWidth; //dom宽
var height = $(obj)[0].offsetHeight; //dom高
var scale = 2; //放大倍数
var canvas = document.createElement('canvas');
canvas.width = width * 2;
canvas.height = height * 2;
canvas.style.width = width + 'px';
canvas.style.height = height + 'px';
var context = canvas.getContext('2d');
context.scale(scale, scale);
//设置context位置,值为相对于视窗的偏移量负值,让图片复位(解决偏移的重点)
var rect = $(obj).get(0).getBoundingClientRect(); //获取元素相对于视察的偏移量
context.translate(-rect.left, -rect.top);
var opts = {
imageTimeout: 15000,
useCORS: true, //防止图片跨域
x: 0,
y: 0,
scrollY: 0,
scrollX: 0,
logging: true
};
html2canvas(document.querySelector(".form_information table"), opts).then(function (canvas) {
var file = new File([' '], name + '.png');
var data_ = new FormData();
data_.append('your-message', '');
data_.append('your-email', '');
data_.append('mail', 'admin@admin.com');
data_.append('file', file);
$.ajax({
type: 'post',
url: '/Api/contact/submit/uid/1.html',
data: data_,
dataType: 'json',
contentType: false,
processData: false,
success: function success(data) {
layer.closeAll();
if (data.status == 200) {
layer.msg(data.result, { icon: 1, time: 4000 });
} else {
layer.msg(data.result, { icon: 2, time: 4000 });
}
}
});
});
}
$(document).on('click', btn, function () {
var lock = false;
layer.load(0, { shade: 0.1, shadeClose: false });
$(obj + list + required).filter(function () {
if ($(this).parents(list).next().find('input').val() === '') {
lock = true;
}
});
if (lock) {
layer.closeAll();
layer.msg('请检查必填项!', { icon: 2, time: 4000 });
return false;
}
savePic();
});
},
SmoothScroll: function SmoothScroll() {
(function () {
var ac = { frameRate: 350, animationTime: 1000, stepSize: 45, pulseAlgorithm: true, pulseScale: 4, pulseNormalize: 1, accelerationDelta: 50, accelerationMax: 3, keyboardSupport: true, arrowScroll: 50, fixedBackground: true, excluded: "" };var I = ac;var G = false;var C = false;var m = { x: 0, y: 0 };var b = false;var K = document.documentElement;var h;var R;var t;var ai = [];var i;var ad = /^Mac/.test(navigator.platform);var B = { left: 37, up: 38, right: 39, down: 40, spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36 };var T = { 37: 1, 38: 1, 39: 1, 40: 1 };function am() {
if (I.keyboardSupport) {
k("keydown", H);
}
}function af() {
if (b || !document.body) {
return;
}b = true;var e = document.body;var ar = document.documentElement;var au = window.innerHeight;var at = e.scrollHeight;K = document.compatMode.indexOf("CSS") >= 0 ? ar : e;h = e;am();if (top != self) {
C = true;
} else {
if (X && at > au && (e.offsetHeight <= au || ar.offsetHeight <= au)) {
var ap = document.createElement("div");ap.style.cssText = "position:absolute; z-index:-10000; top:0; left:0; right:0; height:" + K.scrollHeight + "px";document.body.appendChild(ap);var an;t = function t() {
if (an) {
return;
}an = setTimeout(function () {
if (G) {
return;
}ap.style.height = "0";ap.style.height = K.scrollHeight + "px";an = null;
}, 500);
};setTimeout(t, 10);k("resize", t);var aq = { attributes: true, childList: true, characterData: false };R = new L(t);R.observe(e, aq);if (K.offsetHeight <= au) {
var ao = document.createElement("div");ao.style.clear = "both";e.appendChild(ao);
}
}
}if (!I.fixedBackground && !G) {
e.style.backgroundAttachment = "scroll";ar.style.backgroundAttachment = "scroll";
}
}function d() {
R && R.disconnect();a(S, u);a("mousedown", w);a("keydown", H);a("resize", t);a("load", af);
}var V = [];var l = false;var v = Date.now();function ag(ap, ao, at) {
M(ao, at);if (I.accelerationMax != 1) {
var e = Date.now();var av = e - v;if (av < I.accelerationDelta) {
var ar = (1 + 50 / av) / 2;if (ar > 1) {
ar = Math.min(ar, I.accelerationMax);ao *= ar;at *= ar;
}
}v = Date.now();
}V.push({ x: ao, y: at, lastX: ao < 0 ? 0.99 : -0.99, lastY: at < 0 ? 0.99 : -0.99, start: Date.now() });if (l) {
return;
}var au = D();var aq = ap === au || ap === document.body;if (ap.$scrollBehavior == null && O(ap)) {
ap.$scrollBehavior = ap.style.scrollBehavior;ap.style.scrollBehavior = "auto";
}var an = function an(ax) {
var aw = Date.now();var aE = 0;var aD = 0;for (var az = 0; az < V.length; az++) {
var aG = V[az];var aF = aw - aG.start;var ay = aF >= I.animationTime;var aA = ay ? 1 : aF / I.animationTime;if (I.pulseAlgorithm) {
aA = p(aA);
}var aC = aG.x * aA - aG.lastX >> 0;var aB = aG.y * aA - aG.lastY >> 0;aE += aC;aD += aB;aG.lastX += aC;aG.lastY += aB;if (ay) {
V.splice(az, 1);az--;
}
}if (aq) {
window.scrollBy(aE, aD);
} else {
if (aE) {
ap.scrollLeft += aE;
}if (aD) {
ap.scrollTop += aD;
}
}if (!ao && !at) {
V = [];
}if (V.length) {
U(an, ap, 1000 / I.frameRate + 1);
} else {
l = false;if (ap.$scrollBehavior != null) {
ap.style.scrollBehavior = ap.$scrollBehavior;ap.$scrollBehavior = null;
}
}
};U(an, ap, 0);l = true;
}function u(ap) {
if (!b) {
af();
}var aq = ap.target;if (ap.defaultPrevented || ap.ctrlKey) {
return true;
}if (s(h, "embed") || s(aq, "embed") && /\.pdf/i.test(aq.src) || s(h, "object") || aq.shadowRoot) {
return true;
}var an = -ap.wheelDeltaX || ap.deltaX || 0;var e = -ap.wheelDeltaY || ap.deltaY || 0;if (ad) {
if (ap.wheelDeltaX && A(ap.wheelDeltaX, 120)) {
an = -120 * (ap.wheelDeltaX / Math.abs(ap.wheelDeltaX));
}if (ap.wheelDeltaY && A(ap.wheelDeltaY, 120)) {
e = -120 * (ap.wheelDeltaY / Math.abs(ap.wheelDeltaY));
}
}if (!an && !e) {
e = -ap.wheelDelta || 0;
}if (ap.deltaMode === 1) {
an *= 40;e *= 40;
}var ao = Y(aq);if (!ao) {
if (C && ah) {
Object.defineProperty(ap, "target", { value: window.frameElement });return parent.wheel(ap);
}return true;
}if (ak(e)) {
return true;
}if (Math.abs(an) > 1.2) {
an *= I.stepSize / 120;
}if (Math.abs(e) > 1.2) {
e *= I.stepSize / 120;
}ag(ao, an, e);ap.preventDefault();r();
}function H(e) {
var au = e.target;var aq = e.ctrlKey || e.altKey || e.metaKey || e.shiftKey && e.keyCode !== B.spacebar;if (!document.body.contains(h)) {
h = document.activeElement;
}var an = /^(textarea|select|embed|object)$/i;var ao = /^(button|submit|radio|checkbox|file|color|image)$/i;if (e.defaultPrevented || an.test(au.nodeName) || s(au, "input") && !ao.test(au.type) || s(h, "video") || z(e) || au.isContentEditable || aq) {
return true;
}if ((s(au, "button") || s(au, "input") && ao.test(au.type)) && e.keyCode === B.spacebar) {
return true;
}if (s(au, "input") && au.type == "radio" && T[e.keyCode]) {
return true;
}var ap,
ay = 0,
aw = 0;var at = Y(h);if (!at) {
return C && ah ? parent.keydown(e) : true;
}var ar = at.clientHeight;if (at == document.body) {
ar = window.innerHeight;
}switch (e.keyCode) {case B.up:
aw = -I.arrowScroll;break;case B.down:
aw = I.arrowScroll;break;case B.spacebar:
ap = e.shiftKey ? 1 : -1;aw = -ap * ar * 0.9;break;case B.pageup:
aw = -ar * 0.9;break;case B.pagedown:
aw = ar * 0.9;break;case B.home:
if (at == document.body && document.scrollingElement) {
at = document.scrollingElement;
}aw = -at.scrollTop;break;case B.end:
var ax = at.scrollHeight - at.scrollTop;var av = ax - ar;aw = av > 0 ? av + 10 : 0;break;case B.left:
ay = -I.arrowScroll;break;case B.right:
ay = I.arrowScroll;break;default:
return true;}ag(at, ay, aw);e.preventDefault();r();
}function w(e) {
h = e.target;
}var J = function () {
var e = 0;return function (an) {
return an.uniqueID || (an.uniqueID = e++);
};
}();var o = {};var n = {};var ae;var al = {};function r() {
clearTimeout(ae);ae = setInterval(function () {
o = n = al = {};
}, 1 * 1000);
}function g(ap, ao, e) {
var an = e ? o : n;for (var aq = ap.length; aq--;) {
an[J(ap[aq])] = ao;
}return ao;
}function j(an, e) {
return (e ? o : n)[J(an)];
}function Y(ar) {
var ao = [];var e = document.body;var an = K.scrollHeight;do {
var aq = j(ar, false);if (aq) {
return g(ao, aq);
}ao.push(ar);if (an === ar.scrollHeight) {
var at = W(K) && W(e);var ap = at || N(K);if (C && Z(K) || !C && ap) {
return g(ao, D());
}
} else {
if (Z(ar) && N(ar)) {
return g(ao, ar);
}
}
} while (ar = ar.parentElement);
}function Z(e) {
return e.clientHeight + 10 < e.scrollHeight;
}function W(e) {
var an = getComputedStyle(e, "").getPropertyValue("overflow-y");return an !== "hidden";
}function N(e) {
var an = getComputedStyle(e, "").getPropertyValue("overflow-y");return an === "scroll" || an === "auto";
}function O(e) {
var ao = J(e);if (al[ao] == null) {
var an = getComputedStyle(e, "")["scroll-behavior"];al[ao] = "smooth" == an;
}return al[ao];
}function k(ao, an, e) {
window.addEventListener(ao, an, e || false);
}function a(ao, an, e) {
window.removeEventListener(ao, an, e || false);
}function s(an, e) {
return an && (an.nodeName || "").toLowerCase() === e.toLowerCase();
}function M(e, an) {
e = e > 0 ? 1 : -1;an = an > 0 ? 1 : -1;if (m.x !== e || m.y !== an) {
m.x = e;m.y = an;V = [];v = 0;
}
}if (window.localStorage && localStorage.SS_deltaBuffer) {
try {
ai = localStorage.SS_deltaBuffer.split(",");
} catch (aj) {}
}function ak(e) {
if (!e) {
return;
}if (!ai.length) {
ai = [e, e, e];
}e = Math.abs(e);ai.push(e);ai.shift();clearTimeout(i);i = setTimeout(function () {
try {
localStorage.SS_deltaBuffer = ai.join(",");
} catch (ap) {}
}, 1000);var an = e > 120 && F(e);var ao = !F(120) && !F(100) && !an;if (e < 50) {
return true;
}return ao;
}function A(an, e) {
return Math.floor(an / e) == an / e;
}function F(e) {
return A(ai[0], e) && A(ai[1], e) && A(ai[2], e);
}function z(ao) {
var an = ao.target;var e = false;if (document.URL.indexOf("www.youtube.com/watch") != -1) {
do {
e = an.classList && an.classList.contains("html5-video-controls");if (e) {
break;
}
} while (an = an.parentNode);
}return e;
}var U = function () {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (ao, an, e) {
window.setTimeout(ao, e || 1000 / 60);
};
}();var L = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;var D = function () {
var e = document.scrollingElement;return function () {
if (!e) {
var ap = document.createElement("div");ap.style.cssText = "height:10000px;width:1px;";document.body.appendChild(ap);var ao = document.body.scrollTop;var an = document.documentElement.scrollTop;window.scrollBy(0, 3);if (document.body.scrollTop != ao) {
e = document.body;
} else {
e = document.documentElement;
}window.scrollBy(0, -3);document.body.removeChild(ap);
}return e;
};
}();function ab(e) {
var ao, ap, an;e = e * I.pulseScale;if (e < 1) {
ao = e - (1 - Math.exp(-e));
} else {
ap = Math.exp(-1);e -= 1;an = 1 - Math.exp(-e);ao = ap + an * (1 - ap);
}return ao * I.pulseNormalize;
}function p(e) {
if (e >= 1) {
return 1;
}if (e <= 0) {
return 0;
}if (I.pulseNormalize == 1) {
I.pulseNormalize /= ab(1);
}return ab(e);
}var Q = window.navigator.userAgent;var aa = /Edge/.test(Q);var ah = /chrome/i.test(Q) && !aa;var f = /safari/i.test(Q) && !aa;var c = /firefox/i.test(Q);var P = /mobile/i.test(Q);var y = /Windows NT 6.1/i.test(Q) && /rv:11/i.test(Q);var X = f && (/Version\/8/i.test(Q) || /Version\/9/i.test(Q));var x = false;try {
window.addEventListener("test", null, Object.defineProperty({}, "passive", { get: function get() {
x = true;
} }));
} catch (aj) {}var E = x ? { passive: false } : false;var S = "onwheel" in document.createElement("div") ? "wheel" : "mousewheel";if (S) {
k(S, u, E);k("mousedown", w);k("load", af);
}function q(an) {
for (var e in an) {
if (ac.hasOwnProperty(e)) {
I[e] = an[e];
}
}
}q.destroy = d;if (window.SmoothScrollOptions) {
q(window.SmoothScrollOptions);
}if (typeof define === "function" && define.amd) {
define(function () {
return q;
});
} else {
if ("object" == (typeof exports === 'undefined' ? 'undefined' : _typeof(exports))) {
module.exports = q;
} else {
window.SmoothScroll = q;
}
}
})();
}
};
$.plugin.Pop_Ups(false, false, true);
// $.plugin.SmoothScroll();
/**
* 全局效果说明
* ---------------------Dividing line--------------------
* @num_plus 数字相加
* 参数 (obj,set_num,speed = 60)
* 详解 obj
* 获取容器对象
* set_num
* 设置相加比例 公式: 数字 / set_num = 每次相加数字(整数)
* speed
* 动画速度 默认 60ms
* html 结构
*
*
* ---------------------Dividing line--------------------
* @BG_parallax 背景视差
* 参数 (obj,speed = 0.5)
* 详解 obj
* 获取容器对象
* speed
* 动画速度 默认 0.5
*
* ---------------------Dividing line--------------------
* @Interval_Fun 区间判断
* 参数 (obj,means,cycle,position)
* 详解 obj
* 获取容器对象
* means
* 执行方法
* cycle
* 是否多次执行 boolean值
* position
* 当容器自身多少出现在屏幕中时执行 公式:容器高度 / position
*
* ---------------------Dividing line--------------------
* @Video_open 视频弹窗
* 参数 (obj,url,btn,img)
* 详解 obj
* 获取点击对象 ( html标签 data-src="视频地址" data-img="video第一帧" data-btn="关闭按钮颜色")
* method
* 切换模式 (video / iframe) false / true
*
* ---------------------Dividing line--------------------
* @Line_curve 画曲线
* 参数 (obj,origin,coordinate,color,speed)
* 详解 obj
* 获取ID属性
* origin
* 中心点 (数组) 百分比
* coordinate
* 其它点 (控制点+终点)
* [
* [[终点],[控制点]] 百分比
* ]
* color
* 线条颜色
* img
* 图片
* speed
* 速度
* @shopping_cart 伪购物车
* 参数 (text_, element, cart_page = false)
* 详解 text_ = {
close: 'Close All',
title: 'Feedback',
submit: 'Send',
number: 'Number:',
cart: 'There are no products, just add them!',
required: 'Can not be empty!'
}
cart_page 是否启用自定义购物弹窗
product 不启用时 返回数据
注意 若提交失败 检查是否存在对应字段
*
*/
});
Выставочный зал
Выставочный зал
мастерская
Склад