@kwai-explore/picture
Advanced tools
Comparing version 0.0.2 to 0.0.3
import './style.css'; | ||
import { defineComponent as B, useCssVars as L, unref as r, openBlock as a, createElementBlock as l, normalizeClass as P, createElementVNode as p, Fragment as w, renderList as A, mergeProps as v } from "vue"; | ||
import { computed as u, ref as C } from "vue-demi"; | ||
const F = ["src"], M = { | ||
import { defineComponent as B, useCssVars as L, unref as t, openBlock as u, createElementBlock as i, normalizeClass as M, createElementVNode as C, Fragment as P, renderList as w, mergeProps as h } from "vue"; | ||
import { computed as d, ref as b, onMounted as A } from "vue-demi"; | ||
const F = ["src", "srcset"], z = { | ||
inheritAttrs: !1 | ||
}, z = /* @__PURE__ */ B({ | ||
...M, | ||
}, D = /* @__PURE__ */ B({ | ||
...z, | ||
__name: "Picture", | ||
@@ -12,9 +12,9 @@ props: { | ||
}, | ||
setup(o) { | ||
const n = o; | ||
setup(s) { | ||
const c = s; | ||
L((e) => ({ | ||
"3b340447": r(b), | ||
"139255e2": r(x) | ||
"2559682b": t(S), | ||
"10083fab": t(k) | ||
})); | ||
function s() { | ||
function o() { | ||
const e = navigator.userAgent.toLowerCase(); | ||
@@ -32,13 +32,16 @@ switch (!0) { | ||
} | ||
const t = u(() => n.src), c = u(() => t.value.slice(0, -1)), i = u( | ||
() => t.value[t.value.length - 1] | ||
), d = ["#A7D2CB", "#874C62", "#C98474", "#F2D388"], h = ["#dcedea", "#d4b2bf", "#e9cec7", "#faedcf"], f = Math.floor(Math.random() * d.length), b = d[f], x = h[f], _ = C(!1), S = C(), k = s() === "Safari"; | ||
return (e, m) => (a(), l("div", { | ||
class: P(["image-container", { loaded: _.value }]) | ||
const r = d(() => c.src), a = d(() => r.value.slice(0, -1)), n = d( | ||
() => r.value[r.value.length - 1] | ||
), f = ["#A7D2CB", "#874C62", "#C98474", "#F2D388"], x = ["#dcedea", "#d4b2bf", "#e9cec7", "#faedcf"], _ = Math.floor(Math.random() * f.length), S = f[_], k = x[_], m = b(!1), l = b(), g = o() === "Safari"; | ||
return A(() => { | ||
l.value = n.value.src; | ||
}), (e, p) => (u(), i("div", { | ||
class: M(["image-container", { loaded: m.value }]) | ||
}, [ | ||
p("picture", null, [ | ||
(a(!0), l(w, null, A(r(c), (g, y) => (a(), l("source", v({ key: y }, g), null, 16))), 128)), | ||
p("img", v({ ...r(i), ...e.$attrs }, { | ||
src: k ? S.value : r(i).src, | ||
onLoad: m[0] || (m[0] = (g) => _.value = !0) | ||
C("picture", null, [ | ||
(u(!0), i(P, null, w(t(a), (v, y) => (u(), i("source", h({ key: y }, v), null, 16))), 128)), | ||
C("img", h({ ...t(n), ...e.$attrs }, { | ||
src: g ? l.value : t(n).src, | ||
srcset: g ? l.value : t(n).src, | ||
onLoad: p[0] || (p[0] = (v) => m.value = !0) | ||
}), null, 16, F) | ||
@@ -49,10 +52,10 @@ ]) | ||
}); | ||
const D = (o, n) => { | ||
const s = o.__vccOpts || o; | ||
for (const [t, c] of n) | ||
s[t] = c; | ||
return s; | ||
}, N = /* @__PURE__ */ D(z, [["__scopeId", "data-v-548901cc"]]); | ||
const E = (s, c) => { | ||
const o = s.__vccOpts || s; | ||
for (const [r, a] of c) | ||
o[r] = a; | ||
return o; | ||
}, V = /* @__PURE__ */ E(D, [["__scopeId", "data-v-4d071403"]]); | ||
export { | ||
N as default | ||
V as default | ||
}; |
{ | ||
"name": "@kwai-explore/picture", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
7615
101