"use strict"; var _typeof2 = 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; }; var _typeof = "function" == typeof symbol && "symbol" == _typeof2(symbol.iterator) ? function (t) { return typeof t === "undefined" ? "undefined" : _typeof2(t); } : function (t) { return t && "function" == typeof symbol && t.constructor === symbol && t !== symbol.prototype ? "symbol" : typeof t === "undefined" ? "undefined" : _typeof2(t); };!function (t, n, e) { n.yunu = { init: function init() { return (arguments[0] ? arguments[0] : {}).imgauto && t("img").each(function () { var n = t(this);n.attr("img-auto") && ("cover" == n.attr("img-auto") ? n.imgauto("cover") : n.imgauto()); }), t("body").fadeto("fast", 1), this; }, rem: function rem(e) { return e = e || 640, t(n).width() > 1024 ? t("html").css("font-size", 320) : t("html").css("font-size", t(n).width() / e * 100), this; }, nav: function nav() { var n = t("#nav"), e = t("#nav>ul>li>a");return t("#menu").click(function () { n.addclass("in"); }), n.click(function () { n.removeclass("in"); }), t("#nav>ul").click(function (t) { t.stoppropagation(); }), e.each(function () { var n = t(this);n.next("ul").children().length && n.prop("href", "javascript:;").append(''); }).click(function (n) { var i = t(this), o = e.filter(function (n) { return t(this).hasclass("in"); }), a = function a(t, n) { "down" == n ? t.addclass("in").next("ul").slidedown("fast") : t.removeclass("in").next("ul").slideup("fast"); };o === i ? a(i, "up") : (a(i, "down"), a(o, "up")); }), this; }, letter: function letter(t) { if ("function" == typeof arguments[0]) { t();var n = "number" != typeof arguments[1] ? 300 : arguments[1], e = null, i = new date().gettime();return function () { var o = new date().gettime();o - i < n ? (cleartimeout(e), e = settimeout(function () { t(); }, n)) : (cleartimeout(e), i = o, t()); }; } }, css3: function () { var t = document.createelement("div"), n = "ms o moz webkit".split(" ");return function (e) { var i = n.length;if ("string" != typeof e) return !1;if (e in t.style) return !0;for (e = e.replace(/^[a-z]/, function (t) { return t.touppercase(); }); i--;) { if (n[i] + e in t.style) return !0; }return !1; }; }(), css3_3d: function css3_3d() { var t = document.documentelement, n = yunu.css3("perspective"), e = document.body;if (n && "webkitperspective" in t.style) { var i = document.createelement("style");i.type = "text/css", i.innerhtml = "@media (transform-3d),(-webkit-transform-3d){#css3_3d_test{left:9px;position:absolute;height:3px;}}", e.appendchild(i);var o = document.createelement("div");o.id = "css3_3d_test", e.appendchild(o), n = 9 === o.offsetleft && 3 === o.offsetheight; }return yunu.css3_3d = function () { return n; }, n; }, lazyload: function lazyload(e, i) { return e.each(function (o) { var a = t(this);return void 0 === a.attr("data-src") && void 0 === i ? (yunu.lazyload(e.not(a)), !1) : (a.show = function () { if (!(t(n).height() + t(n).scrolltop() > a.offset().top - (parseint(a.css("top")) || 0))) return !1;"function" == typeof i ? i.call(a) : i ? a.animate({ top: 0, left: 0 }, parseint(a.attr("timer")) || 2e3, function () {}) : a.attr("src", a.attr("data-src")).removeattr("data-src"), t(n).unbind("scroll", a.show); }, !1 !== a.show() ? (settimeout(function () { yunu.lazyload(e.not(a)); }), !1) : void t(n).bind("scroll", a.show)); }), this; }, loadmore: function loadmore() { var n = arguments.length > 0 && arguments[0] !== e ? arguments[0] : {}, i = function i() { t.ajax({ url: n.url, type: n.type, data: n.data, datatype: "jsonp", beforesend: function beforesend(t) { n.beforesend(t), n.btn.attr("disabled", !0); } }).done(function (t, e, i) { n.done(t, e, i), t.data.length < n.data.limit && n.btn.replacewith(n.load_more_none); }).fail(function (t, e, i) { n.fail(t, e, i); }).always(function (t, e, i) { n.always(t, e, i), n.key = !0, n.btn.attr("disabled", !1); }); };(n = t.extend(!0, { key: !0, url: "", type: "post", btn: t("#load_more_btn"), box: t("#list>ul"), data: { pages: 1, limit: 5 }, beforesend: function beforesend() {}, done: function done() {}, fail: function fail() {}, always: function always() {}, load_icon: !0, load_icon_class: "", loading: t('
'), load_more_none: t('

没有了

') }, n)).load_icon && (t(n.loading).addclass(n.load_icon_class), n.btn.after(n.loading)), n.btn.click(function () { n.key && (n.key = !1, n.data.pages++, i()); }); }, tab: function tab(n, e, i) { var n = t(n), e = t(e), o = function o(_o) { var a = t(_o).data("i");n.removeclass("active").eq(a).addclass("active"), e.hide().eq(a).stop(!0, !0).fadeto(0, .5).fadeto("fast", 1), i && i(_o); };return n.each(function (t) { n.eq(t).data("i", t); }).click(function () { o(this); }), o(n.first()), this; }, scrolltop: function scrolltop() { var e, i, o, a, s, r, c;return i = "number" != typeof arguments[1] ? 150 : arguments[1], "object" == _typeof(arguments[0]) ? "box" == arguments[2] ? (o = a = arguments[0], s = e = t("a[href='#top']"), r = yunu.letter(function () { a.scrolltop() > i ? e.fadein() : e.fadeout("fast"); })) : (o = t("html,body"), a = t(n), s = arguments[0], e = s.find("a[href='#top']"), r = yunu.letter(function () { c = (a.height() - s.height()) / 2, s.animate({ top: c + a.scrolltop() }), a.scrolltop() + c > i && s.is(":hidden") && s.stop(!0, !0).fadein(), a.scrolltop() + c < i && !s.is(":hidden") && s.stop(!0).fadeout("fast"); })) : (o = t("html,body"), a = t(n), s = e = t("a[href='#top']"), r = yunu.letter(function () { a.scrolltop() > i ? e.fadein() : e.fadeout("fast"); })), e.click(function () { event.stoppropagation(), event.preventdefault(), o.animate({ scrolltop: 0 }), s.fadeout(); }), a.scroll(r), this; } }, t.fn.roll = function () { var e = this, i = arguments[0] ? arguments[0] : {};"number" != typeof i.num && (i.num = 1), "number" != typeof i.timer && (i.timer = 6e3), "number" != typeof i.speed && (i.speed = 400), "string" != typeof i.easing && (i.easing = "swing"), "string" != typeof i.timing && (i.timing = "ease-out"), void 0 === i.adaptive && (i.adaptive = !0), void 0 === i.center && (i.center = !0);var o, a, s, r, c, l, u, d, f = e.find("ul"), h = f.find("li"), p = h.length, m = h.outerwidth(!0), v = i.lbtn || e.find(".btn_l"), g = i.rbtn || e.find(".btn_r"), y = e.find(".banner_btn").find("a"), b = -p, w = null, _ = !1, t = !1, x = 0, k = 0, c = 0, a = 0, z = yunu.css3_3d(), i = function i() { return "translate3d(" + m * b + "px, 0px, 0px)"; }, s = function s() { return m * b; };if (e.roll_stop = function () { clearinterval(w); }, e.roll_start = function (t) { t && (_ = !1), clearinterval(w), w = setinterval(function () { o("-"); }, i.timer); }, f.html(f.html() + f.html() + f.html()), h = f.find("li"), p = h.length, e.css({ position: "relative", overflow: "hidden", margin: "0 auto", width: i.width ? i.width : i.banner ? "100%" : i.num * m }), h.css({ width: i.banner ? m : h.width(), height: "auto", float: "left", position: "relative", overflow: "hidden" }), f.css({ width: p * m, height: "auto" }), i.height && e.height(i.height), i.btn) { a = t(''), s = t("");for (var d = 0; d < p / 3; d++) { s.append(''); }(y = s.find("a")).first().addclass("in"), a.append(s), e.append(a), "all" == i.btn && (e.append(''), v = e.find(".banner_l"), g = e.find(".banner_r")); }return r = y.add(v).add(g), i.banner ? (u = t("div.center:first"), (d = function d() { c = e.width(), l = u.width(), m = i.adaptive ? c : c > l ? c : l, h.width(m), f.width(p * m), z ? f.css({ transform: i(), transition: "transform 0ms" }) : f.css({ left: s() }); })(), t(n).resize(function () { d(); })) : r.add(h), z ? f.css({ transform: i() }).on("webkittransitionend", function () { _ && (b >= 0 && (b = -p / 3, f.css({ transform: i(), transition: "transform 0ms" })), b <= -(p - i.num) && (b = -(2 * p / 3 - i.num), f.css({ transform: i(), transition: "transform 0ms" })), _ = !1); }) : f.css({ position: "absolute", top: 0, left: s() }), o = function o(t) { _ || (_ = !0, void 0 !== t && ("+" == t ? b++ : b--), y.removeclass("in").eq(-b % (p / 3)).addclass("in"), z ? f.css({ transform: i(), transition: "transform " + i.speed + "ms " + i.timing }) : f.stop(!0, !0).animate({ left: s() }, i.speed, i.easing, function () { b >= 0 && (b = -p / 3, f.css("left", s())), b <= -(p - i.num) && (b = -(2 * p / 3 - i.num), f.css("left", s())), _ = !1; })); }, v.click(function () { o("+"); }), g.click(function () { o("-"); }), y.click(function (n) { n.stoppropagation(), _ = !1, b = -p / 3 - t(this).index(), o(); }), e.on("touchstart", function (t) { _ = !1, f.css("transition", "transform 0ms"), e.roll_stop(), x = t.originalevent.changedtouches[0].clientx, c = date.now(), a = f.position().left, c = e.width() / i.num; }), e.on("touchmove", function (t) { t.preventdefault(), (k = t.originalevent.changedtouches[0].clientx - x) > c / 3 ? f.css("transform", "translate3d(" + (a + c / 3 + 2 * c / 3 * (1 - c / 3 / k)) + "px, 0px, 0px)") : k < -c / 3 ? f.css("transform", "translate3d(" + (a - c / 3 - 2 * c / 3 * (1 - -c / 3 / k)) + "px, 0px, 0px)") : f.css("transform", "translate3d(" + (a + k) + "px, 0px, 0px)"); }), e.on("touchend", function (t) { t = !1, b >= 0 && k > 0 && (b = -1, t = 1), b <= -(p - i.num) && k < 0 && (b = 1 - (p - i.num), t = 2), (k = t.originalevent.changedtouches[0].clientx - x) >= c / 3 || date.now() - c < 300 && k > 30 || 1 == t ? o("+") : k < -c / 3 || date.now() - c < 300 && k < -30 || 2 == t ? o("-") : o(), e.roll_start(); }), w = setinterval(function () { o("-"); }, i.timer), r.hover(function () { e.roll_stop(); }, function () { e.roll_start(); }), e.fadeto("slow", 1), this; }, t.fn.imgauto = function (e, i) { i = arguments[1] ? arguments[1] : {};var o = function o(t, n) { "function" == typeof i[t] && i[t](n); };return t(this).each(function () { function i() { s.width > 0 || s.height > 0 ? (o("imgautostart", s), a.css({ display: "block", margin: 0 }).parent().css("overflow", "hidden"), c = s.width, l = s.height, u = r.width(), d = r.height(), f = d / l * c, h = u / c * l, c / l < u / d ? p ? a.css({ width: "100%", height: "auto" }).css("margin-top", -(h - d) / 2) : a.css({ width: "auto", height: "100%" }).css("margin-left", (u - f) / 2) : p ? a.css({ width: "auto", height: "100%" }).css("margin-left", -(f - u) / 2) : a.css({ width: "100%", height: "auto" }).css("margin-top", (d - h) / 2)) : settimeout(i), o("callback", s); }var a = t(this);a.css("opacity", 0);var s = new image();s.src = a.attr("src");var r, c, l, u, d, f, h, p = !("cover" != a.attr("img-auto") && !e), m = a.attr("width"), v = a.attr("height");m && v ? ((r = t('
')).css({ width: m, height: v, "text-align": "left", overflow: "hidden" }), a.wrapall(r)) : r = a.parent(), i(), a.fadeto(2e3, 1);var g = yunu.letter(i);t(n).resize(g); }), this; }; }(jquery, window, document), yunu.rem(320), $(window).resize(function () { yunu.rem(320); }); $(function () { new wow({ mobile: false }).init(); }); //# sourcemappingurl=yunu.js.map //# sourcemappingurl=yunu.js.map