ruạṛ
/* * Foundation Responsive Library * http://foundation.zurb.com * Copyright 2014, ZURB * Free to use under the MIT license. * http://www.opensource.org/licenses/mit-license.php */ (function (e, t, n, r) { "use strict"; function l(e) { if (typeof e == "string" || e instanceof String)e = e.replace(/^['\\/"]+|(;\s?})+|['\\/"]+$/g, ""); return e } var i = function (t) { var n = t.length, r = e("head"); while (n--)r.has("." + t[n]).length === 0 && r.append('<meta class="' + t[n] + '" />') }; i(["foundation-mq-small", "foundation-mq-medium", "foundation-mq-large", "foundation-mq-xlarge", "foundation-mq-xxlarge", "foundation-data-attribute-namespace"]), e(function () { typeof FastClick != "undefined" && typeof n.body != "undefined" && FastClick.attach(n.body) }); var s = function (t, r) { if (typeof t == "string") { if (r) { var i; if (r.jquery) { i = r[0]; if (!i)return r } else i = r; return e(i.querySelectorAll(t)) } return e(n.querySelectorAll(t)) } return e(t, r) }, o = function (e) { var t = []; return e || t.push("data"), this.namespace.length > 0 && t.push(this.namespace), t.push(this.name), t.join("-") }, u = function (e) { var t = e.split("-"), n = t.length, r = []; while (n--)n !== 0 ? r.push(t[n]) : this.namespace.length > 0 ? r.push(this.namespace, t[n]) : r.push(t[n]); return r.reverse().join("-") }, a = function (t, n) { var r = this, i = !s(this).data(this.attr_name(!0)); if (typeof t == "string")return this[t].call(this, n); s(this.scope).is("[" + this.attr_name() + "]") ? (s(this.scope).data(this.attr_name(!0) + "-init", e.extend({}, this.settings, n || t, this.data_options(s(this.scope)))), i && this.events(this.scope)) : s("[" + this.attr_name() + "]", this.scope).each(function () { var i = !s(this).data(r.attr_name(!0) + "-init"); s(this).data(r.attr_name(!0) + "-init", e.extend({}, r.settings, n || t, r.data_options(s(this)))), i && r.events(this) }) }, f = function (e, t) { function n() { t(e[0]) } function r() { this.one("load", n); if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { var e = this.attr("src"), t = e.match(/\?/) ? "&" : "?"; t += "random=" + (new Date).getTime(), this.attr("src", e + t) } } if (!e.attr("src")) { n(); return } e[0].complete || e[0].readyState === 4 ? n() : r.call(e) }; t.matchMedia = t.matchMedia || function (e) { var t, n = e.documentElement, r = n.firstElementChild || n.firstChild, i = e.createElement("body"), s = e.createElement("div"); return s.id = "mq-test-1", s.style.cssText = "position:absolute;top:-100em", i.style.background = "none", i.appendChild(s), function (e) { return s.innerHTML = '­<style media="' + e + '"> #mq-test-1 { width: 42px; }</style>', n.insertBefore(i, r), t = s.offsetWidth === 42, n.removeChild(i), {matches: t, media: e} } }(n), function (e) { function a() { n && (s(a), u && jQuery.fx.tick()) } var n, r = 0, i = ["webkit", "moz"], s = t.requestAnimationFrame, o = t.cancelAnimationFrame, u = "undefined" != typeof jQuery.fx; for (; r < i.length && !s; r++)s = t[i[r] + "RequestAnimationFrame"], o = o || t[i[r] + "CancelAnimationFrame"] || t[i[r] + "CancelRequestAnimationFrame"]; s ? (t.requestAnimationFrame = s, t.cancelAnimationFrame = o, u && (jQuery.fx.timer = function (e) { e() && jQuery.timers.push(e) && !n && (n = !0, a()) }, jQuery.fx.stop = function () { n = !1 })) : (t.requestAnimationFrame = function (e) { var n = (new Date).getTime(), i = Math.max(0, 16 - (n - r)), s = t.setTimeout(function () { e(n + i) }, i); return r = n + i, s }, t.cancelAnimationFrame = function (e) { clearTimeout(e) }) }(jQuery), t.Foundation = {name: "Foundation", version: "5.2.2", media_queries: {small: s(".foundation-mq-small").css("font-family").replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ""), medium: s(".foundation-mq-medium").css("font-family").replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ""), large: s(".foundation-mq-large").css("font-family").replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ""), xlarge: s(".foundation-mq-xlarge").css("font-family").replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ""), xxlarge: s(".foundation-mq-xxlarge").css("font-family").replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, "")}, stylesheet: e("<style></style>").appendTo("head")[0].sheet, global: {namespace: r}, init: function (e, t, n, r, i) { var o = [e, n, r, i], u = []; this.rtl = /rtl/i.test(s("html").attr("dir")), this.scope = e || this.scope, this.set_namespace(); if (t && typeof t == "string" && !/reflow/i.test(t))this.libs.hasOwnProperty(t) && u.push(this.init_lib(t, o)); else for (var a in this.libs)u.push(this.init_lib(a, t)); return e }, init_lib: function (t, n) { return this.libs.hasOwnProperty(t) ? (this.patch(this.libs[t]), n && n.hasOwnProperty(t) ? (typeof this.libs[t].settings != "undefined" ? e.extend(!0, this.libs[t].settings, n[t]) : typeof this.libs[t].defaults != "undefined" && e.extend(!0, this.libs[t].defaults, n[t]), this.libs[t].init.apply(this.libs[t], [this.scope, n[t]])) : (n = n instanceof Array ? n : new Array(n), this.libs[t].init.apply(this.libs[t], n))) : function () { } }, patch: function (e) { e.scope = this.scope, e.namespace = this.global.namespace, e.rtl = this.rtl, e.data_options = this.utils.data_options, e.attr_name = o, e.add_namespace = u, e.bindings = a, e.S = this.utils.S }, inherit: function (e, t) { var n = t.split(" "), r = n.length; while (r--)this.utils.hasOwnProperty(n[r]) && (e[n[r]] = this.utils[n[r]]) }, set_namespace: function () { var t = this.global.namespace === r ? e(".foundation-data-attribute-namespace").css("font-family") : this.global.namespace; this.global.namespace = t === r || /false/i.test(t) ? "" : t }, libs: {}, utils: {S: s, throttle: function (e, t) { var n = null; return function () { var r = this, i = arguments; n == null && (n = setTimeout(function () { e.apply(r, i), n = null }, t)) } }, debounce: function (e, t, n) { var r, i; return function () { var s = this, o = arguments, u = function () { r = null, n || (i = e.apply(s, o)) }, a = n && !r; return clearTimeout(r), r = setTimeout(u, t), a && (i = e.apply(s, o)), i } }, data_options: function (t) { function a(e) { return!isNaN(e - 0) && e !== null && e !== "" && e !== !1 && e !== !0 } function f(t) { return typeof t == "string" ? e.trim(t) : t } var n = {}, r, i, s, o = function (e) { var t = Foundation.global.namespace; return t.length > 0 ? e.data(t + "-options") : e.data("options") }, u = o(t); if (typeof u == "object")return u; s = (u || ":").split(";"), r = s.length; while (r--)i = s[r].split(":"), /true/i.test(i[1]) && (i[1] = !0), /false/i.test(i[1]) && (i[1] = !1), a(i[1]) && (i[1].indexOf(".") === -1 ? i[1] = parseInt(i[1], 10) : i[1] = parseFloat(i[1])), i.length === 2 && i[0].length > 0 && (n[f(i[0])] = f(i[1])); return n }, register_media: function (t, n) { Foundation.media_queries[t] === r && (e("head").append('<meta class="' + n + '">'), Foundation.media_queries[t] = l(e("." + n).css("font-family"))) }, add_custom_rule: function (e, t) { if (t === r && Foundation.stylesheet)Foundation.stylesheet.insertRule(e, Foundation.stylesheet.cssRules.length); else { var n = Foundation.media_queries[t]; n !== r && Foundation.stylesheet.insertRule("@media " + Foundation.media_queries[t] + "{ " + e + " }") } }, image_loaded: function (e, t) { var n = this, r = e.length; r === 0 && t(e), e.each(function () { f(n.S(this), function () { r -= 1, r === 0 && t(e) }) }) }, random_str: function () { return this.fidx || (this.fidx = 0), this.prefix = this.prefix || [this.name || "F", (+(new Date)).toString(36)].join("-"), this.prefix + (this.fidx++).toString(36) }}}, e.fn.foundation = function () { var e = Array.prototype.slice.call(arguments, 0); return this.each(function () { return Foundation.init.apply(Foundation, [this].concat(e)), this }) } })(jQuery, this, this.document), function (e, t, n, r) { "use strict"; var i = function () { }, s = function (r, i) { if (r.hasClass(i.slides_container_class))return this; var s = this, a, f = r, l, c, h, p = 0, d, v = !1, m = f.find("." + i.active_slide_class).length > 0; s.cache = {}, s.slides = function () { return f.children(i.slide_selector) }, m || s.slides().first().addClass(i.active_slide_class), s.update_slide_number = function (t) { i.slide_number && (l.find("span:first").text(parseInt(t) + 1), l.find("span:last").text(s.slides().length)), i.bullets && (c.children().removeClass(i.bullets_active_class), e(c.children().get(t)).addClass(i.bullets_active_class)) }, s.update_active_link = function (t) { var n = e('[data-orbit-link="' + s.slides().eq(t).attr("data-orbit-slide") + '"]'); n.siblings().removeClass(i.bullets_active_class), n.addClass(i.bullets_active_class) }, s.build_markup = function () { f.wrap('<div class="' + i.container_class + '"></div>'), a = f.parent(), f.addClass(i.slides_container_class), f.addClass(i.animation), i.stack_on_small && a.addClass(i.stack_on_small_class), i.navigation_arrows && (a.append(e('<a href="#"><span></span></a>').addClass(i.prev_class)), a.append(e('<a href="#"><span></span></a>').addClass(i.next_class))), i.timer && (h = e("<div>").addClass(i.timer_container_class), h.append("<span>"), i.timer_show_progress_bar && h.append(e("<div>").addClass(i.timer_progress_class)), h.addClass(i.timer_paused_class), a.append(h)), i.slide_number && (l = e("<div>").addClass(i.slide_number_class), l.append("<span></span> " + i.slide_number_text + " <span></span>"), a.append(l)), i.bullets && (c = e("<ol>").addClass(i.bullets_container_class), a.append(c), c.wrap('<div class="orbit-bullets-container"></div>'), s.slides().each(function (t, n) { var r = e("<li>").attr("data-orbit-slide", t); c.append(r) })) }, s._prepare_direction = function (t, n) { var r = "next"; t <= p && (r = "prev"), i.animation === "slide" && setTimeout(function () { f.removeClass("swipe-prev swipe-next"), r === "next" ? f.addClass("swipe-next") : r === "prev" && f.addClass("swipe-prev") }, 0); var o = s.slides(); if (t >= o.length) { if (!i.circular)return!1; t = 0 } else if (t < 0) { if (!i.circular)return!1; t = o.length - 1 } var u = e(o.get(p)), a = e(o.get(t)); return[r, u, a, t] }, s._goto = function (e, t) { if (e === null)return!1; if (s.cache.animating)return!1; if (e === p)return!1; typeof s.cache.timer == "object" && s.cache.timer.restart(); var n = s.slides(); s.cache.animating = !0; var r = s._prepare_direction(e), o = r[0], u = r[1], a = r[2], e = r[3]; if (r === !1)return!1; f.trigger("before-slide-change.fndtn.orbit"), i.before_slide_change(), p = e, u.css("transitionDuration", i.animation_speed + "ms"), a.css("transitionDuration", i.animation_speed + "ms"); var l = function () { var r = function () { t === !0 && s.cache.timer.restart(), s.update_slide_number(p), a.addClass(i.active_slide_class), s.update_active_link(e), f.trigger("after-slide-change.fndtn.orbit", [ {slide_number: p, total_slides: n.length} ]), i.after_slide_change(p, n.length), setTimeout(function () { s.cache.animating = !1 }, 100) }; f.height() != a.height() && i.variable_height ? f.animate({height: a.height()}, 250, "linear", r) : r() }; if (n.length === 1)return l(), !1; var c = function () { o === "next" && d.next(u, a, l), o === "prev" && d.prev(u, a, l) }; a.height() > f.height() && i.variable_height ? f.animate({height: a.height()}, 250, "linear", c) : c() }, s.next = function (e) { e.stopImmediatePropagation(), e.preventDefault(), s._prepare_direction(p + 1), setTimeout(function () { s._goto(p + 1) }, 100) }, s.prev = function (e) { e.stopImmediatePropagation(), e.preventDefault(), s._prepare_direction(p - 1), setTimeout(function () { s._goto(p - 1) }, 100) }, s.link_custom = function (t) { t.preventDefault(); var n = e(this).attr("data-orbit-link"); if (typeof n == "string" && (n = e.trim(n)) != "") { var r = a.find("[data-orbit-slide=" + n + "]"); r.index() != -1 && setTimeout(function () { s._goto(r.index()) }, 100) } }, s.link_bullet = function (t) { var n = e(this).attr("data-orbit-slide"); if (typeof n == "string" && (n = e.trim(n)) != "")if (isNaN(parseInt(n))) { var r = a.find("[data-orbit-slide=" + n + "]"); r.index() != -1 && setTimeout(function () { s._goto(r.index() + 1) }, 100) } else setTimeout(function () { s._goto(parseInt(n)) }, 100) }, s.timer_callback = function () { s._goto(p + 1, !0) }, s.compute_dimensions = function () { var t = e(s.slides().get(p)), n = t.height(); i.variable_height || s.slides().each(function () { e(this).height() > n && (n = e(this).height()) }), f.height(n) }, s.create_timer = function () { var e = new o(a.find("." + i.timer_container_class), i, s.timer_callback); return e }, s.stop_timer = function () { typeof s.cache.timer == "object" && s.cache.timer.stop() }, s.toggle_timer = function () { var e = a.find("." + i.timer_container_class); e.hasClass(i.timer_paused_class) ? (typeof s.cache.timer == "undefined" && (s.cache.timer = s.create_timer()), s.cache.timer.start()) : typeof s.cache.timer == "object" && s.cache.timer.stop() }, s.init = function () { s.build_markup(), i.timer && (s.cache.timer = s.create_timer(), Foundation.utils.image_loaded(this.slides().children("img"), s.cache.timer.start)), d = new u(i, f); if (m) { var r = f.find("." + i.active_slide_class), o = i.animation_speed; i.animation_speed = 1, r.removeClass("active"), s._goto(r.index()), i.animation_speed = o } a.on("click", "." + i.next_class, s.next), a.on("click", "." + i.prev_class, s.prev), i.next_on_click && a.on("click", "[data-orbit-slide]", s.link_bullet), a.on("click", s.toggle_timer), i.swipe && f.on("touchstart.fndtn.orbit", function (e) { if (s.cache.animating)return; e.touches || (e = e.originalEvent), e.preventDefault(), e.stopPropagation(), s.cache.start_page_x = e.touches[0].pageX, s.cache.start_page_y = e.touches[0].pageY, s.cache.start_time = (new Date).getTime(), s.cache.delta_x = 0, s.cache.is_scrolling = null, s.cache.direction = null, s.stop_timer() }).on("touchmove.fndtn.orbit", function (e) { Math.abs(s.cache.delta_x) > 5 && (e.preventDefault(), e.stopPropagation()); if (s.cache.animating)return; requestAnimationFrame(function () { e.touches || (e = e.originalEvent); if (e.touches.length > 1 || e.scale && e.scale !== 1)return; s.cache.delta_x = e.touches[0].pageX - s.cache.start_page_x, s.cache.is_scrolling === null && (s.cache.is_scrolling = !!(s.cache.is_scrolling || Math.abs(s.cache.delta_x) < Math.abs(e.touches[0].pageY - s.cache.start_page_y))); if (s.cache.is_scrolling)return; var t = s.cache.delta_x < 0 ? p + 1 : p - 1; if (s.cache.direction !== t) { var n = s._prepare_direction(t); s.cache.direction = t, s.cache.dir = n[0], s.cache.current = n[1], s.cache.next = n[2] } if (i.animation === "slide") { var r, o; r = s.cache.delta_x / a.width() * 100, r >= 0 ? o = -(100 - r) : o = 100 + r, s.cache.current.css("transform", "translate3d(" + r + "%,0,0)"), s.cache.next.css("transform", "translate3d(" + o + "%,0,0)") } }) }).on("touchend.fndtn.orbit", function (e) { if (s.cache.animating)return; e.preventDefault(), e.stopPropagation(), setTimeout(function () { s._goto(s.cache.direction) }, 50) }), a.on("mouseenter.fndtn.orbit", function (e) { i.timer && i.pause_on_hover && s.stop_timer() }).on("mouseleave.fndtn.orbit", function (e) { i.timer && i.resume_on_mouseout && s.cache.timer.start() }), e(n).on("click", "[data-orbit-link]", s.link_custom), e(t).on("load resize", s.compute_dimensions); var l = this.slides().find("img"); Foundation.utils.image_loaded(l, s.compute_dimensions), Foundation.utils.image_loaded(l, function () { a.prev("." + i.preloader_class).css("display", "none"), s.update_slide_number(p), s.update_active_link(p), f.trigger("ready.fndtn.orbit") }) }, s.init() }, o = function (e, t, n) { var r = this, i = t.timer_speed, s = e.find("." + t.timer_progress_class), o = s && s.css("display") != "none", u, a, f = -1; this.update_progress = function (e) { var t = s.clone(); t.attr("style", ""), t.css("width", e + "%"), s.replaceWith(t), s = t }, this.restart = function () { clearTimeout(a), e.addClass(t.timer_paused_class), f = -1, o && r.update_progress(0), r.start() }, this.start = function () { if (!e.hasClass(t.timer_paused_class))return!0; f = f === -1 ? i : f, e.removeClass(t.timer_paused_class), o && (u = (new Date).getTime(), s.animate({width: "100%"}, f, "linear")), a = setTimeout(function () { r.restart(), n() }, f), e.trigger("timer-started.fndtn.orbit") }, this.stop = function () { if (e.hasClass(t.timer_paused_class))return!0; clearTimeout(a), e.addClass(t.timer_paused_class); if (o) { var n = (new Date).getTime(); f -= n - u; var s = 100 - f / i * 100; r.update_progress(s) } e.trigger("timer-stopped.fndtn.orbit") } }, u = function (e, t) { var n = "webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend"; this.next = function (r, i, s) { Modernizr.csstransitions ? i.on(n, function (e) { i.unbind(n), r.removeClass("active animate-out"), i.removeClass("animate-in"), t.children().css({transform: "", "-ms-transform": "", "-webkit-transition-duration": "", "-moz-transition-duration": "", "-o-transition-duration": "", "transition-duration": ""}), s() }) : setTimeout(function () { r.removeClass("active animate-out"), i.removeClass("animate-in"), t.children().css({transform: "", "-ms-transform": "", "-webkit-transition-duration": "", "-moz-transition-duration": "", "-o-transition-duration": "", "transition-duration": ""}), s() }, e.animation_speed), t.children().css({transform: "", "-ms-transform": "", "-webkit-transition-duration": "", "-moz-transition-duration": "", "-o-transition-duration": "", "transition-duration": ""}), r.addClass("animate-out"), i.addClass("animate-in") }, this.prev = function (r, i, s) { Modernizr.csstransitions ? i.on(n, function (e) { i.unbind(n), r.removeClass("active animate-out"), i.removeClass("animate-in"), t.children().css({transform: "", "-ms-transform": "", "-webkit-transition-duration": "", "-moz-transition-duration": "", "-o-transition-duration": "", "transition-duration": ""}), s() }) : setTimeout(function () { r.removeClass("active animate-out"), i.removeClass("animate-in"), t.children().css({transform: "", "-ms-transform": "", "-webkit-transition-duration": "", "-moz-transition-duration": "", "-o-transition-duration": "", "transition-duration": ""}), s() }, e.animation_speed), t.children().css({transform: "", "-ms-transform": "", "-webkit-transition-duration": "", "-moz-transition-duration": "", "-o-transition-duration": "", "transition-duration": ""}), r.addClass("animate-out"), i.addClass("animate-in") } }; Foundation.libs = Foundation.libs || {}, Foundation.libs.orbit = {name: "orbit", version: "5.2.2", settings: {animation: "slide", timer_speed: 1e4, pause_on_hover: !0, resume_on_mouseout: !1, next_on_click: !0, animation_speed: 500, stack_on_small: !1, navigation_arrows: !0, slide_number: !0, slide_number_text: "of", container_class: "orbit-container", stack_on_small_class: "orbit-stack-on-small", next_class: "orbit-next", prev_class: "orbit-prev", timer_container_class: "orbit-timer", timer_paused_class: "paused", timer_progress_class: "orbit-progress", timer_show_progress_bar: !0, slides_container_class: "orbit-slides-container", preloader_class: "preloader", slide_selector: "*", bullets_container_class: "orbit-bullets", bullets_active_class: "active", slide_number_class: "orbit-slide-number", caption_class: "orbit-caption", active_slide_class: "active", orbit_transition_class: "orbit-transitioning", bullets: !0, circular: !0, timer: !0, variable_height: !1, swipe: !0, before_slide_change: i, after_slide_change: i}, init: function (e, t, n) { var r = this; this.bindings(t, n) }, events: function (e) { var t = new s(this.S(e), this.S(e).data("orbit-init")); this.S(e).data(self.name + "-instance", t) }, reflow: function () { var e = this; if (e.S(e.scope).is("[data-orbit]")) { var t = e.S(e.scope), n = t.data(e.name + "-instance"); n.compute_dimensions() } else e.S("[data-orbit]", e.scope).each(function (t, n) { var r = e.S(n), i = e.data_options(r), s = r.data(e.name + "-instance"); s.compute_dimensions() }) }} }(jQuery, this, this.document);
cải xoăn