@shijiu/jsview-vue-samples 1.9.747
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/AnimPicture/App.vue +207 -0
- package/AnimPicture/assets/animated_webp.webp +0 -0
- package/AnimPicture/assets/ball_3.webp +0 -0
- package/AnimPicture/assets/girl_run.gif +0 -0
- package/AnimPicture/assets/quan.webp +0 -0
- package/Basic/App.vue +134 -0
- package/Basic/assets/border.png +0 -0
- package/Basic/assets/border2.png +0 -0
- package/Basic/assets/icon.png +0 -0
- package/Basic/assets/test.jpg +0 -0
- package/Basic/components/ContentBlock.vue +38 -0
- package/Basic/components/FontStyle.css +16 -0
- package/Basic/components/anim/AnimGroup.vue +66 -0
- package/Basic/components/anim/AnimKeyframeBasic.vue +119 -0
- package/Basic/components/anim/AnimKeyframeComposite.vue +52 -0
- package/Basic/components/anim/AnimTransition.vue +157 -0
- package/Basic/components/div/DivBackground.vue +44 -0
- package/Basic/components/div/DivClip.vue +159 -0
- package/Basic/components/div/DivCssScoped.vue +20 -0
- package/Basic/components/div/DivCssVar.vue +53 -0
- package/Basic/components/div/DivGroup1.vue +47 -0
- package/Basic/components/div/DivGroup2.vue +65 -0
- package/Basic/components/div/DivLayout.vue +70 -0
- package/Basic/components/div/DivRadius.vue +65 -0
- package/Basic/components/div/DivTransform.vue +32 -0
- package/Basic/components/img/ImageGroup.vue +31 -0
- package/Basic/components/img/ImgLayout.vue +41 -0
- package/Basic/components/panel/Panel1.vue +55 -0
- package/Basic/components/panel/Panel2.vue +31 -0
- package/Basic/components/panel/TitleBar.vue +29 -0
- package/Basic/components/text/TextAlign.vue +66 -0
- package/Basic/components/text/TextEmoji.vue +26 -0
- package/Basic/components/text/TextFontStyle.vue +89 -0
- package/Basic/components/text/TextGroup1.vue +49 -0
- package/Basic/components/text/TextGroup2.vue +28 -0
- package/Basic/components/text/TextOverflow.vue +110 -0
- package/BasicFocusControl/App.vue +104 -0
- package/BasicFocusControl/components/BaseBlock.vue +50 -0
- package/BasicFocusControl/components/MainArea.vue +83 -0
- package/BasicFocusControl/components/MainAreaLeftBlock.vue +17 -0
- package/BasicFocusControl/components/MainAreaRightBlock.vue +27 -0
- package/BasicFocusControl/components/SideBar.vue +58 -0
- package/BasicFocusControl/components/SideBarBlock.vue +27 -0
- package/Collision/App.vue +452 -0
- package/ColorSpace/App.vue +126 -0
- package/ColorSpace/bmpDemo.bmp +0 -0
- package/ColorSpace/jpegDemo.jpeg +0 -0
- package/ColorSpace/pngDemo.png +0 -0
- package/ColorSpace/pngNoAlphaDemo.png +0 -0
- package/DemoHomepage/App.vue +27 -0
- package/DemoHomepage/components/BodyFrame.vue +95 -0
- package/DemoHomepage/components/Dialog.vue +94 -0
- package/DemoHomepage/components/Item.vue +77 -0
- package/DemoHomepage/components/TabFrame.vue +85 -0
- package/DemoHomepage/router.js +196 -0
- package/DemoHomepage/views/Homepage.vue +195 -0
- package/FilterDemo/AnimatePic.vue +58 -0
- package/FilterDemo/App.vue +159 -0
- package/FilterDemo/VideoLayer.vue +62 -0
- package/FilterDemo/jpegDemo.jpeg +0 -0
- package/FilterDemo/webpDemo.webp +0 -0
- package/FlipCard/App.vue +71 -0
- package/FlipCard/FlipCard.vue +118 -0
- package/FlipCard/assets/blue_egg.png +0 -0
- package/FlipCard/assets/red_egg.png +0 -0
- package/FlipCard/data.js +13 -0
- package/GridDemo/App.vue +215 -0
- package/GridDemo/ButtonBlock.vue +112 -0
- package/GridDemo/FocusItem.vue +37 -0
- package/GridDemo/Item.vue +93 -0
- package/HashHistory/App.vue +115 -0
- package/HashHistory/components/HorizontalButtonList.vue +91 -0
- package/HashHistory/components/Item.vue +60 -0
- package/HashHistory/router.js +41 -0
- package/HashHistory/views/MainPage.vue +57 -0
- package/HashHistory/views/SubPage.vue +66 -0
- package/ImpactStop/App.vue +435 -0
- package/Input/App.vue +164 -0
- package/Input/FullKeyboard.vue +87 -0
- package/Input/InputPanel.vue +131 -0
- package/Input/KeyboardItem.vue +58 -0
- package/LongImage/App.vue +80 -0
- package/LongImage/Button.vue +58 -0
- package/LongImage/ButtonItem.vue +44 -0
- package/LongImage/LongImageScroll.vue +92 -0
- package/LongImage/Scroll.vue +14 -0
- package/LongImage/assets/1280x7200.jpg +0 -0
- package/LongText/App.vue +96 -0
- package/LongText/Button.vue +51 -0
- package/LongText/ButtonItem.vue +44 -0
- package/LongText/LongTextScroll.vue +192 -0
- package/LongText/Scroll.vue +14 -0
- package/Marquee/App.vue +247 -0
- package/Marquee/longText.js +14 -0
- package/MaskClip/App.vue +122 -0
- package/MaskClip/images/mask-025/config.json +29 -0
- package/MaskClip/images/mask-025/res/1.png +0 -0
- package/MaskClip/images/mask-025/res/2.png +0 -0
- package/MaskClip/images/mask-025/res/3.png +0 -0
- package/MaskClip/images/mask-025/res/4.png +0 -0
- package/MaskClip/images/mask-025/res/icon.png +0 -0
- package/MaskClip/images/mask-025/res/stroke.png +0 -0
- package/MaskClip/images/php.jpg +0 -0
- package/MetroWidgetDemos/Advanced/App.vue +46 -0
- package/MetroWidgetDemos/Advanced/ButtonItem.vue +90 -0
- package/MetroWidgetDemos/Advanced/Buttons.vue +70 -0
- package/MetroWidgetDemos/Advanced/Mixed.vue +77 -0
- package/MetroWidgetDemos/Advanced/widgets/Item.vue +83 -0
- package/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +89 -0
- package/MetroWidgetDemos/Advanced/widgets/Widgets.vue +116 -0
- package/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
- package/MetroWidgetDemos/Item.vue +85 -0
- package/MetroWidgetDemos/PerformanceTest/App.vue +210 -0
- package/MetroWidgetDemos/PerformanceTest/Item.vue +90 -0
- package/MetroWidgetDemos/PerformanceTest/assets/bg.jpg +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/coupon_content.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/coupon_left.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/coupon_mid.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/coupon_right.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/focus_border.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/holder_logo.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/jrbm.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/line_left.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/line_mid.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/line_right.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/loading.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/logo.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/mcjx.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/tao.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/tmall.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/border.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +386 -0
- package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +129 -0
- package/MetroWidgetDemos/PerformanceTest/data.js +45 -0
- package/MetroWidgetDemos/PingPong/App.vue +135 -0
- package/MetroWidgetDemos/PingPong/AppPage.vue +73 -0
- package/MetroWidgetDemos/PingPong/AppTab.vue +62 -0
- package/MetroWidgetDemos/PingPong/TabItem.vue +84 -0
- package/MetroWidgetDemos/PingPong/ViewSwiper.vue +214 -0
- package/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +75 -0
- package/MetroWidgetDemos/Simple/App.vue +45 -0
- package/MetroWidgetDemos/Simple/RelativeTemplate.vue +111 -0
- package/MetroWidgetDemos/WidgetItem.vue +89 -0
- package/MetroWidgetDemos/data.js +205 -0
- package/NinePatchDemo/App.vue +145 -0
- package/NinePatchDemo/Item.vue +69 -0
- package/NinePatchDemo/assets/border.png +0 -0
- package/Preload/App.vue +135 -0
- package/Preload/Item.vue +32 -0
- package/Preload/data.js +23 -0
- package/Preload/images/awesomeface.png +0 -0
- package/Preload/images/cat.jpg +0 -0
- package/Preload/images/rank.png +0 -0
- package/Preload/images/rank_focus.png +0 -0
- package/Preload/images/rule.png +0 -0
- package/Preload/images/rule_focus.png +0 -0
- package/Preload/images/start.png +0 -0
- package/Preload/images/start_focus.png +0 -0
- package/QrcodeDemo/App.vue +68 -0
- package/ScaleDownNeon/App.vue +107 -0
- package/SoundPool/App.vue +134 -0
- package/SoundPool/bgmusic.mp3 +0 -0
- package/SoundPool/coin.mp3 +0 -0
- package/SoundPool/jump.mp3 +0 -0
- package/SoundPool/lose.mp3 +0 -0
- package/SoundPool/run.mp3 +0 -0
- package/SprayView/App.vue +272 -0
- package/SprayView/assets/snow.png +0 -0
- package/SpriteImage/App.vue +173 -0
- package/SpriteImage/images/cat_run.png +0 -0
- package/SpriteImage/images/egg_break.json +116 -0
- package/SpriteImage/images/egg_break.png +0 -0
- package/SpriteImage/images/sprite.png +0 -0
- package/TextBox/App.vue +91 -0
- package/TextBox/RenderCenter.vue +133 -0
- package/TextBox/RenderLeft.vue +138 -0
- package/TextBox/RenderOneLine.vue +101 -0
- package/TextBox/RenderRight.vue +131 -0
- package/TextShadowDemo/App.vue +91 -0
- package/TextureAnimation/App.vue +336 -0
- package/TextureAnimation/App2.vue +111 -0
- package/TextureAnimation/assets/blackWhiteGrid.png +0 -0
- package/TextureAnimation/assets/light.png +0 -0
- package/TextureAnimation/assets/light2.png +0 -0
- package/TextureAnimation/assets/mask.png +0 -0
- package/TextureAnimation/assets/php.jpg +0 -0
- package/TextureAnimation/assets/php2.png +0 -0
- package/TextureAnimation/assets/swipLight.png +0 -0
- package/TextureSize/App.vue +132 -0
- package/TextureSize/bmpDemo.bmp +0 -0
- package/TextureSize/jpegDemo.jpeg +0 -0
- package/TextureSize/jpgDemo.jpg +0 -0
- package/TextureSize/pngDemo.png +0 -0
- package/TextureSize/pngNoAlphaDemo.png +0 -0
- package/ThrowMoveDemo/AccelerateDemo.vue +116 -0
- package/ThrowMoveDemo/App.vue +114 -0
- package/ThrowMoveDemo/LRParabolicDemo.vue +115 -0
- package/ThrowMoveDemo/TargetDemo.vue +116 -0
- package/ThrowMoveDemo/UDParabolicDemo.vue +121 -0
- package/TouchSample/App.vue +136 -0
- package/TouchSample/Item.vue +103 -0
- package/TouchSample/MetroWidgetHorizontal.vue +144 -0
- package/TouchSample/MetroWidgetVertical.vue +144 -0
- package/TouchSample/TouchContainerHorizontal.vue +160 -0
- package/TouchSample/TouchContainerVertical.vue +160 -0
- package/TouchSample/data.js +81 -0
- package/TransitPage/App.vue +29 -0
- package/VideoDemo/App.vue +121 -0
- package/VideoDemo/components/Button.vue +58 -0
- package/VideoDemo/components/Controllor.vue +197 -0
- package/VideoDemo/components/VideoFrame.vue +140 -0
- package/VisibleSensorDemo/App.vue +234 -0
- package/package.json +17 -0
|
Binary file
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { JsvQrcode } from "jsview";
|
|
3
|
+
import { ref, shallowRef } from "vue";
|
|
4
|
+
import { useRouter } from "vue-router";
|
|
5
|
+
|
|
6
|
+
const router = useRouter();
|
|
7
|
+
const value = "http://www.baidu.com/";
|
|
8
|
+
const size = 400;
|
|
9
|
+
const fgColor = "#0000FF";
|
|
10
|
+
const bgColor = "#ffff00";
|
|
11
|
+
const level = "H"; // ,容错级别,分别是L(7%)、M(15%)、Q(25%)、H(30%),
|
|
12
|
+
const includeImage = true;
|
|
13
|
+
const imageH = 64;
|
|
14
|
+
const imageW = 64;
|
|
15
|
+
const imageSrc =
|
|
16
|
+
"http://oss.image.51vtv.cn/homepage/20191224/0fdcdc8b258fe7baac16b73f58f8989d.jpg";
|
|
17
|
+
const tipsInfo = `功能:二维码展示可配置项:1.前景色
|
|
18
|
+
2.背景色
|
|
19
|
+
3.指定小图标
|
|
20
|
+
4.容错级别:'L', 'M', 'Q', 'H'`;
|
|
21
|
+
const onKeyDown = (ev) => {
|
|
22
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
23
|
+
router.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
};
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<jsv-focus-block
|
|
31
|
+
autoFocus
|
|
32
|
+
:onAction="{
|
|
33
|
+
onKeyDown: onKeyDown,
|
|
34
|
+
}"
|
|
35
|
+
>
|
|
36
|
+
<div :style="{ width: 1280, height: 720, backgroundColor: '#D8D8D8' }">
|
|
37
|
+
<div
|
|
38
|
+
:style="{
|
|
39
|
+
textAlign: 'left',
|
|
40
|
+
fontSize: '30px',
|
|
41
|
+
lineHeight: '50px',
|
|
42
|
+
color: '#ffffff',
|
|
43
|
+
left: 200 + 420,
|
|
44
|
+
top: 100,
|
|
45
|
+
width: 400,
|
|
46
|
+
height: 50 * 8,
|
|
47
|
+
backgroundColor: 'rgba(27,38,151,0.8)',
|
|
48
|
+
}"
|
|
49
|
+
>
|
|
50
|
+
{{ tipsInfo }}
|
|
51
|
+
</div>
|
|
52
|
+
<div :style="{ left: 200, top: 100 }">
|
|
53
|
+
<jsv-qrcode
|
|
54
|
+
:value="value"
|
|
55
|
+
:size="size"
|
|
56
|
+
:fgColor="fgColor"
|
|
57
|
+
:bgColor="bgColor"
|
|
58
|
+
:level="level"
|
|
59
|
+
:imageSettings="
|
|
60
|
+
includeImage
|
|
61
|
+
? { src: imageSrc, height: imageH, width: imageW }
|
|
62
|
+
: null
|
|
63
|
+
"
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</jsv-focus-block>
|
|
68
|
+
</template>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2022-10-24 13:19:41
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-10-24 13:50:18
|
|
6
|
+
* @Description: file content
|
|
7
|
+
-->
|
|
8
|
+
<script setup>
|
|
9
|
+
import { useRouter } from "vue-router";
|
|
10
|
+
const router = useRouter();
|
|
11
|
+
|
|
12
|
+
const test1 = "url(https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/ScaleDownTest/test_1.jpeg)";
|
|
13
|
+
const test2 = "url(https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/ScaleDownTest/test_2.jpeg)";
|
|
14
|
+
const test3 = "url(https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/ScaleDownTest/test_3.jpeg)";
|
|
15
|
+
const test4 = "url(https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/ScaleDownTest/test_4.jpeg)";
|
|
16
|
+
|
|
17
|
+
const onKeyDown = (ev) => {
|
|
18
|
+
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
19
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
20
|
+
if (window.JsView) {
|
|
21
|
+
window.JsView.setGlobalConfig({
|
|
22
|
+
texCache: -1,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
router.go(-1); // 有router时,回退
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const style1 = {
|
|
33
|
+
left: 0,
|
|
34
|
+
top: 0,
|
|
35
|
+
width: 250,
|
|
36
|
+
height: 250,
|
|
37
|
+
borderRadius: "15px",
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const style2 = {
|
|
41
|
+
left: 0,
|
|
42
|
+
top: 260,
|
|
43
|
+
width: 250,
|
|
44
|
+
height: 250,
|
|
45
|
+
borderRadius: "15px",
|
|
46
|
+
};
|
|
47
|
+
</script>
|
|
48
|
+
<template>
|
|
49
|
+
<jsv-focus-block autoFocus :onKeyDown="onKeyDown">
|
|
50
|
+
<div class="allBgc">
|
|
51
|
+
<div class="block">
|
|
52
|
+
<div :style="{ left: 0, top: 0 }">
|
|
53
|
+
<div class="leftFont top0">
|
|
54
|
+
{{ `原图加载` }}
|
|
55
|
+
</div>
|
|
56
|
+
<div class="leftFont top250">
|
|
57
|
+
{{ `使用缩小算法优化` }}
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<div :style="{ left: 120, top: 0 }">
|
|
62
|
+
<img alt="" :style="style1" :src="test4" />
|
|
63
|
+
<img alt="" :style="style2" jsvImgScaledownTex :src="test4" />
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div :style="{ left: 380, top: 0 }">
|
|
67
|
+
<img alt="" :style="style1" :src="test1" />
|
|
68
|
+
<img alt="" :style="style2" jsvImgScaledownTex :src="test1" />
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<div :style="{ left: 640, top: 0 }">
|
|
72
|
+
<img alt="" :style="style1" :src="test2" />
|
|
73
|
+
<img alt="" :style="style2" jsvImgScaledownTex :src="test2" />
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div :style="{ left: 900, top: 0 }">
|
|
77
|
+
<img alt="" :style="style1" :src="test3" />
|
|
78
|
+
<img alt="" :style="style2" jsvImgScaledownTex :src="test3" />
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</jsv-focus-block>
|
|
83
|
+
</template>
|
|
84
|
+
<style scoped>
|
|
85
|
+
.allBgc {
|
|
86
|
+
width: 1920;
|
|
87
|
+
height: 1080;
|
|
88
|
+
background-color: #334c4c;
|
|
89
|
+
}
|
|
90
|
+
.block {
|
|
91
|
+
left: 20;
|
|
92
|
+
top: 50;
|
|
93
|
+
}
|
|
94
|
+
.leftFont {
|
|
95
|
+
left: 0;
|
|
96
|
+
width: 100;
|
|
97
|
+
height: 200;
|
|
98
|
+
color: #ffffff;
|
|
99
|
+
font-size: 25px;
|
|
100
|
+
}
|
|
101
|
+
.top0 {
|
|
102
|
+
top: 0;
|
|
103
|
+
}
|
|
104
|
+
.top250 {
|
|
105
|
+
top: 250;
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2022-01-25 09:56:46
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-07-08 18:09:10
|
|
6
|
+
* @Description: file content
|
|
7
|
+
-->
|
|
8
|
+
<script setup>
|
|
9
|
+
import coin from "./coin.mp3";
|
|
10
|
+
import lose from "./lose.mp3";
|
|
11
|
+
import bgmusic from "./bgmusic.mp3";
|
|
12
|
+
import { JsvSoundPool, jJsvRuntimeBridge } from "jsview";
|
|
13
|
+
import { onMounted, onBeforeUnmount, shallowRef } from "vue";
|
|
14
|
+
import { useRouter } from "vue-router";
|
|
15
|
+
|
|
16
|
+
const router = useRouter();
|
|
17
|
+
const soundPool = new JsvSoundPool(10);
|
|
18
|
+
let coinController1 = null;
|
|
19
|
+
let coinController2 = null;
|
|
20
|
+
let loseController1 = null;
|
|
21
|
+
let loseController2 = null;
|
|
22
|
+
let bgm = shallowRef(null);
|
|
23
|
+
const _onKeyDown = (ev) => {
|
|
24
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
25
|
+
router.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
switch (ev.keyCode) {
|
|
29
|
+
case 37:
|
|
30
|
+
if (loseController1) {
|
|
31
|
+
loseController1.play();
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
34
|
+
case 38:
|
|
35
|
+
if (coinController1) {
|
|
36
|
+
coinController1.play();
|
|
37
|
+
}
|
|
38
|
+
break;
|
|
39
|
+
case 39:
|
|
40
|
+
if (loseController2) {
|
|
41
|
+
loseController2.play();
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
case 40:
|
|
45
|
+
if (coinController2) {
|
|
46
|
+
coinController2.play();
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
case 13:
|
|
50
|
+
bgm.value?.play();
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
};
|
|
55
|
+
soundPool.request(`url(${coin})`, null, 1, (state, audioController) => {
|
|
56
|
+
console.log("cchtest load succeed", audioController);
|
|
57
|
+
if (state === 0) {
|
|
58
|
+
coinController1 = audioController;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
soundPool.request(`url(${coin})`, null, 1, (state, audioController) => {
|
|
62
|
+
if (state === 0) {
|
|
63
|
+
coinController2 = audioController;
|
|
64
|
+
coinController2.setLoop(0);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
soundPool.request(`url(${lose})`, null, 1, (state, audioController) => {
|
|
69
|
+
if (state === 0) {
|
|
70
|
+
loseController1 = audioController;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
soundPool.request(`url(${lose})`, null, 1, (state, audioController) => {
|
|
74
|
+
if (state === 0) {
|
|
75
|
+
loseController2 = audioController;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
onMounted(() => {
|
|
80
|
+
jJsvRuntimeBridge.notifyPageLoaded();
|
|
81
|
+
});
|
|
82
|
+
onBeforeUnmount(() => {
|
|
83
|
+
coinController1 = null;
|
|
84
|
+
coinController2 = null;
|
|
85
|
+
loseController1 = null;
|
|
86
|
+
loseController2 = null;
|
|
87
|
+
soundPool.destroy();
|
|
88
|
+
bgm.value?.pause();
|
|
89
|
+
bgm.value?.unload();
|
|
90
|
+
});
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<template>
|
|
94
|
+
<jsv-focus-block
|
|
95
|
+
autoFocus
|
|
96
|
+
:onAction="{
|
|
97
|
+
onKeyDown: _onKeyDown,
|
|
98
|
+
}"
|
|
99
|
+
>
|
|
100
|
+
<div :style="{ width: 1920, height: 1080, backgroundColor: '#FFFFFF' }">
|
|
101
|
+
<div
|
|
102
|
+
:style="{
|
|
103
|
+
textAlign: 'center',
|
|
104
|
+
fontSize: '30px',
|
|
105
|
+
lineHeight: '50px',
|
|
106
|
+
color: '#ffffff',
|
|
107
|
+
left: 100,
|
|
108
|
+
top: 20,
|
|
109
|
+
width: 1280 - 200,
|
|
110
|
+
height: 50,
|
|
111
|
+
backgroundColor: 'rgba(27,38,151,0.8)',
|
|
112
|
+
}"
|
|
113
|
+
>
|
|
114
|
+
{{ `适合游戏场景的多音效混音效果` }}
|
|
115
|
+
</div>
|
|
116
|
+
<div
|
|
117
|
+
:style="{
|
|
118
|
+
left: 400,
|
|
119
|
+
top: 300,
|
|
120
|
+
width: 500,
|
|
121
|
+
height: 500,
|
|
122
|
+
color: '#000000',
|
|
123
|
+
textAlign: 'center',
|
|
124
|
+
fontSize: 30,
|
|
125
|
+
}"
|
|
126
|
+
>
|
|
127
|
+
{{
|
|
128
|
+
`[确定]: 播放背景音乐\n[左]: 播放失败音乐1\n[右]: 播放失败音乐2\n[上]: 播放硬币音乐1\n[下]: 播放硬币音乐2`
|
|
129
|
+
}}
|
|
130
|
+
</div>
|
|
131
|
+
<audiotrack ref="bgm" :src="bgmusic" loop="loop" />
|
|
132
|
+
</div>
|
|
133
|
+
</jsv-focus-block>
|
|
134
|
+
</template>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2021-10-13 11:19:26
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-07-08 17:09:58
|
|
6
|
+
* @Description: file content
|
|
7
|
+
-->
|
|
8
|
+
<script>
|
|
9
|
+
import { JsvSpray } from "jsview";
|
|
10
|
+
import snow from "./assets/snow.png";
|
|
11
|
+
const sprayOk = {
|
|
12
|
+
type: 0,
|
|
13
|
+
particleNum: 100,
|
|
14
|
+
deltaAngle: 180,
|
|
15
|
+
deltaWidth: 50,
|
|
16
|
+
deltaHeight: 50,
|
|
17
|
+
pointSizeMin: 20,
|
|
18
|
+
pointSizeMax: 30,
|
|
19
|
+
speedMin: 1,
|
|
20
|
+
speedMax: 7,
|
|
21
|
+
lifeMin: 1000,
|
|
22
|
+
lifeMax: 2000,
|
|
23
|
+
accelerateX: 0,
|
|
24
|
+
accelerateY: 0,
|
|
25
|
+
addNumSpeed: 0.001,
|
|
26
|
+
enableFade: true,
|
|
27
|
+
enableShrink: true,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const sprayRotate = {
|
|
31
|
+
type: 1,
|
|
32
|
+
particleNum: 100,
|
|
33
|
+
deltaAngle: 0,
|
|
34
|
+
deltaWidth: 0,
|
|
35
|
+
deltaHeight: 50,
|
|
36
|
+
pointSizeMin: 10,
|
|
37
|
+
pointSizeMax: 20,
|
|
38
|
+
speedMin: 5,
|
|
39
|
+
speedMax: 10,
|
|
40
|
+
lifeMin: 1000,
|
|
41
|
+
lifeMax: 3000,
|
|
42
|
+
accelerateX: 0,
|
|
43
|
+
accelerateY: -100,
|
|
44
|
+
addNumSpeed: 0.001,
|
|
45
|
+
enableFade: true,
|
|
46
|
+
enableShrink: false,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const sprayMove = {
|
|
50
|
+
type: 1,
|
|
51
|
+
particleNum: 100,
|
|
52
|
+
deltaAngle: 20,
|
|
53
|
+
deltaWidth: 50,
|
|
54
|
+
deltaHeight: 50,
|
|
55
|
+
pointSizeMin: 10,
|
|
56
|
+
pointSizeMax: 20,
|
|
57
|
+
speedMin: 5,
|
|
58
|
+
speedMax: 10,
|
|
59
|
+
lifeMin: 1000,
|
|
60
|
+
lifeMax: 3000,
|
|
61
|
+
accelerateX: -50,
|
|
62
|
+
accelerateY: -120,
|
|
63
|
+
addNumSpeed: 0.001,
|
|
64
|
+
enableFade: true,
|
|
65
|
+
enableShrink: true,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const sprayCycle = {
|
|
69
|
+
type: 1,
|
|
70
|
+
particleNum: 200,
|
|
71
|
+
deltaAngle: 20,
|
|
72
|
+
deltaWidth: 20,
|
|
73
|
+
deltaHeight: 20,
|
|
74
|
+
pointSizeMin: 10,
|
|
75
|
+
pointSizeMax: 20,
|
|
76
|
+
speedMin: 0,
|
|
77
|
+
speedMax: 0,
|
|
78
|
+
lifeMin: 1000,
|
|
79
|
+
lifeMax: 3000,
|
|
80
|
+
accelerateX: 0,
|
|
81
|
+
accelerateY: 0,
|
|
82
|
+
addNumSpeed: 0.001,
|
|
83
|
+
enableFade: true,
|
|
84
|
+
enableShrink: false,
|
|
85
|
+
};
|
|
86
|
+
export default {
|
|
87
|
+
components: {
|
|
88
|
+
JsvSpray,
|
|
89
|
+
},
|
|
90
|
+
data() {
|
|
91
|
+
return {
|
|
92
|
+
okCount: 0,
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
setup() {
|
|
96
|
+
return {
|
|
97
|
+
sprayOk,
|
|
98
|
+
sprayRotate,
|
|
99
|
+
sprayMove,
|
|
100
|
+
sprayCycle,
|
|
101
|
+
snow,
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
methods: {
|
|
105
|
+
onKeyDown(ev) {
|
|
106
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
107
|
+
this.$router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
switch (ev.keyCode) {
|
|
111
|
+
case 13:
|
|
112
|
+
this.okCount++;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
return true;
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
</script>
|
|
120
|
+
|
|
121
|
+
<template>
|
|
122
|
+
<div class="root">
|
|
123
|
+
<jsv-focus-block
|
|
124
|
+
autoFocus
|
|
125
|
+
:onAction="{
|
|
126
|
+
onKeyDown: onKeyDown,
|
|
127
|
+
}"
|
|
128
|
+
>
|
|
129
|
+
<div :style="{ top: 400, left: 200 }">
|
|
130
|
+
<div class="spray-ok">
|
|
131
|
+
<jsv-spray
|
|
132
|
+
v-if="okCount > 0"
|
|
133
|
+
:key="okCount"
|
|
134
|
+
:pointRes="`url(${snow})`"
|
|
135
|
+
:sprayStyle="sprayOk"
|
|
136
|
+
/>
|
|
137
|
+
</div>
|
|
138
|
+
<div class="describe">
|
|
139
|
+
{{ `#摁OK键\n#粒子在方形内生成\n#初速度方向360度随机\n#无外力作用` }}
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
<div :style="{ top: 400, left: 600 }">
|
|
143
|
+
<div class="spray-rotate">
|
|
144
|
+
<jsv-spray pointRes="rgba(0, 255, 0, 1)" :sprayStyle="sprayRotate" />
|
|
145
|
+
</div>
|
|
146
|
+
<div class="describe">
|
|
147
|
+
{{ `#粒子沿长边随机生成\n#初速度沿长边方向\n#受竖直方向的力作用` }}
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
<div :style="{ top: 400, left: 1000 }">
|
|
151
|
+
<div class="spray-move">
|
|
152
|
+
<jsv-spray :pointRes="`url(${snow})`" :sprayStyle="sprayMove" />
|
|
153
|
+
</div>
|
|
154
|
+
<div class="describe">
|
|
155
|
+
{{
|
|
156
|
+
`#粒子在方形随机生成\n#初速度方向为竖直向上方向正负20度内随机\n#受水平方向和竖直方向的力作用`
|
|
157
|
+
}}
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
<div :style="{ top: 20, left: 400 }">
|
|
161
|
+
<div
|
|
162
|
+
:style="{
|
|
163
|
+
width: 40,
|
|
164
|
+
height: 40,
|
|
165
|
+
animation: 'cycle 3s linear infinite',
|
|
166
|
+
}"
|
|
167
|
+
>
|
|
168
|
+
<jsv-spray :pointRes="`url(${snow})`" :sprayStyle="sprayCycle" />
|
|
169
|
+
</div>
|
|
170
|
+
<div
|
|
171
|
+
:style="{
|
|
172
|
+
top: 20,
|
|
173
|
+
width: 500,
|
|
174
|
+
height: 100,
|
|
175
|
+
lineHeight: '100px',
|
|
176
|
+
textAlign: 'center',
|
|
177
|
+
fontSize: '50px',
|
|
178
|
+
color: '#FFFFFF',
|
|
179
|
+
}"
|
|
180
|
+
>
|
|
181
|
+
粒子效果
|
|
182
|
+
</div>
|
|
183
|
+
<div class="describe">
|
|
184
|
+
{{ `#粒子在方形随机生成\n#初速度为0\n#不受外力` }}
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
</jsv-focus-block>
|
|
188
|
+
</div>
|
|
189
|
+
</template>
|
|
190
|
+
|
|
191
|
+
<style scoped>
|
|
192
|
+
@keyframes move-back-force {
|
|
193
|
+
0% {
|
|
194
|
+
transform: translate3d(0, 0, 0);
|
|
195
|
+
}
|
|
196
|
+
25% {
|
|
197
|
+
transform: translate3d(100px, 0, 0);
|
|
198
|
+
}
|
|
199
|
+
50% {
|
|
200
|
+
transform: translate3d(0, 0, 0);
|
|
201
|
+
}
|
|
202
|
+
75% {
|
|
203
|
+
transform: translate3d(100px, 0, 0);
|
|
204
|
+
}
|
|
205
|
+
100% {
|
|
206
|
+
transform: translate3d(0, 0, 0);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@keyframes rotate {
|
|
211
|
+
from {
|
|
212
|
+
transform: rotate3d(0, 0, 1, 0);
|
|
213
|
+
}
|
|
214
|
+
to {
|
|
215
|
+
transform: rotate3d(0, 0, 1, 360deg);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@keyframes cycle {
|
|
220
|
+
0% {
|
|
221
|
+
transform: translate3d(0, 0, 0);
|
|
222
|
+
}
|
|
223
|
+
25% {
|
|
224
|
+
transform: translate3d(500px, 0, 0);
|
|
225
|
+
}
|
|
226
|
+
50% {
|
|
227
|
+
transform: translate3d(500px, 100px, 0);
|
|
228
|
+
}
|
|
229
|
+
75% {
|
|
230
|
+
transform: translate3d(0, 100px, 0);
|
|
231
|
+
}
|
|
232
|
+
100% {
|
|
233
|
+
transform: translate3d(0, 0, 0);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
.root {
|
|
237
|
+
width: 1280px;
|
|
238
|
+
height: 720;
|
|
239
|
+
background-color: #334c4c;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.spray-ok {
|
|
243
|
+
width: 100px;
|
|
244
|
+
height: 100px;
|
|
245
|
+
background-color: #00ff00;
|
|
246
|
+
}
|
|
247
|
+
.spray-rotate {
|
|
248
|
+
width: 10px;
|
|
249
|
+
height: 100px;
|
|
250
|
+
background-color: #00ff00;
|
|
251
|
+
animation: rotate 3s linear infinite;
|
|
252
|
+
}
|
|
253
|
+
.spray-move {
|
|
254
|
+
width: 100px;
|
|
255
|
+
height: 100px;
|
|
256
|
+
background-color: #00ff00;
|
|
257
|
+
animation: move-back-force 10s linear infinite;
|
|
258
|
+
}
|
|
259
|
+
.spray-cycle {
|
|
260
|
+
width: 40px;
|
|
261
|
+
height: 40px;
|
|
262
|
+
animation: cycle 3s linear infinite;
|
|
263
|
+
}
|
|
264
|
+
.describe {
|
|
265
|
+
left: 0px;
|
|
266
|
+
top: 140px;
|
|
267
|
+
width: 250px;
|
|
268
|
+
height: 200px;
|
|
269
|
+
color: #ffffff;
|
|
270
|
+
font-size: 20px;
|
|
271
|
+
}
|
|
272
|
+
</style>
|
|
Binary file
|