auto-marquee
Advanced tools
Comparing version 1.0.5 to 1.0.7
@@ -1,5 +0,11 @@ | ||
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".wrapper[data-v-ce69f4a2]{position:relative;width:100%;height:1.2em}.marquee-detail[data-v-ce69f4a2]{position:absolute;top:50%;width:100%;height:1.2em;line-height:1.2em;transform:translateY(-50%);overflow:hidden;background-color:var(--769b8a9d)}.original-text[data-v-ce69f4a2]{max-height:2.4em}.marquee-text[data-v-ce69f4a2]{position:relative;top:-2.4em;white-space:nowrap;background-color:inherit}.marquee-text[data-v-ce69f4a2]:after{content:attr(data-marquee-text);padding:0 5em}@keyframes move-ce69f4a2{to{transform:translate3d(-50%,0,0)}}.marquee-text.auto-type[data-v-ce69f4a2]{display:inline-block;animation:move-ce69f4a2 var(--154965d8) .3s linear infinite}.marquee-text.hover-type[data-v-ce69f4a2]{display:block;overflow:hidden;text-overflow:ellipsis}.marquee-text.hover-type[data-v-ce69f4a2]:hover{display:inline-block;animation:move-ce69f4a2 var(--154965d8) .3s linear infinite}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})(); | ||
import { defineComponent as c, useCssVars as l, computed as u, openBlock as p, createElementBlock as i, createElementVNode as r, toDisplayString as n, normalizeClass as d } from "vue"; | ||
const _ = { class: "wrapper" }, m = { class: "marquee-detail" }, v = { class: "original-text" }, f = ["data-marquee-text"], y = /* @__PURE__ */ c({ | ||
name: "AutoMarquee", | ||
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".wrapper[data-v-b36df89a]{position:relative;width:100%;height:1.2em}.marquee-detail[data-v-b36df89a]{position:absolute;top:50%;width:100%;height:1.2em;line-height:1.2em;transform:translateY(-50%);overflow:hidden;background-color:var(--78da8312)}.original-text[data-v-b36df89a]{max-height:2.4em}.marquee-text[data-v-b36df89a]{position:relative;top:-2.4em;white-space:nowrap;background-color:inherit}.marquee-text[data-v-b36df89a]:after{content:attr(data-marquee-text);padding:0 5em}@keyframes move-b36df89a{to{transform:translate3d(-50%,0,0)}}.marquee-text.auto-type[data-v-b36df89a]{display:inline-block;animation:move-b36df89a var(--55cf0309) .3s linear infinite}.marquee-text.hover-type[data-v-b36df89a]{display:block;overflow:hidden;text-overflow:ellipsis}.marquee-text.hover-type[data-v-b36df89a]:hover{display:inline-block;animation:move-b36df89a var(--55cf0309) .3s linear infinite}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})(); | ||
import { useCssVars as n, computed as u, openBlock as l, createElementBlock as i, createElementVNode as r, toDisplayString as c, normalizeClass as p } from "vue"; | ||
const d = (e, t) => { | ||
const a = e.__vccOpts || e; | ||
for (const [s, o] of t) | ||
a[s] = o; | ||
return a; | ||
}, _ = { class: "wrapper" }, m = { class: "marquee-detail" }, v = { class: "original-text" }, f = ["data-marquee-text"], g = /* @__PURE__ */ Object.assign({ | ||
name: "AutoMarquee" | ||
}, { | ||
__name: "AutoMarquee", | ||
@@ -19,3 +25,3 @@ props: { | ||
default: "auto", | ||
validator: (t) => ["auto", "hover"].includes(t) | ||
validator: (e) => ["auto", "hover"].includes(e) | ||
}, | ||
@@ -33,26 +39,21 @@ // 跑马灯每轮的时间 | ||
}, | ||
setup(t) { | ||
l((s) => ({ | ||
"769b8a9d": e.bg, | ||
"154965d8": a.value | ||
setup(e) { | ||
n((o) => ({ | ||
"78da8312": t.bg, | ||
"55cf0309": a.value | ||
})); | ||
const e = t, a = u(() => `${e.time.toString().split("s")[0]}s`), o = u(() => e.type === "auto" ? "auto-type" : "hover-type"); | ||
return (s, x) => (p(), i("div", _, [ | ||
const t = e, a = u(() => `${t.time.toString().split("s")[0]}s`), s = u(() => t.type === "auto" ? "auto-type" : "hover-type"); | ||
return (o, y) => (l(), i("div", _, [ | ||
r("div", m, [ | ||
r("div", v, n(e.value), 1), | ||
r("div", v, c(t.value), 1), | ||
r("span", { | ||
class: d(["marquee-text", o.value]), | ||
"data-marquee-text": e.value | ||
}, n(e.value), 11, f) | ||
class: p(["marquee-text", s.value]), | ||
"data-marquee-text": t.value | ||
}, c(t.value), 11, f) | ||
]) | ||
])); | ||
} | ||
}), g = (t, e) => { | ||
const a = t.__vccOpts || t; | ||
for (const [o, s] of e) | ||
a[o] = s; | ||
return a; | ||
}, q = /* @__PURE__ */ g(y, [["__scopeId", "data-v-ce69f4a2"]]); | ||
}), h = /* @__PURE__ */ d(g, [["__scopeId", "data-v-b36df89a"]]); | ||
export { | ||
q as default | ||
h as default | ||
}; |
{ | ||
"name": "auto-marquee", | ||
"version": "1.0.5", | ||
"version": "1.0.7", | ||
"description": "displays text for a short time, and auto uses marquee for a long time", | ||
@@ -10,2 +10,3 @@ "author": "MOONCOM", | ||
"module": "./dist/auto-marquee.js", | ||
"typings": "./dist/index.d.ts", | ||
"exports": { | ||
@@ -20,2 +21,3 @@ ".": { | ||
"build": "vite build", | ||
"build-demo": "vite build --config build-demo.config.js", | ||
"preview": "vite preview" | ||
@@ -27,6 +29,6 @@ }, | ||
"devDependencies": { | ||
"@vitejs/plugin-legacy": "^5.4.1", | ||
"@vitejs/plugin-vue": "^5.0.5", | ||
"vite": "^5.3.1", | ||
"vite-plugin-css-injected-by-js": "^3.5.1", | ||
"vite-plugin-dts": "^3.9.1" | ||
"vite-plugin-css-injected-by-js": "^3.5.1" | ||
}, | ||
@@ -33,0 +35,0 @@ "keywords": [ |
@@ -19,3 +19,3 @@ # AutoMarquee | ||
## 示例 | ||
点击查看 [线上演示](https://mooncom.github.io/the-file-preview/demo/). | ||
点击查看 [线上演示](https://mooncom.github.io/AutoMarquee/demo). | ||
@@ -22,0 +22,0 @@ ## 项目地址 |
import { defineConfig } from 'vite' | ||
import vue from '@vitejs/plugin-vue' | ||
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js' | ||
import dts from 'vite-plugin-dts' | ||
import path from "path"; | ||
@@ -11,3 +10,2 @@ | ||
cssInjectedByJsPlugin(), | ||
dts(), | ||
], | ||
@@ -14,0 +12,0 @@ build: { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
231813
16
981
5