string.prototype.colorrgb = function (e) { var a = this.tolowercase(), t = /^#([0-9a-fa-f]{3}|[0-9a-fa-f]{6})$/; if (a && t.test(a)) { if (4 === a.length) { for (var o = "#", i = 1; i < 4; i += 1) o += a.slice(i, i + 1).concat(a.slice(i, i + 1)); a = o } for (var n = [], i = 1; i < 7; i += 2) n.push(parseint("0x" + a.slice(i, i + 2))); return e ? "rgba(" + n.join(",") + "," + e + ")" : "rgb(" + n.join(",") + ")" } return a }; var headernav = { init: function () { function e() { $(window).scrolltop() > ($(window).width() > 600 ? 100 : 70) ? t.addclass("mask") : t.removeclass("mask") } var a = this, t = $(".nav-header"), o = $(".nav-header nav"), i = $("#nav_overlayer"), n = $(".nav-header .menu_btn"); n.click(function () { $("body").hasclass("nav-open") ? a.close() : a.open() }), i.click(a.close), o.find("li").each(function () { var e = $(this).data("page"); $("body").hasclass(e) && $(this).addclass("active") }), $("footer nav li").each(function () { var e = $(this).data("page"); $("body").hasclass(e) && $(this).addclass("active") }), e(), $(window).scroll(e), $(window).resize(function () { "none" == n.css("display") && a.close() }), $(".up-btn").click(function () { $(document).scrollto(0, 800) }) }, open: function () { $("body").addclass("nav-open"), $(".srfix.dropdown-nav").removeclass("open") }, close: function () { $("body").removeclass("nav-open") } }; ! function () { "use strict"; var e = function (a, t) { if (!(this instanceof e)) return new e(a, t); var o = { duration: 1200, autoplay: 5e3, key_control: !0, autoplay_class: ".playline", slide_anim: !1, svg_cover_class: ".svg-cover" }; t = t || {}; var i = {}; for (var n in t) if ("object" != typeof t[n] || null === t[n] || (t[n].nodetype || t[n] === window || t[n] === document || "undefined" != typeof dom7 && t[n] instanceof dom7 || "undefined" != typeof jquery && t[n] instanceof jquery)) i[n] = t[n]; else { i[n] = {}; for (var l in t[n]) i[n][l] = t[n][l] } for (var s in o) if (void 0 === t[s]) t[s] = o[s]; else if ("object" == typeof t[s]) for (var d in o[s]) void 0 === t[s][d] && (t[s][d] = o[s][d]); var r = this; return r.params = t, r.slider_el = $(a), r.nav_el = r.slider_el.find(".slider-nav.dots"), r.number_el = r.slider_el.find(".slider-nav.number"), r.autoplay_el = r.slider_el.find(r.params.autoplay_class), r.svg_cover_el = r.slider_el.find(r.params.svg_cover_class), r.total = r.slider_el.find(".slide").length, r.autoplay = r.params.autoplay > 0, 0 === r.svg_cover_el.length ? void alert("not find svg cover!") : (r.patharray = [], r.init = function () { var e = r.slider_el, a = r.retrieveactiveslide(), t = e.find(".btn-prev"), o = e.find(".btn-next"); r.patharray[0] = r.svg_cover_el.data("step1"), r.patharray[1] = r.svg_cover_el.data("step2"), r.patharray[2] = r.svg_cover_el.data("step3"), r.patharray[3] = r.svg_cover_el.data("step4"), r.patharray[4] = r.svg_cover_el.data("step5"); for (var i = 0; i < r.total; i++) { r.nav_el.append('
') } var n = r.nav_el.find(".dot"); r.number_el.find(".total").text(r.total), 0 == a.length && e.find(".slide").first().addclass("active"), r.updatenav(e.find(".slide.active")), o.on("click", function (e) { e.preventdefault(), r.killautoplay(), r.nextslide() }), t.on("click", function (e) { e.preventdefault(), r.killautoplay(), r.prevslide() }), e.on("swipeleft", function () { r.killautoplay(), r.nextslide() }), e.on("swiperight", function () { r.killautoplay(), r.prevslide() }), r.params.key_control && $(document).on("keydown", function (a) { $.inviewport(e) && (37 == a.which && (r.killautoplay(), r.prevslide()), 39 == a.which && (r.killautoplay(), r.nextslide())) }), n.on("click", function (a) { a.preventdefault(); var t = $(this); if (!t.is(".active-dot")) { var o = t.index(), i = e.find(".slide").eq(o); r.updateslide(i), r.killautoplay() } }), $(window).scroll(function () { $.inviewport(e) ? r.autoplay && !r.autoplaying && r.startautoplay() : r.stopautoplay() }) }, r.retrieveactiveslide = function () { return r.slider_el.find(".slide.active") }, r.nextslide = function () { var e = r.retrieveactiveslide(), a = e.next(".slide").length > 0 ? e.next(".slide") : r.slider_el.find(".slide").eq(0); r.updateslide(a, "next") }, r.prevslide = function () { var e = r.retrieveactiveslide(), a = e.prev(".slide").length > 0 ? e.prev(".slide") : r.slider_el.find(".slide").last(); r.updateslide(a, "prev") }, r.updateslide = function (e, a) { function t() { var a = anime({ targets: l, points: [{ value: v, easing: "easeincirc" }, { value: f, easing: "easeoutcirc" }], duration: b, complete: function (a) { r.transend(), r.params.slide_anim ? e.one("animationend", function () { r.slider_el.removeclass("is-animating prev next"), e.removeclass("showin") }) : (r.slider_el.removeclass("is-animating prev next"), e.removeclass("showin")) } }) } var o = r.svg_cover_el, i = o.find("g"), n = o.find("polygon"), l = "#" + n.attr("id"), s = o.find(".top-info"), d = r.retrieveactiveslide(), c = e.data("color"), m = r.patharray[0], u = r.patharray[1], h = r.patharray[2], v = r.patharray[3], f = r.patharray[4], p = d.index(); if (r.target_index = e.index(), void 0 == a && (a = p < r.target_index ? "next" : "prev"), !r.slider_el.is(".is-animating")) { r.autoplay_el.removeclass("autoplay"), s.find(".index").text(r.target_index + 1), r.slider_el.addclass(a); var g = .3 * r.params.duration, b = .7 * r.params.duration; r.slider_el.addclass("is-animating"), n.attr("points", m), c && i.css("fill", c); var w = anime({ targets: l, points: [{ value: u, easing: "easeincirc" }, { value: h, easing: "easeoutcirc" }], duration: g, complete: function (a) { d.removeclass("active"), e.addclass("active showin"), r.updatenav(e), null != r.onclidechang && r.onclidechang(), t() } }); null != r.ontransstart && r.ontransstart() } }, r.updatenav = function (e) { var a = e.index(); r.nav_el.find(".dot").removeclass("active-dot").eq(a).addclass("active-dot"), r.number_el.find(".index").text(a + 1) }, r.transend = function () { r.autoplay && r.autoplaying && r.startautoplay(), null != r.ontransend && r.ontransend() }, r.startautoplay = function () { r.autoplaying = !0, r.autoplay_el.length ? (r.autoplay_el.addclass("autoplay"), r.autoplay_el.one("transitionend", r.nextslide)) : r.autoplay_time_out = settimeout(function () { r.nextslide() }, r.params.autoplay) }, r.stopautoplay = function () { r.autoplaying = !1, r.autoplay_el.removeclass("autoplay").off("transitionend"), cleartimeout(r.autoplay_time_out) }, r.killautoplay = function () { r.autoplay = !1, r.stopautoplay() }, r.ontransstart = null, r.onclidechang = null, r.ontransend = null, r.init(), r) }; window.svgslider = e }(); var scrollfixnav = { nav: $(".scroll-p-fix"), init: function () { var e = this.nav, a = function () { var a = e.is(".srfix") ? $(".nav_holder") : e, t = e.innerheight(), o = ''; $.abovethetop(a, 0) ? e.hasclass("srfix") || (e.parent().append(o), e.addclass("srfix")) : (e.parent().find(".nav_holder").remove(), e.removeclass("srfix")), e.is(".dropdown-nav") && e.removeclass("open") }; a(), $(window).scroll(function () { $("body").is(".modal-show") || a() }) }, reset: function () { var e = this.nav; e.parent().find(".nav_holder").remove(), e.removeclass("srfix"), e.is(".dropdown-nav") && e.removeclass("open") } }, navfilter = { init: function () { $(".filter-nav").each(function () { var e = $(this), a = $(e.data("target")); navfilter.filter(e, a) }) }, filter: function (e, a) { var t = e.find("li"), o = a.find(".item"), i = "filter-hide", n = function (e, a) { var t = e.find("a"); "*" == a ? e.removeclass(i) : e.hasclass(a) ? e.removeclass(i) : e.addclass(i) }; t.each(function () { var t = $(this); t.find("a").on("click", function (i) { var l = $(this).data("filter"); t.is(".active") || (o.each(function () { $(this).addclass("trans"), a.is(".blog-thumbs") && $(window).width() < 768 && $(window).width() < $(window).height() && $(this).find(".img-wrap").addclass("trans"), n($(this), l) }), settimeout(function () { o.each(function () { $(this).removeclass("trans"), $(this).find(".img-wrap").removeclass("trans") }), $("body").is(".modal-open") ? animelements.showemts("main") : $(window).resize() }, 400)), e.find(".active").removeclass("active"), t.addclass("active"), e.is(".srfix") && $(window).scrollto(0, 600), i.preventdefault() }) }) } }, dropdownnav = { init: function () { $(".dropdown-nav").each(function () { var e = $(this), a = e.find(".dropdown-btn"); a.find("span").text(e.find(".active a").text()), a.on("click", function () { e.toggleclass("open"), e.is(".open") && (animelements.showemts(".dropdown-nav"), headernav.close()) }), e.find("li a").on("click", function () { a.find("span").text($(this).text()), e.removeclass("open") }) }) } }, sizefix = { init: function () { function e() { cleartimeout(o), t.each(function () { var e = $(this), t = e.find("a"); e.is(".filter-hide") || (t.css("width", ""), a.is(".blog-thumbs") && !e.is(".big") && t.find(".img-wrap").css("padding-top", ""), a.is(".gallery-thumbs") && t.css("padding-top", "")) }), o = settimeout(function () { t.each(function () { var e = $(this), t = e.find("a"), o = math.floor(t.innerwidth()); if (!e.is(".filter-hide")) { if (t.css("width", o), a.is(".blog-thumbs") && !e.is(".big")) { var i = t.find(".img-wrap"), n = math.floor(i.innerheight()); i.css("padding-top", n) } a.is(".gallery-thumbs") && t.css("padding-top", o) } }) }, 200) } var a = $("body").is(".modal-show") ? $(".modal .sizefix") : $("main .sizefix"), t = a.find(".item"), o; a.length && (e(), $(window).resize(function () { e() })) }, clear: function (e) { var a = $(e).find(".sizefix"); a.find(".item").each(function () { var e = $(this), t = e.find("a"); t.css("width", ""), a.is(".blog-thumbs") && !e.is(".big") && t.find(".img-wrap").css("padding-top", ""), a.is(".gallery-thumbs") && t.css("padding-top", "") }) } }, modal = { modal_el: $(".modal"), bg_el: $(".modal .modal-bg"), scroll_el: $(".modal .scroll-cont"), cont_el: $(".modal .cont"), close_btn: $(".modal .close-btn"), wd_scroll: 0, modal_trans_time: 800, thumb_modal: !1, nav_modal: !1, addloader: function () { modal.bg_el.append('
') }, beforeopen: function () { headernav.close(), $("body").addclass("modal-show"), modal.wd_scroll = $(window).scrolltop(), $(".dropdown-nav").removeclass("open"), tt_full_scroll && fullscroll.kill() }, openbg: function () { modal.beforeopen(), modal.modal_el.css("display", "block"), settimeout(function () { modal.bg_el.addclass("showin") }, 10) }, closebg: function () { modal.bg_el.html("").removeclass("showin"); }, open: function () { $(".modal").addclass("thumb-modal blog showin"); $(".modal .loader-icon").remove(), $("[data-bgimg]").each(function () { var e = $(this).data("bgimg"); $(this).css("background-image", "url(" + e + ")") }), modal.thumb_modal = modal.modal_el.is(".thumb-modal"), modal.nav_modal = !(!$("html").is(".desktop") || !$(".modal").is(".nav-modal")), modal.nav_modal && $("body").addclass("modal-init"), settimeout(function () { modal.scroll_el.scrolltop(0), modal.modal_el.addclass("showin").removeclass("change"), modal.nav_modal && modal.navmodal(), modal.showcont() }, 100) }, showcont: function () { var e = modal.nav_modal ? modal.modal_trans_time + 200 : modal.modal_trans_time, a = modal.cont_el; settimeout(function () { modal.thumb_modal && thumbmodal.replacebg(), a.find("video").length && videoplayer.init(), a.find(".gallery-thumbs").length && ics && gallery.init(".modal .gallery-thumbs"), a.find(".sizefix").length && $("html").is(".desktop") && sizefix.init(), a.find(".anim_emt").length && ics && animelements.init(), $("main .thumbs").removeclass("disable"), $("html").is(".mobile") && modal.touchscroll() }, e) }, close: function () { function e() { o.addclass("thumb-md-close"), n.one("transitionend", function () { //tt_full_scroll && fullscroll.init(), modal.bg_el.removeclass("showin"), thumbmodal.back(t) }) } $(".modal").removeclass("thumb-modal blog showin"); settimeout(function(){ $("body").removeclass("modal-show"); $(".modal").hide(); },1000) modal.bg_el.removeclass("showin") function a() { o.addclass("close"), settimeout(function () { t() }, modal.modal_trans_time) } function t() { $("body").removeclass("modal-show"), o.css("display", "").removeclass("close thumb-md-close showin").removeclass(ajaxload.modalclass), i.removeclass("close").removeattr("style"), n.html("").removeattr("style"), modal.close_btn.removeclass("active"), modal.closebg(), $("main .thumbs").removeclass("disable"), tt_full_scroll && fullscroll.init(), $("body").is(".page-home") && pagehome.resetslider() } var o = modal.modal_el, i = modal.scroll_el, n = modal.cont_el; $("html").is(".mobile") && modal.killtouchevents(), tt_full_scroll && (fullscroll.kill(), fullscroll.kill($("main"))), $(".modal .close-tip").removeclass("showin"), modal.nav_modal ? (sizefix.clear(".modal"), o.addclass("thumb-md-close"), $("main .thumbs .item").removeclass("mscroll"), $("main .thumbs .active").removeclass("active"), $("body").removeclass("modal-open"), n.one("transitionend", function () { $("body").removeclass("modal-init modal-trans"); var e = thumbmodal.save_thumb; $(window).scrolltop(modal.wd_scroll), $.inviewport(e) || $(window).scrollto(e, 0), animelements.showemts("main"), modal.bg_el.removeclass("showin"), thumbmodal.back(t) })) : modal.thumb_modal ? e() : a(); }, navmodal: function () { $("nav.srfix").length && scrollfixnav.reset(), $("body").addclass("modal-open modal-trans"), $("main .thumbs .item").is(".mscroll") ? $.inviewport(ajaxload.save_thumb, 0) || $("main").scrollto(ajaxload.save_thumb, 500) : settimeout(function () { animelements.init("main"), $.inviewport(ajaxload.save_thumb, 0) || $("main").scrollto(ajaxload.save_thumb, 500), $("main .thumbs .item").addclass("mscroll") }, 1e3) }, touchscroll: function () { var e = modal.modal_el, a = modal.scroll_el, t = ".scroll-cont", o = !1, i = !1, n, l = { posy: 0, maxscroll: 0 }; e.on({ touchstart: function (e) { var a = e.originalevent.touches[0] || e, t = $(e.target); if (t.length) { var n; t.is(".scroll-cont") ? n = t : 0 == (n = t.parents(".scroll-cont")).length && (n = null), n && (l.elscroll = n, l.posy = a.pagey, l.scrolly = n.scrolltop(), l.maxscroll = n[0].scrollheight - n[0].clientheight, o = !1, i = l.scrolly + 1 >= l.maxscroll) } }, touchmove: function (t) { var n = l.elscroll, s = n.scrolltop(), d = t.originalevent.touches[0] || t, r = d.pagey - l.posy, c = function () { var t = 1 - math.abs(r) / e.height(); a.css({ overflow: "hidden", "-webkit-transition": "all 0.2s", transition: "all 0.2s", "-webkit-transform": "scale(" + t + ")", transform: "scale(" + t + ")" }), o = t < .8, o ? modal.close_btn.addclass("active") : modal.close_btn.removeclass("active") }; return l.maxscroll <= 0 && (c(), t.preventdefault()), r > 0 && 0 == s ? void t.preventdefault() : r < 0 && s + 1 >= l.maxscroll ? (i && c(), void t.preventdefault()) : void 0 }, touchend: function () { l.maxscroll = 0, o ? void 0 != ajaxload ? ajaxload.closemodal() : modal.close() : a.removeattr("style") } }), a.on("scroll.tip", function () { var e = $(".modal .close-tip"), t = a[0].scrollheight - a[0].clientheight, o = a.scrolltop(); t > 0 && o + 1 >= t ? e.addclass("showin") : e.removeclass("showin") }) }, killtouchevents: function () { var e = modal.modal_el, a = modal.scroll_el; e.off("touchstart touchmove touchend"), a.off(".tip") } }, thumbmodal = { modalbg_el: $(".modal .modal-bg"), thumb_x: 0, thumb_y: 0, thumb_w: 0, thumb_h: 0, save_thumb: 0, getthumbsize: function (e) { this.thumb_x = e[0].getboundingclientrect().left, this.thumb_y = e[0].getboundingclientrect().top, this.thumb_w = e.width(), this.thumb_h = e.height() }, show: function (e, a) { function t() { settimeout(function () { s.addclass("showin"), r.css({ left: 0, top: 0, width: "100%" }).addclass("init"), o() }, 50) } function o() { r.one("transitionend", function () { e.removeclass("hover-out"), a() }) } this.save_thumb = e; var i = e.find(".thumb-img"), n, l = $(".modal"), s = this.modalbg_el; i.is("img") ? n = i.attr("src") : (n = i.css("background-image"), n = n.match(/"/gi) ? n.split('("')[1].split('")')[0] : n.split("(")[1].split(")")[0]); var d = '
'; s.append(d); var r = s.children(".coverbg"); i.is(".bg-full") && r.addclass("bg-full"), e.addclass("hover-out"), l.css("display", "block"); var c = 1e3 * parsefloat(i.css("transition-duration")); c = c > 0 ? c : 400, settimeout(function () { thumbmodal.getthumbsize(i), r.css({ left: thumbmodal.thumb_x + "px", top: thumbmodal.thumb_y + "px", width: thumbmodal.thumb_w + "px", height: thumbmodal.thumb_h + "px" }), t() }, c) }, back: function (e) { var a = this.modalbg_el.children(".coverbg"); thumbmodal.getthumbsize(this.save_thumb.find(".thumb-img")), a.css({ left: thumbmodal.thumb_x + "px", top: thumbmodal.thumb_y + "px", width: thumbmodal.thumb_w + "px", height: thumbmodal.thumb_h + "px" }); var t = 1e3 * parsefloat(a.css("transition-duration")); settimeout(function () { a.addclass("back-trans"), a.one("transitionend", e) }, t) //$(".modal").css("display", "none") }, change: function (e, a) { this.save_thumb = e; var t = e.find(".thumb-img"), o, i = $(".modal"), n = this.modalbg_el; t.is("img") ? o = t.attr("src") : (o = t.css("background-image"), o = o.match(/"/gi) ? o.split('("')[1].split('")')[0] : o.split("(")[1].split(")")[0]); var l = '
'; n.append(l); var s = n.children(".coverbg"), d = s.length; d > 2 && s.each(function (e) { e < d - 2 && $(this).remove() }); var r = n.children(".coverbg").eq(0), c = d > 1 ? n.children(".coverbg").eq(1) : r; settimeout(function () { r.addclass("change-out"), c.addclass("change-in") }, 100), c.one("transitionend", a) }, replacebg: function () { var e = $(".modal .cont .head .coverbg"); this.modalbg_el.find(".coverbg").is(".bg-full") && e.addclass("bg-full"), this.modalbg_el.html("").append(e) } }, ajaxload = { ajaxurl: "", xhr: "", historytitle: "", modalclass: "", setstate: !1, save_thumb: !1, init: function () { this.historytitle = document.title, $("html").hasclass("history") && this.addhistoryevent(), $(".modal .close-btn").off("click.close").on("click.back", function () { ajaxload.closemodal(); }), $(document).ajaxerror(function (e, a, t, o) { switch ($(".modal .modal-bg .coverbg").length && modal.close(), a.status) { case 500: alert("服务器系统内部错误!请稍后再试。"); break; case 401: alert("未登录!请登录后再试。"); break; case 403: alert("抱歉!您无权限执行此操作!"); break; case 404: alert("未找到您请求的地址!请重试。"); break; case 408: alert("请求超时!请稍后再试。"); break } }) }, alink: function (e, a, t, o, i) { $(e).each(function () { var e = $(this), n = e.find("a"), l = e.data("postid"), s = "this" == t ? e.text() : e.find(t).text(), d = n.attr("href"); "eldata" == a && (a = e.data("api")), n.click(function (t) { t.preventdefault(), ajaxload.setstate = !(!$("html").hasclass("history") || !o), i.match(/thumb-modal/gi) ? ajaxload.save_thumb = e : ajaxload.save_thumb = !1, $("body").is(".page-home") && i.match(/work/gi) ? (modal.beforeopen(), pagehome.slidetomodal(function () { ajaxload.loadpage(a, l, s, d, i, ajaxload.setstate) })) : ajaxload.loadpage(a, l, s, d, i, ajaxload.setstate) }) }) }, addhistoryevent: function () { window.addeventlistener("popstate", function (e) { ajaxload.stop(); var a = history.state; if (null === a) $("body").hasclass("modal-show") ? modal.close() : window.location.reload(), document.title = ajaxload.historytitle; else { var t = a.api; $(".modal").length && "" != t ? (a.mdclass.match(/thumb-modal/gi) ? ajaxload.save_thumb = $('main [data-postid="' + a.pid + '"]') : ajaxload.save_thumb = !1, ajaxload.loadpage(t, a.pid, a.title, a.link, a.mdclass, !1), document.title = a.title) : window.location.reload() } }) }, sethistory: function (e, a, t, o, i) { var n = history.state, l = null == n ? 0 : history.state.step, s = { api: e, pid: a, step: l + 1, title: t, link: o, mdclass: i }; history.pushstate(s, t, o), document.title = t }, loadpage: function (e, a, t, o, i, n) { function l() { modal.addloader(); var t = $("html").hasclass("wp") ? "post" : "get"; ajaxload.xhr = $.ajax({ type: t, url: e, data: { postid: a, }, datatype: "html", success: function(data) { settimeout(function(){ var swipers = new swiper('.max-product', { autoplay: 4000, speed: 1000, slidesperview: 1, parallax: true, loop: false, touchratio: '0.5', autoheight: true, ontransitionstart : function(swiper) { $(".product-min li").eq(swiper.realindex).addclass("active").siblings().removeclass("active"); }, }); $(document).on("click",".product-min li",function(){ $(this).addclass("active").siblings().removeclass("active"); swipers.slideto($(this).index(), 800, false); }); }); } }).done(function (e) { s(e) }) } function s(l) { function s(e) { c.html(l), c.find("img").attr("oncontextmenu", "return false").attr("ondragstart", "return false"), e && d() } function d() { "" != ajaxload.ajaxurl && modal.open() } if (ajaxload.ajaxurl = e, n && ajaxload.sethistory(e, a, t, o, i), r) { var m = r.data("largebg"); if (m) { var u = new image; u.src = m, u.complete ? s(!0) : u.onload = function () { s(!0) } } else s(!0) } else s(!1), ajaxload.preloadimg(c, d) } ajaxload.stop(), $("main .thumbs").addclass("disable"); var d = $(".modal"), r = ajaxload.save_thumb; d.removeclass(ajaxload.modalclass).addclass(i), ajaxload.modalclass = i, r && $("html").is(".desktop") && d.is(".nav-modal") && (r.parent().find(".active").removeclass("active"), r.addclass("active")); var c = $(".modal .cont"); d.hasclass("showin") ? (d.addclass("change"), $(".modal .scroll-cont").one("transitionend", function () { c.html("").removeattr("style"), d.is(".thumb-modal") && r ? thumbmodal.change(r, l) : l() })) : d.is(".thumb-modal") && r ? (modal.beforeopen(), thumbmodal.show(r, l)) : (modal.openbg(), l()); }, closemodal: function () { if (ajaxload.setstate) { var e = history.state.step; history.go(-e) } else ajaxload.stop(), modal.close() }, preloadimg: function (e, a) { function t() { var e = new image; e.src = i, e.complete ? a() : e.onload = a } var o, i, n = $(e); n.find("img").length ? (o = n.find("img").first(), i = o.attr("src"), t()) : a() }, stop: function () { ajaxload.xhr && ajaxload.xhr.abort(), ajaxload.ajaxurl = "" } }, gallery = { options: { history: !1, loop: !1, closeonscroll: !1, hideanimationduration: 400, showanimationduration: 400, showhideopacity: !0, maxspreadzoom: 1, arrowkeys: !0, barssize: { top: 0, bottom: "auto" }, fullscreenel: !0, zoomel: !1, captionel: !1, clicktoclosenonzoomable: !1, indexindicatorsep: " / " }, showgallery: function (e, a) { var t = document.queryselectorall(".pswp")[0], o, i = [], n = function () { $(".pswp__container").addclass("anim_trans"), $(".pswp__container").one("transitionend", function () { $(".pswp__container").removeclass("anim_trans") }) }; "object" === $.type(e) ? $.each(e, function (e, a) { i.push(a) }) : i = e, void 0 == a && (a = gallery.options), o = new photoswipe(t, photoswipeui_default, i, a), o.init(), o.framework.bind($(".pswp__button--arrow--left")[0], "pswptap", n), o.framework.bind($(".pswp__button--arrow--right")[0], "pswptap", n) }, init: function (e) { var a = function (e) { var a = $(e).find(".item"), t = []; return a.each(function (e) { var a = $(this), o = $(this).find("a"), i = o.data("size").split("x"), n = { src: o.data("lgimg"), w: parseint(i[0], 10), h: parseint(i[1], 10), msrc: o.find("img").attr("src"), el: a }; t.push(n) }), t }, t = function (e, t, o, i) { var n, l; l = a(t), n = gallery.options, n.galleryuid = t.data("pswp-uid"), n.getthumbboundsfn = function (e) { var a = l[e].el.find("img")[0], t = window.pageyoffset || document.documentelement.scrolltop, o = a.getboundingclientrect(); return { x: o.left, y: o.top + t, w: o.width } }, n.index = parseint(e, 10), isnan(n.index) || (o && (n.showanimationduration = 0), gallery.showgallery(l, n), tt_full_scroll && (fullscroll.kill(), fullscroll.kill($("main")))) }; $(e).each(function (e) { var a = $(this), o = a.find(".item"); a.attr("data-pswp-uid", e + 1), o.each(function (e) { $(this).find("a").on("click", function (o) { o = o || window.event, o.preventdefault ? o.preventdefault() : o.returnvalue = !1, t(e, a) }) }) }) } }, fullscroll = { modal_scroll_el: $(".modal .scroll-cont"), save_el: "", save_target: !1, init: function (e) { var a = this; a.save_el = e || $(document), "onwheel" in document.createelement("div") ? a.wheelevent = "wheel" : "onmousewheel" in document.createelement("div") && (a.wheelevent = "mousewheel"), a.passivesupported = !1; try { var t = object.defineproperty({}, "passive", { get: function () { a.passivesupported = !0 } }); window.addeventlistener("test", null, t) } catch (e) {} a.wheel_pd = function (e) { e.preventdefault() }, settimeout(function () { $("body").is(".halfscroll") ? a.halfscroll(a.save_el) : a.sectionscroll(a.save_el) }, 20) }, halfscroll: function (e) { var a = this; a.wheel = function (a, t) { if (void 0 == t && (t = a.wheeldeltay || -a.deltay || 0), 0 == t) return !0; var o = "", i = e.scrolltop(), n = $(window).height(), l = e.height() - n, s = n / 2, d = math.floor(i / s), r = s * d; if (o = t < 0 ? r + s : r - s, o < 0 && (o = 0), o > l && (o = l), !(0 == i && 0 == o || i == l && o == l)) { var c = math.abs(t), m = c < 1 ? 500 : 0; fullscroll.scroll(e, o, 600, function () { fullscroll.halfscroll(e) }, m), a.preventdefault() } }; var t = function (e) { 38 == e.which && a.wheel(e, 1), 40 != e.which && 32 != e.which || a.wheel(e, -1) }; e[0].addeventlistener(a.wheelevent, a.wheel, !!a.passivesupported && { passive: !1 }), $(document).off(".fsk").on("keydown.fsk", t) }, sectionscroll: function (e) { var a = this; a.wheel = function (t, o) { if (void 0 == o && (o = t.wheeldeltay || -t.deltay || 0), 0 == o) return !0; var i = e.find(".mscroll:above-the-top").last(), n = e.find(".mscroll:in-viewport"), l = e.find(".mscroll:below-the-fold").first(), s; if (n.length > 1 ? (s = o > 0 ? n.first() : n.last(), o > 0 && s.offset().top == e.scrolltop() && (s = i)) : s = o > 0 ? i : l, s.length > 0) { var d = math.abs(o), r = d < 1 ? 500 : 0; a.scroll(e, s, 800, function () { a.sectionscroll(e) }, r), a.save_target = s, t.preventdefault() } }; var t = function (e) { 38 == e.which && a.wheel(e, 1), 40 != e.which && 32 != e.which || a.wheel(e, -1) }; e[0].addeventlistener(a.wheelevent, a.wheel, !!a.passivesupported && { passive: !1 }), $(document).off(".fsk").on("keydown.fsk", t), 0 != a.save_target && ($(document).scrollto(a.save_target, 0), $(window).off(".fsrs").on("resize.fsrs", function () { a.scroll(e, a.save_target, 0, function () { a.sectionscroll(e) }, 0) })) }, scroll: function (e, a, t, o, i) { function n() { e[0].removeeventlistener(l.wheelevent, l.wheel_pd), $(document).off(".pd") } var l = this; e.off(".fsw .fsk"), e[0].removeeventlistener(l.wheelevent, l.wheel), e[0].addeventlistener(l.wheelevent, l.wheel_pd, !!l.passivesupported && { passive: !1 }), $(document).off(".fsk").on("keydown.pd", function (e) { e.preventdefault() }), e.scrollto(a, t, { onafter: function () { o ? i > 0 ? settimeout(function () { n(), o() }, i) : (n(), o()) : n() } }) }, kill: function (e) { var a = this, t = e || this.save_el; t[0].removeeventlistener(a.wheelevent, a.wheel), t[0].removeeventlistener(a.wheelevent, a.wheel_pd), $(document).off(".fsk .pd"), $(window).off(".fsrs") } }; iphonex = { init: function () { $(".iphonex_container").addclass("container").removeclass("iphonex_container") } }; var pop = { init: function () { $(".pop_btn").each(function () { var e = $(this), a = $(e.data("targetpop")); e.on("click", function (t) { t.preventdefault(), $(".pop.popshow").not(a).removeclass("popshow"), $(".pop_btn.active").not(e).removeclass("active"), a.toggleclass("popshow"), e.toggleclass("active"), a.hasclass("popshow") ? $(window).off("click.pop").on("click.pop", function (e) { $(e.target).closest(".pop").length || $(e.target).closest(".pop_btn").length || ($(".pop_btn.active").removeclass("active"), $(".pop.popshow").removeclass("popshow")) }) : $(window).off("click.pop") }) }) }, close: function () { $(".pop").removeclass("popshow"), $(".pop_btn").removeclass("active") } }, headslider, pagehome = { init: function () { function e(e) { var a = e.data("color"), t = a.colorrgb(".7"); e.find(".info .bg").css("background-color", t) } var a = $(".svg-slider"); headslider = new svgslider(a, { duration: 1600, autoplay: 5e3, slide_anim: !0 }), a.find(".slide").each(function () { var a = $(this), t = $(this).find(".slide_split"), o, i, n = "words"; t.hasclass("lines") && (n = "lines"), t.hasclass("chars") && (n = "chars"); var l = function () { o = new splittext(t, { position: "relative", type: n, charsclass: "spt spt-char", wordsclass: "spt spt-word", linesclass: "spt spt-line" }), t.find(".spt").each(function (e) { var a = $(this), t = a.html(), o = '
' + t + "
"; a.text("").css("text-align", ""), a.append(o) }) }; l(), e(a), $(window).resize(function () { var n = t.is(".visb"); o.revert(), cleartimeout(i), i = settimeout(function () { l(), e(a), n && t.find(".spt").addclass("visb") }, 200) }) }), pagehome.chagebg(), settimeout(function () { pagehome.animactive(), headslider.startautoplay() }, 500), headslider.ontransstart = function () { pagehome.chagebg(headslider.target_index) }, headslider.ontransend = pagehome.animactive }, animactive: function () { $(".svg-slider .slide").each(function () { var e = $(this), a = e.find(".slide_anim_emt"), t = e.find(".slide_split"), o = e.find(".slide_split .spt"), i = e.find("a"); if (e.is(".active")) { var n = o.length; a.addclass("start visb"), n ? (o.each(function (e) { var a = $(this); settimeout(function () { a.addclass("start visb"), e == n - 1 && a.one("animationend", function () { i.removeclass("no-hover") }) }, 200 * e) }), t.addclass("visb")) : i.removeclass("no-hover") } else i.addclass("no-hover"), a.removeclass("start visb"), t.removeclass("visb"), o.removeclass("start visb") }) }, chagebg: function (e) { if (e >= 0) var a = $(".svg-slider .slide").eq(e); else var a = $(".svg-slider .slide.active"); var t = a.data("color"); $(".svg-slider").css("background-color", t) }, slidetomodal: function (e) { headslider.killautoplay(), 0 == $(window).scrolltop() ? ($("body").addclass("zoomhead"), e()) : $(window).scrollto(0, 500, { onafter: function () { $("body").addclass("zoomhead"), e() } }) }, resetslider: function () { $("body").removeclass("zoomhead") } }, browserupdate = { init: function () { var e = $("#updatetip"), a = !1; $("html").is(".no-csstransforms") || $("html").is(".no-csstransitions") || $("html").is(".no-cssanimations") || $("html").is(".no-cssvhunit") ? a = !0 : $("html").is(".no-flexbox.no-flexboxlegacy.no-flexboxtweener") && (a = !0), a ? e.slidedown(500) : e.remove(), e.find(".close").click(function () { e.slideup(500, function () { e.hide() }) }) } }; !$("html").is(".mobile") || $("html").is(".ios8") || $("html").is(".wechat_ios8") || $("html").addclass("no-scroll"); var tt_full_scroll = $("html").is(".desktop") && !$("html").is(".firefox") && $("body").is(".fullscroll"), proloader = { init: function () { function e() { $(".proload_img").each(function () { var e = $(this).is("img") ? $(this).attr("src") : $(this).data("bgimg"), t = new image; t.src = e, t.complete ? a() : t.onload = a }) } function a() { $("#pageloader .progress>div").eq(s - 1).addclass("active"), s == l ? t() : s++ } function t() { $("[data-bgimg]").each(function () { var e = $(this).data("bgimg"); $(this).css("background-image", "url(" + e + ")") }), settimeout(function () { ($("body").is(".page-home") || $("body").is(".single")) && $(window).scrolltop(0), $(".svg-slider .slide").first().addclass("active"), $("body").removeclass("loading").addclass("init"), $(".sizefix").length && sizefix.init(), $(".scroll-p-fix").length && scrollfixnav.init(), tt_full_scroll && fullscroll.init(), $("html").is(".cssanimations") && ics && animelements.init(), $("#pageloader").one("transitionend", function () { settimeout(function () { $("body").is(".page-home") ? o() : i() }, 500) }) }, 100) } function o() { $(".svg-slider").removeclass("loading"), $(".svg-slider .slider-container").one("transitionend", function () { pagehome.init(), i() }), $(".svg-slider .btm").one("transitionend", function () { $(".svg-slider").removeclass("init_trans") }) } function i() { $("#pageloader").remove(), $(".nav-header").addclass("init"), $("body").is(".desktop") && browserupdate.init() } var n = 0; $("body").is(".page-portfolio") && (n = 4), $("body").is(".page-blog") && (n = 3), $("#thumbs .item").each(function (e) { e < n && $(this).find(".thumb-img").addclass("proload_img") }); var l = $(".proload_img").length, s = 1; $("#pageloader .number").html(l), $(".proload_img").each(function () { $("#pageloader .progress").append("
") }), settimeout(function () { var a = anime({ targets: "#pageloader .logo path", strokedashoffset: [anime.setdashoffset, 0], easing: "easeinoutsine", duration: 2000, delay: function (e, a) { return 250 * a }, direction: "alternate", loop: !1, complete: function (a) { $("#pageloader .cont").addclass("showin"), settimeout(function () { 0 == l ? t() : e() }, 800) } }); $("#pageloader .cont").addclass("visb") }, 1500) } }; if ($(function () { headernav.init(), pop.init(), ajaxload.init(), $(".gallery-thumbs").length && ics && gallery.init(".gallery-thumbs"), $("html").is(".iphone_x") && iphonex.init(), $(".filter-nav").length && navfilter.init(), $(".dropdown-nav").length && dropdownnav.init(), proloader.init(), $("img").attr("oncontextmenu", "return false").attr("ondragstart", "return false") }), $("html").is(".ios10")) { document.addeventlistener("touchstart", function (e) { e.touches.length > 1 && e.preventdefault() }); var lasttouchend = 0; document.addeventlistener("touchend", function (e) { var a = (new date).gettime(); a - lasttouchend <= 300 && e.preventdefault(), lasttouchend = a }, !1) }