UNPKG

st-common-ui-vue3

Version:

小尾巴通用 Vue3 UI 组件库

60 lines (59 loc) 2.55 kB
import { defineComponent as p, openBlock as c, createElementBlock as s, normalizeStyle as u, unref as i, createVNode as m, withCtx as b, renderSlot as h } from "vue"; import y from "../StClickParticleBombContainer/StClickParticleBombContainer.vue.js"; /* empty css */ import * as n from "../../node_modules/.pnpm/st-common-ui-utils@0.1.1/node_modules/st-common-ui-utils/es/utils/el-size-util.js"; import { randomInt_n_m as C, randomInt_0_n as o } from "../../node_modules/.pnpm/st-common-core@0.1.1/node_modules/st-common-core/es/num/utils/random-num-util.js"; const g = /* @__PURE__ */ p({ name: "StClickBubbleParticleContainer", __name: "StClickBubbleParticleContainer", props: { width: { default: "100%" }, height: { default: "100%" }, particleCount: { default: 50 }, particleMaxSize: { default: 20 }, particleMinSize: { default: 5 }, offsetInitial: { default: 20 }, offsetEnd: { default: 200 }, particleColor: { default: "#0a87ff" }, particleColorRandom: { type: Boolean, default: !1 }, evenEmpty: { type: Boolean, default: !0 }, particleZIndex: { default: "initial" }, speed: { default: 1e3 }, click: { type: Boolean, default: !0 }, move: { type: Boolean, default: !1 } }, setup(d) { const t = d, f = (e, l) => { const r = C(t.particleMinSize, t.particleMaxSize) + "px"; e.style.width = r, e.style.height = r; const a = t.particleColorRandom ? `rgb(${o(255)}, ${o(255)}, ${o(255)})` : t.particleColor; t.evenEmpty ? (e.style.background = l % 2 === 0 ? "transparent" : a, e.style.border = l % 2 === 0 ? `1px solid ${a}` : "none") : e.style.background = a; }; return (e, l) => (c(), s("div", { class: "st-click-bubble-particle-container", style: u({ width: i(n).elSizePreHandler(e.width), height: i(n).elSizePreHandler(e.height) }) }, [ m(i(y), { "particle-count": e.particleCount, "offset-initial": e.offsetInitial, "offset-end": e.offsetEnd, "set-particle-style-handler": f, "particle-z-index": e.particleZIndex, speed: e.speed, "click-particle-bomb": e.click, "move-particle-bomb": e.move }, { default: b(() => [ h(e.$slots, "default") ]), _: 3 }, 8, ["particle-count", "offset-initial", "offset-end", "particle-z-index", "speed", "click-particle-bomb", "move-particle-bomb"]) ], 4)); } }); export { g as default };