@shijiu/jsview-vue-samples 2.2.426-test.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BakeViewDemo/AnimatePic.vue +1 -1
- package/Basic/components/text/TextDirection.vue +7 -1
- package/BasicFocusControl/components/BaseBlock.vue +65 -18
- package/BreakRender/assets/imageList.json +235 -235
- package/ColorSpace/App.vue +2 -2
- package/CoupletsTest/App.vue +1 -1
- package/CoupletsTest/widget/Banger/Banger.vue +3 -3
- package/CoupletsTest/widget/Banger/MaroonLoader.vue +5 -5
- package/CoupletsTest/widget/Couplets/Couplets.vue +4 -4
- package/CoupletsTest/widget/Fireworks/Fireworks.vue +13 -13
- package/CustomShader/App.vue +4 -4
- package/CustomShader/gaussianBlur.glsl +1 -1
- package/DashPath/App.vue +79 -0
- package/DashPath/AppForOperator.vue +35 -0
- package/DashPath/DashPath.vue +118 -0
- package/DemoForOperator/AnimPic/AnimPic.vue +47 -0
- package/DemoForOperator/AnimPic/App.vue +28 -0
- package/DemoForOperator/Banger/App.vue +26 -0
- package/DemoForOperator/Banger/Banger/Banger.vue +252 -0
- package/DemoForOperator/Banger/Banger/Maroon.vue +123 -0
- package/DemoForOperator/Banger/Banger/MaroonLoader.vue +78 -0
- package/DemoForOperator/Banger/Banger/SpriteDeal.js +30 -0
- package/DemoForOperator/Bounce/App.vue +43 -0
- package/DemoForOperator/Bounce/Bounce.vue +49 -0
- package/DemoForOperator/Bounce/FreeMoveBuilder.js +139 -0
- package/DemoForOperator/ChunLian/App.vue +47 -0
- package/DemoForOperator/ChunLian/Couplets.vue +248 -0
- package/DemoForOperator/EpisodeList/App.vue +80 -0
- package/DemoForOperator/EpisodeList/EpisodeList/Controller.vue +113 -0
- package/DemoForOperator/EpisodeList/EpisodeList/EpisodeList.vue +176 -0
- package/DemoForOperator/EpisodeList/GroupItem.vue +65 -0
- package/DemoForOperator/EpisodeList/ListItem.vue +48 -0
- package/DemoForOperator/Firework1/App.vue +25 -0
- package/DemoForOperator/Firework1/Fireworks.vue +358 -0
- package/DemoForOperator/Firework1/SpriteDeal.js +30 -0
- package/DemoForOperator/FlipPage/App.vue +75 -0
- package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +150 -0
- package/DemoForOperator/FlipPage/FlipPage/flipIn.glsl +41 -0
- package/DemoForOperator/FlipPage/FlipPage/flipOut.glsl +41 -0
- package/DemoForOperator/Focus/Alpha/AlphaFocusBox.vue +70 -0
- package/DemoForOperator/Focus/Alpha/AlphaPage.vue +40 -0
- package/DemoForOperator/Focus/Alpha/Item.vue +64 -0
- package/DemoForOperator/Focus/App.vue +124 -0
- package/DemoForOperator/Focus/CommonPageSetting.js +30 -0
- package/DemoForOperator/Focus/Item.vue +46 -0
- package/DemoForOperator/Focus/Light/Item.vue +67 -0
- package/DemoForOperator/Focus/Light/LightFocusBox.vue +46 -0
- package/DemoForOperator/Focus/Light/LightPage.vue +43 -0
- package/DemoForOperator/Focus/Light/utils/FrameCanvasStore.ts +68 -0
- package/DemoForOperator/Focus/Light/utils/RotateFrame.vue +146 -0
- package/DemoForOperator/Focus/Light/utils/circleHaloMask.png +0 -0
- package/DemoForOperator/Focus/Normal/Item.vue +64 -0
- package/DemoForOperator/Focus/Normal/NormalFocusBox.vue +53 -0
- package/DemoForOperator/Focus/Normal/NormalPage.vue +41 -0
- package/DemoForOperator/Focus/SwipeLight/Item.vue +73 -0
- package/DemoForOperator/Focus/SwipeLight/SwipeLightBox.vue +62 -0
- package/DemoForOperator/Focus/SwipeLight/SwipeLightPage.vue +44 -0
- package/DemoForOperator/FullscreenIn/App.vue +105 -0
- package/DemoForOperator/FullscreenIn/FullscreenPoster.vue +41 -0
- package/DemoForOperator/FullscreenIn/Item.vue +50 -0
- package/DemoForOperator/Genie/App.vue +78 -0
- package/DemoForOperator/Genie/geniePakcer/Genie.vue +699 -0
- package/DemoForOperator/Genie/geniePakcer/genieBottom.glsl +49 -0
- package/DemoForOperator/Genie/geniePakcer/genieLeft.glsl +50 -0
- package/DemoForOperator/Genie/geniePakcer/genieRight.glsl +57 -0
- package/DemoForOperator/Genie/geniePakcer/genieTop.glsl +50 -0
- package/DemoForOperator/GrayFilter/App.vue +51 -0
- package/DemoForOperator/GrayFilter/GrayFilter.vue +38 -0
- package/DemoForOperator/Jigsaw/App.vue +45 -0
- package/DemoForOperator/Jigsaw/JigsawFull.vue +100 -0
- package/DemoForOperator/Jigsaw/JigsawSingle.vue +86 -0
- package/DemoForOperator/Particle/App.vue +69 -0
- package/DemoForOperator/Particle/Drop/DropParticle.vue +176 -0
- package/DemoForOperator/Particle/Explode/ExplodeParticle.vue +99 -0
- package/DemoForOperator/PosterAnim/App.vue +125 -0
- package/DemoForOperator/PosterAnim/Bounce/BouncePage.vue +54 -0
- package/DemoForOperator/PosterAnim/Bounce/Item.vue +85 -0
- package/DemoForOperator/PosterAnim/Breath/BreathPage.vue +47 -0
- package/DemoForOperator/PosterAnim/Breath/Item.vue +58 -0
- package/DemoForOperator/PosterAnim/CommonPageSetting.js +30 -0
- package/DemoForOperator/PosterAnim/Item.vue +46 -0
- package/DemoForOperator/PosterAnim/PosterAnim.js +58 -0
- package/DemoForOperator/PosterAnim/Scale/Item.vue +72 -0
- package/DemoForOperator/PosterAnim/Scale/ScalePage.vue +48 -0
- package/DemoForOperator/PosterAnim/Shake/Item.vue +85 -0
- package/DemoForOperator/PosterAnim/Shake/ShakePage.vue +53 -0
- package/DemoForOperator/PosterOverflow/App.vue +116 -0
- package/DemoForOperator/PosterOverflow/Item.vue +67 -0
- package/DemoForOperator/PosterOverflow/PosterOverflow.vue +23 -0
- package/DemoForOperator/Ripple/App.vue +54 -0
- package/DemoForOperator/Ripple/Ripple.vue +50 -0
- package/DemoForOperator/ScalePoster/App.vue +4 -0
- package/DemoForOperator/ScalePoster/ScalePoster.vue +0 -0
- package/DemoForOperator/Sprite/App.vue +33 -0
- package/DemoForOperator/Sprite/Sprite.vue +90 -0
- package/DemoForOperator/Stretch/App.vue +103 -0
- package/DemoForOperator/Stretch/Stretch/Item.vue +192 -0
- package/DemoForOperator/Stretch/Stretch/Stretch.vue +168 -0
- package/DemoForOperator/TabContent/App.vue +89 -0
- package/DemoForOperator/TabContent/ContentPage.vue +66 -0
- package/DemoForOperator/TabContent/Item.vue +85 -0
- package/DemoForOperator/TabContent/PageItem.vue +40 -0
- package/DemoForOperator/TabContent/TabContent/CreepFocus.vue +160 -0
- package/DemoForOperator/TabContent/TabContent/Item.vue +63 -0
- package/DemoForOperator/TabContent/TabContent/TabContent.vue +146 -0
- package/DemoForOperator/TabContent/TabContent/TabItem.vue +368 -0
- package/DemoForOperator/TabContent/TabContent/TabWidget.vue +243 -0
- package/DemoForOperator/TabContent/TabContent/Util.js +3 -0
- package/DemoForOperator/TabContent/TabContent/ViewSwiper.vue +110 -0
- package/DemoForOperator/TabContent/testData.js +241 -0
- package/DemoForOperator/Vortex/App.vue +78 -0
- package/DemoForOperator/Vortex/Vortex/Vortex.vue +154 -0
- package/DemoForOperator/Vortex/Vortex/vortexIn.glsl +38 -0
- package/DemoForOperator/Vortex/Vortex/vortexOut.glsl +38 -0
- package/DemoForOperator/index.js +6 -0
- package/DemoForOperator/routeList.js +142 -0
- package/DemoHomepage/App.vue +50 -30
- package/DemoHomepage/components/Dialog.vue +1 -0
- package/DemoHomepage/components/TabFrame.vue +7 -0
- package/DemoHomepage/router.js +104 -81
- package/DemoHomepage/views/Homepage.vue +7 -2
- package/DivMetroPerformance/data.js +3 -3
- package/DriftScopeTest/App.vue +1 -1
- package/FilterDemo/AnimatePic.vue +1 -1
- package/FilterDemo/VideoLayer.vue +2 -2
- package/FullScreenFlex/TestFrame2.vue +1 -1
- package/GiftRain/App.vue +12 -12
- package/JsvPreDownloader/App.vue +4 -4
- package/MediaDemo/components/frames/AudioFrame.vue +1 -1
- package/MediaDemo/components/frames/VideoFrame.vue +1 -1
- package/MetroWidgetDemos/MassiveItems/ContentItem.vue +1 -1
- package/MetroWidgetDemos/MassiveItems/data.js +1 -1
- package/MetroWidgetDemos/PerformanceTest/data.js +3 -3
- package/MetroWidgetDemos/RefreshDemo/assets/imageList.json +235 -235
- package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.json +235 -235
- package/MetroWidgetDemos/focusableItemMetroWidget/WidgetItem.vue +3 -1
- package/MetroWidgetDemos/routeList.js +17 -17
- package/Poster3d/App.vue +69 -0
- package/Poster3d/Poster3d.vue +92 -0
- package/PosterPacker/App.vue +3 -3
- package/PosterPacker/tools/vortexPacker/Vortex.vue +1 -1
- package/QrcodeDemo/App.vue +1 -1
- package/Ripple/App.vue +1 -1
- package/ScaleDownNeon/App.vue +4 -4
- package/SceneTransition/App.vue +2 -2
- package/SceneTransition/maskConfig/config2.js +12 -12
- package/SceneTransition/maskConfig/config3.js +14 -14
- package/SprayView/App.vue +96 -51
- package/SpringFestival/App.vue +73 -0
- package/SpringFestival/SpringFestivalScene/ChunLian.vue +211 -0
- package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +139 -0
- package/SpringFestival/SpringFestivalScene/LanternAnim.js +60 -0
- package/SpringFestival/SpringFestivalScene/Rain.vue +137 -0
- package/SpringFestival/SpringFestivalScene/Scene.vue +218 -0
- package/SpringFestival/SpringFestivalScene/imageConfig.js +87 -0
- package/SpringFestival/SpringFestivalScene/index.js +1 -0
- package/Swiper/App.vue +28 -29
- package/Swiper/Item.vue +19 -0
- package/SwiperTest/App.vue +9 -9
- package/TestNativeSharedView/AckEventDefine.ts +82 -0
- package/TestNativeSharedView/App.vue +4 -6
- package/TestNativeSharedView/JsvDemoTester.js +131 -0
- package/TextureAnimation/App.vue +16 -6
- package/TextureAnimation/App3.vue +100 -0
- package/TextureAnimation/utils/FrameCanvasStore.ts +68 -0
- package/TextureAnimation/utils/RotateFrame.vue +146 -0
- package/TextureAnimation/utils/circleHaloMask.png +0 -0
- package/TombSweepingDayTest/Raining/RainScene.vue +4 -4
- package/ViewOpacity/App.vue +2 -2
- package/package.json +1 -1
package/ColorSpace/App.vue
CHANGED
|
@@ -67,7 +67,7 @@ const onKeyDown = (ev) => {
|
|
|
67
67
|
:src="pngDemo"
|
|
68
68
|
/>
|
|
69
69
|
<div class="underFont">
|
|
70
|
-
{{ `png有透明图片\
|
|
70
|
+
{{ `png有透明图片\nandroid透明部分为黑色\nwebassembly全为黑色 ` }}
|
|
71
71
|
</div>
|
|
72
72
|
</div>
|
|
73
73
|
|
|
@@ -79,7 +79,7 @@ const onKeyDown = (ev) => {
|
|
|
79
79
|
:src="pngNoAlphaDemo"
|
|
80
80
|
/>
|
|
81
81
|
<div class="underFont">
|
|
82
|
-
{{ `png
|
|
82
|
+
{{ `png无透明图片\nwebassembly为黑色` }}
|
|
83
83
|
</div>
|
|
84
84
|
</div>
|
|
85
85
|
</div>
|
package/CoupletsTest/App.vue
CHANGED
|
@@ -317,7 +317,7 @@ import leadWire from "./widget/images/leadWire.png";
|
|
|
317
317
|
import sparkPng from "./widget/Sprite/spark.png";
|
|
318
318
|
|
|
319
319
|
const ammo =
|
|
320
|
-
"https://qcast
|
|
320
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/App/star2.png";
|
|
321
321
|
//页码
|
|
322
322
|
let myIndex = shallowRef(1);
|
|
323
323
|
|
|
@@ -109,11 +109,11 @@ import {
|
|
|
109
109
|
import { _formatInfo } from "../Common/SpriteDeal";
|
|
110
110
|
|
|
111
111
|
const leadWire =
|
|
112
|
-
"https://qcast
|
|
112
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Banger/Banger/leadWire.png";
|
|
113
113
|
const sparkPng =
|
|
114
|
-
"https://qcast
|
|
114
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Banger/Banger/spark.png";
|
|
115
115
|
const sparkJson =
|
|
116
|
-
"https://qcast
|
|
116
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Banger/Banger/spark.json";
|
|
117
117
|
|
|
118
118
|
//预加载
|
|
119
119
|
const preload_info = [buildPreloadInfo(leadWire), buildPreloadInfo(sparkPng)];
|
|
@@ -27,15 +27,15 @@ const props = defineProps({
|
|
|
27
27
|
|
|
28
28
|
const maroonResource = {
|
|
29
29
|
star1:
|
|
30
|
-
"https://qcast
|
|
30
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Banger/MaroonLoader/redStar.png",
|
|
31
31
|
star2:
|
|
32
|
-
"https://qcast
|
|
32
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Banger/MaroonLoader/yellowStar.png",
|
|
33
33
|
star3:
|
|
34
|
-
"https://qcast
|
|
34
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Banger/MaroonLoader/purpleStar.png",
|
|
35
35
|
firecrackerPng:
|
|
36
|
-
"https://qcast
|
|
36
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Banger/MaroonLoader/firecracker.png",
|
|
37
37
|
firecrackerJson:
|
|
38
|
-
"https://qcast
|
|
38
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Banger/MaroonLoader/firecracker.json",
|
|
39
39
|
firecrackerSet: {
|
|
40
40
|
info: shallowRef(null),
|
|
41
41
|
viewSize: shallowRef(null),
|
|
@@ -109,13 +109,13 @@ const props = defineProps({
|
|
|
109
109
|
});
|
|
110
110
|
let myShow = shallowRef(false);
|
|
111
111
|
const Couplets =
|
|
112
|
-
"https://qcast
|
|
112
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Couplets/Couplets/Couplets.png";
|
|
113
113
|
const scrollPng =
|
|
114
|
-
"https://qcast
|
|
114
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Couplets/Couplets/scroll.png";
|
|
115
115
|
const scrollJson =
|
|
116
|
-
"https://qcast
|
|
116
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Couplets/Couplets/scroll.json";
|
|
117
117
|
const scroll =
|
|
118
|
-
"https://qcast
|
|
118
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Couplets/Couplets/scroll1.png";
|
|
119
119
|
|
|
120
120
|
//预加载
|
|
121
121
|
const preload_info = [
|
|
@@ -161,33 +161,33 @@ const props = defineProps({
|
|
|
161
161
|
|
|
162
162
|
//火花图片素材
|
|
163
163
|
const group1_1 =
|
|
164
|
-
"https://qcast
|
|
164
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Fireworks/Fireworks/group1_1.png";
|
|
165
165
|
const group1_2 =
|
|
166
|
-
"https://qcast
|
|
166
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Fireworks/Fireworks/group1_2.png";
|
|
167
167
|
const group2_1 =
|
|
168
|
-
"https://qcast
|
|
168
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Fireworks/Fireworks/group2_1.png";
|
|
169
169
|
const group2_2 =
|
|
170
|
-
"https://qcast
|
|
170
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Fireworks/Fireworks/group2_2.png";
|
|
171
171
|
const group3_1 =
|
|
172
|
-
"https://qcast
|
|
172
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Fireworks/Fireworks/group3_1.png";
|
|
173
173
|
const group3_2 =
|
|
174
|
-
"https://qcast
|
|
174
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Fireworks/Fireworks/group3_2.png";
|
|
175
175
|
const group4_1 =
|
|
176
|
-
"https://qcast
|
|
176
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Fireworks/Fireworks/group4_1.png";
|
|
177
177
|
const group4_2 =
|
|
178
|
-
"https://qcast
|
|
178
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Fireworks/Fireworks/group4_2.png";
|
|
179
179
|
const group5_1 =
|
|
180
|
-
"https://qcast
|
|
180
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Fireworks/Fireworks/group5_1.png";
|
|
181
181
|
const group5_2 =
|
|
182
|
-
"https://qcast
|
|
182
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Fireworks/Fireworks/group5_2.png";
|
|
183
183
|
//弹药图片素材(请按需修改)
|
|
184
184
|
const ammo =
|
|
185
|
-
"https://qcast
|
|
185
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Fireworks/Fireworks/star2.png";
|
|
186
186
|
//精灵图素材
|
|
187
187
|
const fireworksPng =
|
|
188
|
-
"https://qcast
|
|
188
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Fireworks/Fireworks/fireworks.png";
|
|
189
189
|
const fireworksJson =
|
|
190
|
-
"https://qcast
|
|
190
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CoupletsTest/widget/Fireworks/Fireworks/fireworks.json";
|
|
191
191
|
|
|
192
192
|
//运动距离
|
|
193
193
|
let moveDistance = 260;
|
package/CustomShader/App.vue
CHANGED
|
@@ -8,10 +8,10 @@ import gaussianBlurShader from "./gaussianBlur.glsl?raw";
|
|
|
8
8
|
// import testShader from "./test.glsl?raw";
|
|
9
9
|
|
|
10
10
|
const ImageChinChilla =
|
|
11
|
-
"https://qcast
|
|
12
|
-
const ImageLandscape = "https://
|
|
13
|
-
const ImagePanda = "https://
|
|
14
|
-
const ImageOwl = "https://
|
|
11
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CustomShader/App/BackgroundLongmao.jpg";
|
|
12
|
+
const ImageLandscape = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CustomShader/App/landscape.jpeg";
|
|
13
|
+
const ImagePanda = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CustomShader/App/panda.jpeg";
|
|
14
|
+
const ImageOwl = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CustomShader/App/owl.jpeg";
|
|
15
15
|
|
|
16
16
|
const cShaderSettings = [
|
|
17
17
|
{
|
|
@@ -12,7 +12,7 @@ int myMod(int a, int b) {
|
|
|
12
12
|
|
|
13
13
|
vec4 blur(sampler2D sp, vec2 U, vec2 scale) {
|
|
14
14
|
vec4 O = vec4(0);
|
|
15
|
-
int s = samples / sLOD;
|
|
15
|
+
const int s = samples / sLOD;
|
|
16
16
|
|
|
17
17
|
for(int i = 0; i < s * s; i++) {
|
|
18
18
|
vec2 d = vec2(myMod(i, s), i / s) * float(sLOD) - float(samples) / 2.;
|
package/DashPath/App.vue
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:style="{
|
|
4
|
+
width: 1280,
|
|
5
|
+
height: 720,
|
|
6
|
+
backgroundColor: '#007788',
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
<!-- 带缺口的矩形 -->
|
|
10
|
+
<DashPath
|
|
11
|
+
:points="[
|
|
12
|
+
{ x: 200, y: 0 }, // 右上角
|
|
13
|
+
{ x: 200, y: 100 }, // 右边中点(缺口处)
|
|
14
|
+
{ x: 150, y: 100 }, // 缺口上边
|
|
15
|
+
{ x: 150, y: 150 }, // 缺口左边
|
|
16
|
+
{ x: 0, y: 150 }, // 左下角
|
|
17
|
+
{ x: 0, y: 0 }, // 左上角
|
|
18
|
+
]"
|
|
19
|
+
:dash="[5, 5]"
|
|
20
|
+
:phase="0"
|
|
21
|
+
color="#FF0000"
|
|
22
|
+
:lineWidth="2"
|
|
23
|
+
:layout="{
|
|
24
|
+
left: 50,
|
|
25
|
+
top: 50,
|
|
26
|
+
width: 250,
|
|
27
|
+
height: 200,
|
|
28
|
+
}"
|
|
29
|
+
/>
|
|
30
|
+
|
|
31
|
+
<!-- 三角形 -->
|
|
32
|
+
<DashPath
|
|
33
|
+
:points="[
|
|
34
|
+
{ x: 100, y: 0 }, // 顶点
|
|
35
|
+
{ x: 200, y: 150 }, // 右下角
|
|
36
|
+
{ x: 0, y: 150 }, // 左下角
|
|
37
|
+
]"
|
|
38
|
+
:dash="[15, 8]"
|
|
39
|
+
:phase="2"
|
|
40
|
+
color="#00FF00"
|
|
41
|
+
:lineWidth="4"
|
|
42
|
+
:layout="{
|
|
43
|
+
left: 350,
|
|
44
|
+
top: 50,
|
|
45
|
+
width: 250,
|
|
46
|
+
height: 200,
|
|
47
|
+
}"
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
<!-- 凸字形 -->
|
|
51
|
+
<DashPath
|
|
52
|
+
:points="[
|
|
53
|
+
{ x: 0, y: 0 }, // 左上角
|
|
54
|
+
{ x: 200, y: 0 }, // 右上角
|
|
55
|
+
{ x: 200, y: 150 }, // 右下角
|
|
56
|
+
{ x: 150, y: 150 }, // 右凹进点
|
|
57
|
+
{ x: 150, y: 50 }, // 凹进上点
|
|
58
|
+
{ x: 50, y: 50 }, // 凹进左上点
|
|
59
|
+
{ x: 50, y: 150 }, // 凹进左下点
|
|
60
|
+
{ x: 0, y: 150 }, // 左下角
|
|
61
|
+
]"
|
|
62
|
+
:dash="[20, 10]"
|
|
63
|
+
:phase="5"
|
|
64
|
+
color="#0088FF"
|
|
65
|
+
:lineWidth="3"
|
|
66
|
+
:layout="{
|
|
67
|
+
left: 650,
|
|
68
|
+
top: 50,
|
|
69
|
+
width: 250,
|
|
70
|
+
height: 200,
|
|
71
|
+
}"
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<script setup>
|
|
77
|
+
import DashPath from "./DashPath.vue";
|
|
78
|
+
</script>
|
|
79
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:style="{
|
|
4
|
+
width: 1280,
|
|
5
|
+
height: 720,
|
|
6
|
+
backgroundColor: '#007788',
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
<!-- 带缺口的矩形 -->
|
|
10
|
+
<DashPath
|
|
11
|
+
:points="[
|
|
12
|
+
{ x: 200, y: 0 }, // 右上角
|
|
13
|
+
{ x: 200, y: 100 }, // 右边中点(缺口处)
|
|
14
|
+
{ x: 150, y: 100 }, // 缺口上边
|
|
15
|
+
{ x: 150, y: 150 }, // 缺口左边
|
|
16
|
+
{ x: 0, y: 150 }, // 左下角
|
|
17
|
+
{ x: 0, y: 0 }, // 左上角
|
|
18
|
+
]"
|
|
19
|
+
:dash="[5, 5]"
|
|
20
|
+
color="#FF0000"
|
|
21
|
+
:lineWidth="2"
|
|
22
|
+
:layout="{
|
|
23
|
+
left: 150,
|
|
24
|
+
top: 150,
|
|
25
|
+
width: 250,
|
|
26
|
+
height: 200,
|
|
27
|
+
}"
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup>
|
|
33
|
+
import DashPath from "./DashPath.vue";
|
|
34
|
+
</script>
|
|
35
|
+
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="{ ...layout, backgroundImage: `url(jsvtexturestore://${sourceId})` }" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { JsvTextureStoreApi } from "jsview";
|
|
7
|
+
import { onBeforeUnmount, computed } from "vue";
|
|
8
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
// 点数组,每个点包含 x 和 y 坐标
|
|
11
|
+
points: {
|
|
12
|
+
type: Array,
|
|
13
|
+
required: true,
|
|
14
|
+
validator: (value) => {
|
|
15
|
+
return value.every(point => 'x' in point && 'y' in point);
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
// 虚线配置,例如 [10, 5] 表示10px实线,5px空白
|
|
19
|
+
dash: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: () => [10, 10]
|
|
22
|
+
},
|
|
23
|
+
// 虚线起始位置偏移
|
|
24
|
+
phase: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: 0
|
|
27
|
+
},
|
|
28
|
+
// 线条颜色
|
|
29
|
+
color: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "#FFFFFF"
|
|
32
|
+
},
|
|
33
|
+
// 线条宽度
|
|
34
|
+
lineWidth: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: 2
|
|
37
|
+
},
|
|
38
|
+
// 布局样式
|
|
39
|
+
layout: {
|
|
40
|
+
type: Object,
|
|
41
|
+
required: true
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// 计算坐标系调整值和画布尺寸
|
|
46
|
+
const canvasInfo = computed(() => {
|
|
47
|
+
const xValues = props.points.map(p => p.x);
|
|
48
|
+
const yValues = props.points.map(p => p.y);
|
|
49
|
+
|
|
50
|
+
// 找出最小坐标值
|
|
51
|
+
const minX = Math.min(...xValues);
|
|
52
|
+
const minY = Math.min(...yValues);
|
|
53
|
+
|
|
54
|
+
// 计算偏移量(考虑线宽)
|
|
55
|
+
const offsetX = minX < 0 ? Math.abs(minX) : 0;
|
|
56
|
+
const offsetY = minY < 0 ? Math.abs(minY) : 0;
|
|
57
|
+
const lineOffset = Math.ceil(props.lineWidth / 2);
|
|
58
|
+
|
|
59
|
+
// 计算画布尺寸(考虑线宽)
|
|
60
|
+
const width = Math.max(...xValues) - minX + props.lineWidth * 2;
|
|
61
|
+
const height = Math.max(...yValues) - minY + props.lineWidth * 2;
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
offsetX: offsetX + lineOffset,
|
|
65
|
+
offsetY: offsetY + lineOffset,
|
|
66
|
+
width,
|
|
67
|
+
height
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// 创建画布纹理
|
|
72
|
+
let sourceId = '';
|
|
73
|
+
const canvasRef = JsvTextureStoreApi.canvasTexture(
|
|
74
|
+
canvasInfo.value.width,
|
|
75
|
+
canvasInfo.value.height
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
// 绘制透明背景
|
|
79
|
+
canvasRef.drawColor("rgba(0,0,0,0)");
|
|
80
|
+
|
|
81
|
+
// 创建自定义路径
|
|
82
|
+
const path = canvasRef.customPath();
|
|
83
|
+
|
|
84
|
+
// 移动到第一个调整后的点
|
|
85
|
+
if (props.points.length > 0) {
|
|
86
|
+
const firstPoint = props.points[0];
|
|
87
|
+
path.moveTo(
|
|
88
|
+
firstPoint.x + canvasInfo.value.offsetX,
|
|
89
|
+
firstPoint.y + canvasInfo.value.offsetY
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// 连接后续的调整后的点
|
|
93
|
+
for (let i = 1; i < props.points.length; i++) {
|
|
94
|
+
const point = props.points[i];
|
|
95
|
+
path.lineTo(
|
|
96
|
+
point.x + canvasInfo.value.offsetX,
|
|
97
|
+
point.y + canvasInfo.value.offsetY
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
path.close();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// 使用虚线样式绘制路径
|
|
104
|
+
path.strokeWithSetting({
|
|
105
|
+
lineWidth: props.lineWidth,
|
|
106
|
+
color: props.color,
|
|
107
|
+
dash: props.dash,
|
|
108
|
+
phase: props.phase
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// 提交纹理并获取sourceId
|
|
112
|
+
sourceId = canvasRef.commit();
|
|
113
|
+
|
|
114
|
+
// 组件卸载时清理纹理
|
|
115
|
+
onBeforeUnmount(() => {
|
|
116
|
+
JsvTextureStoreApi.deleteTexture(sourceId);
|
|
117
|
+
});
|
|
118
|
+
</script>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<JsvApic2 ref="apicRef" :src="`url(${src})`" :style="layout" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { JsvApic2, LoopType, ApicEndState } from "jsview";
|
|
7
|
+
import { shallowRef, onMounted } from "vue";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
src: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
repeat: {
|
|
14
|
+
type: [String, Number],
|
|
15
|
+
default: 0,
|
|
16
|
+
},
|
|
17
|
+
layout: {
|
|
18
|
+
type: Object,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const apicRef = shallowRef();
|
|
23
|
+
onMounted(() => {
|
|
24
|
+
let loopType = LoopType.LOOP_DEFAULT;
|
|
25
|
+
let loopInfo = undefined;
|
|
26
|
+
if (typeof props.repeat == "number") {
|
|
27
|
+
if (props.repeat >= 0) {
|
|
28
|
+
loopType = LoopType.LOOP_FINITE;
|
|
29
|
+
loopInfo = props.repeat;
|
|
30
|
+
} else {
|
|
31
|
+
loopType = LoopType.LOOP_INFINITE;
|
|
32
|
+
}
|
|
33
|
+
} else if (typeof props.repeat == "string") {
|
|
34
|
+
switch (props.repeat) {
|
|
35
|
+
case "default":
|
|
36
|
+
loopType = LoopType.LOOP_DEFAULT;
|
|
37
|
+
break;
|
|
38
|
+
case "infinite":
|
|
39
|
+
loopType = LoopType.LOOP_INFINITE;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
throw new Error("AnimPic props.repeat must be number or string.");
|
|
44
|
+
}
|
|
45
|
+
apicRef.value.play(loopType, loopInfo, ApicEndState.LAST_FRAME);
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<anim-pic
|
|
3
|
+
:src="webpImage"
|
|
4
|
+
:repeat="3"
|
|
5
|
+
:layout="{
|
|
6
|
+
left: 50,
|
|
7
|
+
top: 50,
|
|
8
|
+
width: 300,
|
|
9
|
+
height: 300,
|
|
10
|
+
}"
|
|
11
|
+
></anim-pic>
|
|
12
|
+
<anim-pic
|
|
13
|
+
:src="gifImage"
|
|
14
|
+
:repeat="'infinite'"
|
|
15
|
+
:layout="{
|
|
16
|
+
left: 350,
|
|
17
|
+
top: 50,
|
|
18
|
+
width: 300,
|
|
19
|
+
height: 300,
|
|
20
|
+
}"
|
|
21
|
+
></anim-pic>
|
|
22
|
+
</template>
|
|
23
|
+
<script setup>
|
|
24
|
+
import AnimPic from "./AnimPic.vue";
|
|
25
|
+
|
|
26
|
+
const webpImage = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/AnimPic/App/animated_webp.webp";
|
|
27
|
+
const gifImage = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/AnimPic/App/girl_run.gif";
|
|
28
|
+
</script>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Banger
|
|
3
|
+
:top="50"
|
|
4
|
+
:left="500"
|
|
5
|
+
:num="16"
|
|
6
|
+
:leadWireTime="4"
|
|
7
|
+
:width="100"
|
|
8
|
+
:starSrcs="starSrcs"
|
|
9
|
+
:bangerSpriteSrc="bangerSpriteSrc"
|
|
10
|
+
:leadWireSrc="leadWireSrc"
|
|
11
|
+
:sparkSpriteSrc="sparkSpriteSrc"
|
|
12
|
+
></Banger>
|
|
13
|
+
</template>
|
|
14
|
+
<script setup>
|
|
15
|
+
import Banger from "./Banger/Banger.vue";
|
|
16
|
+
|
|
17
|
+
const star1 = "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsViewFrameworkDemo/banger/redStar.png";
|
|
18
|
+
const star2 = "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsViewFrameworkDemo/banger/yellowStar.png";
|
|
19
|
+
const star3 = "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsViewFrameworkDemo/banger/purpleStar.png";
|
|
20
|
+
const bangerSpriteSrc = "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsViewFrameworkDemo/banger/firecracker.png";
|
|
21
|
+
|
|
22
|
+
const leadWireSrc = "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsViewFrameworkDemo/banger/leadWire.png";
|
|
23
|
+
const sparkSpriteSrc = "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsViewFrameworkDemo/banger/spark.png";
|
|
24
|
+
|
|
25
|
+
const starSrcs = [star1, star2, star3];
|
|
26
|
+
</script>
|