mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-15 19:58:00 +00:00
1 line
3.3 KiB
JavaScript
1 line
3.3 KiB
JavaScript
"use strict"; var _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t }; !function (t) { function o(o, r) { function n() { var o = t("<iframe>").attr("src", s.chatUrl).css({ width: "100%", height: "100%", borderWidth: "2px", borderColor: "#ddd", borderStyle: "solid", borderRadius: "2%" }); h.append(o) } function e() { h.show(), d.hide() } function a() { h.hide(), d.show() } var s = t.extend({}, i, r), d = t("<button>").css({ position: "fixed", left: "left" === s.buttonPosition ? s.buttonMargins.left + "px" : "", right: "right" === s.buttonPosition ? s.buttonMargins.right + "px" : "", bottom: s.buttonMargins.bottom + "px", width: "50px", height: "50px", borderRadius: "50%", backgroundColor: s.buttonBackgroundColor, color: "white", border: "none", cursor: "pointer", boxShadow: "0px 0px 10px 0px rgba(0,0,0,0.5)", display: s.showButton ? "block" : "none" }).on("click", function () { s.showIframe && (n(), e()) }).html('<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4384" width="26" height="26"><path d="M512 64c259.2 0 469.333333 200.576 469.333333 448s-210.133333 448-469.333333 448a484.48 484.48 0 0 1-232.725333-58.88l-116.394667 50.645333a42.666667 42.666667 0 0 1-58.517333-49.002666l29.76-125.013334C76.629333 703.402667 42.666667 611.477333 42.666667 512 42.666667 264.576 252.8 64 512 64z m0 64C287.488 128 106.666667 300.586667 106.666667 512c0 79.573333 25.557333 155.434667 72.554666 219.285333l5.525334 7.317334 18.709333 24.192-26.965333 113.237333 105.984-46.08 27.477333 15.018667C370.858667 878.229333 439.978667 896 512 896c224.512 0 405.333333-172.586667 405.333333-384S736.512 128 512 128z m-157.696 341.333333a42.666667 42.666667 0 1 1 0 85.333334 42.666667 42.666667 0 0 1 0-85.333334z m159.018667 0a42.666667 42.666667 0 1 1 0 85.333334 42.666667 42.666667 0 0 1 0-85.333334z m158.997333 0a42.666667 42.666667 0 1 1 0 85.333334 42.666667 42.666667 0 0 1 0-85.333334z" fill="#ffffff" p-id="4385"></></svg>'), h = t("<div>").css({ position: "fixed", left: "left" === s.buttonPosition ? s.iframeMargins.left + "px" : "", right: "right" === s.buttonPosition ? s.iframeMargins.right + "px" : "", bottom: s.iframeMargins.bottom + "px", width: s.iframeWidth + "px", height: s.iframeHeight + "px", display: "none", backgroundColor: "white", zIndex: 1e3, borderRadius: "2%", boxShadow: "5px 5px 10px 0px rgba(0,0,0,0.5)" }), p = t("<button>").text("×").css({ position: "absolute", right: "10px", top: "10px", padding: "5px", backgroundColor: "gray", color: "white", border: "none", cursor: "pointer", borderRadius: "10%" }).on("click", function () { a() }); t(o).append(d), t(o).append(h.append(p)) } var i = { chatUrl: "https://www.weiyuai.cn/chat?t=1&sid=default_wg_uid&", buttonPosition: "right", buttonBackgroundColor: "blue", iframeWidth: 400, iframeHeight: 600, iframeMargins: { right: 20, bottom: 20, left: 20 }, buttonMargins: { right: 20, bottom: 20, left: 20 }, showButton: !0, showIframe: !0 }; t.fn.ChatFloat = function (i) { return this.each(function () { var r = t(this), n = r.data("ChatFloat"), e = "object" === (void 0 === i ? "undefined" : _typeof(i)) && i; n || r.data("ChatFloat", n = new o(this, e)), "string" == typeof i && n[i]() }) } }(jQuery); |