@shijiu/jsview-vue-samples 2.1.25 → 2.1.200
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/Basic/components/div/DivBackground.vue +53 -24
- package/BreakRender/App.vue +69 -0
- package/BreakRender/Item.vue +77 -0
- package/BreakRender/assets/imageList.json +237 -0
- package/BreakRender/data.js +18 -0
- package/ClassDynamicSwitching/App.vue +83 -0
- package/ClassDynamicSwitching/components/ClassItem.vue +257 -0
- package/ClassDynamicSwitching/components/ClassShow.vue +78 -0
- package/ClassDynamicSwitching/components/StyleItem.vue +165 -0
- package/ClassDynamicSwitching/components/StyleShow.vue +68 -0
- package/DemoHomepage/router.js +67 -13
- package/DemoHomepage/views/Homepage.vue +13 -2
- package/DynamicClass/App.vue +115 -0
- package/DynamicClass/components/FloorItem.vue +55 -0
- package/DynamicClass/components/FloorList.vue +210 -0
- package/DynamicClass/style1.json +163 -0
- package/DynamicClass/style2.json +164 -0
- package/FilterDemo/App.vue +1 -1
- package/FocusMoveStyle/App.vue +10 -2
- package/FreeMove/App.vue +291 -0
- package/GetBoundingClientRect/App.vue +177 -0
- package/GiftRain/App.vue +3 -3
- package/JsvLine/App.vue +116 -0
- package/JsvLine/bgimage.jpg +0 -0
- package/JsvPreDownloader/App.vue +17 -10
- package/LatexDemo/App.vue +66 -0
- package/LatexFormula/App.vue +65 -0
- package/Marquee/App.vue +711 -183
- package/MetroWidgetDemos/PingPong/App.vue +0 -9
- package/MetroWidgetDemos/PingPong/AppPage.vue +2 -1
- package/MetroWidgetDemos/PingPong/WidgetItem.vue +0 -5
- package/MetroWidgetDemos/SkeletonDiagram/App.vue +3 -1
- package/MetroWidgetDemos/SkeletonDiagram/Item.vue +5 -0
- package/MetroWidgetDemos/itemSizeUpdate/App.vue +11 -4
- package/MetroWidgetDemos/itemSizeUpdate/backward/Backward.vue +6 -4
- package/MetroWidgetDemos/itemSizeUpdate/backward/Item.vue +2 -25
- package/MetroWidgetDemos/itemSizeUpdate/center/Center.vue +6 -6
- package/MetroWidgetDemos/itemSizeUpdate/center/Item.vue +38 -49
- package/MetroWidgetDemos/itemSizeUpdate/stretch/App.vue +122 -0
- package/MetroWidgetDemos/itemSizeUpdate/stretch/Item.vue +105 -0
- package/MindMap/App.vue +61 -0
- package/MindMap/Item.vue +40 -0
- package/MindMap/data.js +86 -0
- package/Preload/App.vue +25 -18
- package/Preload/Item.vue +1 -1
- package/Preload/data.js +12 -12
- package/Preload/images/bg_btn.png +0 -0
- package/Preload/images/bg_btn_focus.png +0 -0
- package/Preload/images/btn_cancle.png +0 -0
- package/Preload/images/btn_ok.png +0 -0
- package/Preload/images/tease.png +0 -0
- package/Preload/images/tease_lock.png +0 -0
- package/SecTorTest/App.vue +106 -0
- package/TextureStoreTest/App.vue +168 -0
- package/VisibleSensorDemo/App.vue +38 -18
- package/package.json +1 -1
- 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
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bg": {
|
|
3
|
+
"width": 1280,
|
|
4
|
+
"height": 720,
|
|
5
|
+
"top": 0,
|
|
6
|
+
"left": 0,
|
|
7
|
+
"backgroundColor": "#CCCCCC"
|
|
8
|
+
},
|
|
9
|
+
"bg1": {
|
|
10
|
+
"width": 1280,
|
|
11
|
+
"height": 720,
|
|
12
|
+
"top": 0,
|
|
13
|
+
"left": 0,
|
|
14
|
+
"backgroundColor": "#FDDBBB"
|
|
15
|
+
},
|
|
16
|
+
"floor1-bg": {
|
|
17
|
+
"width": 1280,
|
|
18
|
+
"height": 300,
|
|
19
|
+
"top": 100,
|
|
20
|
+
"left": 0,
|
|
21
|
+
"fontSize": 20,
|
|
22
|
+
"lineHeight": 30,
|
|
23
|
+
"color": "#DAAD21"
|
|
24
|
+
},
|
|
25
|
+
"floor1Metro": {
|
|
26
|
+
"width": 1280,
|
|
27
|
+
"height": 300,
|
|
28
|
+
"top": 0,
|
|
29
|
+
"left": 0,
|
|
30
|
+
"padding": { "left": 28 },
|
|
31
|
+
"data": {
|
|
32
|
+
"width": 200,
|
|
33
|
+
"height": 300,
|
|
34
|
+
"marginRight": 56,
|
|
35
|
+
"marqueeData": {
|
|
36
|
+
"width": 200,
|
|
37
|
+
"height": 30,
|
|
38
|
+
"fontSize": 18,
|
|
39
|
+
"lineHeight": 30,
|
|
40
|
+
"direction": "ltr",
|
|
41
|
+
"top": 270
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"poster1": {
|
|
46
|
+
"width": 200,
|
|
47
|
+
"height": 300,
|
|
48
|
+
"backgroundColor": "#BBBBAA",
|
|
49
|
+
"textAlign": "center"
|
|
50
|
+
},
|
|
51
|
+
"title1": {
|
|
52
|
+
"width": 200,
|
|
53
|
+
"height": 30,
|
|
54
|
+
"left": 0,
|
|
55
|
+
"top": 240,
|
|
56
|
+
"backgroundColor": "#FFFFFF"
|
|
57
|
+
},
|
|
58
|
+
"focusBg1": {
|
|
59
|
+
"backgroundColor": "#DD8888"
|
|
60
|
+
},
|
|
61
|
+
"blurBg1": {
|
|
62
|
+
"backgroundColor": "#BBBBAA"
|
|
63
|
+
},
|
|
64
|
+
"floor2-bg": {
|
|
65
|
+
"width": 1280,
|
|
66
|
+
"height": 400,
|
|
67
|
+
"top": 500,
|
|
68
|
+
"left": 0,
|
|
69
|
+
"fontSize": 38,
|
|
70
|
+
"lineHeight": 50,
|
|
71
|
+
"color": "#FFFFFF"
|
|
72
|
+
},
|
|
73
|
+
"floor2Metro": {
|
|
74
|
+
"width": 1280,
|
|
75
|
+
"height": 400,
|
|
76
|
+
"top": 0,
|
|
77
|
+
"left": 0,
|
|
78
|
+
"padding": { "left": 0 },
|
|
79
|
+
"data": {
|
|
80
|
+
"width": 620,
|
|
81
|
+
"height": 400,
|
|
82
|
+
"marginRight": 40,
|
|
83
|
+
"marqueeData": {
|
|
84
|
+
"width": 620,
|
|
85
|
+
"height": 40,
|
|
86
|
+
"fontSize": 30,
|
|
87
|
+
"lineHeight": 40,
|
|
88
|
+
"direction": "ltr",
|
|
89
|
+
"top": 360
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"poster2": {
|
|
94
|
+
"width": 620,
|
|
95
|
+
"height": 400,
|
|
96
|
+
"backgroundColor": "#BBAAAA",
|
|
97
|
+
"textAlign": "center"
|
|
98
|
+
},
|
|
99
|
+
"title2": {
|
|
100
|
+
"width": 620,
|
|
101
|
+
"height": 50,
|
|
102
|
+
"left": 0,
|
|
103
|
+
"top": 310,
|
|
104
|
+
"backgroundColor": "#FFF221"
|
|
105
|
+
},
|
|
106
|
+
"focusBg2": {
|
|
107
|
+
"backgroundColor": "#BBFF66"
|
|
108
|
+
},
|
|
109
|
+
"blurBg2": {
|
|
110
|
+
"backgroundColor": "#BBAAAA"
|
|
111
|
+
},
|
|
112
|
+
"floor3-bg": {
|
|
113
|
+
"width": 1280,
|
|
114
|
+
"height": 300,
|
|
115
|
+
"top": 980,
|
|
116
|
+
"left": 0,
|
|
117
|
+
"fontSize": 20,
|
|
118
|
+
"lineHeight": 30,
|
|
119
|
+
"color": "#FDD312"
|
|
120
|
+
},
|
|
121
|
+
"floor3Metro": {
|
|
122
|
+
"width": 1280,
|
|
123
|
+
"height": 300,
|
|
124
|
+
"top": 0,
|
|
125
|
+
"left": 0,
|
|
126
|
+
"padding": { "left": 5 },
|
|
127
|
+
"data": {
|
|
128
|
+
"width": 150,
|
|
129
|
+
"height": 300,
|
|
130
|
+
"marginRight": 30,
|
|
131
|
+
"marqueeData": {
|
|
132
|
+
"width": 150,
|
|
133
|
+
"height": 30,
|
|
134
|
+
"fontSize": 18,
|
|
135
|
+
"lineHeight": 30,
|
|
136
|
+
"direction": "ltr",
|
|
137
|
+
"top": 270
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"poster3": {
|
|
142
|
+
"width": 150,
|
|
143
|
+
"height": 300,
|
|
144
|
+
"backgroundColor": "#BBBBBB",
|
|
145
|
+
"textAlign": "center"
|
|
146
|
+
},
|
|
147
|
+
"title3": {
|
|
148
|
+
"width": 150,
|
|
149
|
+
"height": 30,
|
|
150
|
+
"left": 0,
|
|
151
|
+
"top": 240,
|
|
152
|
+
"backgroundColor": "#FFFFFF"
|
|
153
|
+
},
|
|
154
|
+
"focusBg3": {
|
|
155
|
+
"backgroundColor": "#DD8888"
|
|
156
|
+
},
|
|
157
|
+
"blurBg3": {
|
|
158
|
+
"backgroundColor": "#BBBBBB"
|
|
159
|
+
},
|
|
160
|
+
"grow": {
|
|
161
|
+
"transition": "transform 0.35s cubic-bezier(0.42, 3.96, 0.62, 0)",
|
|
162
|
+
"transform": "scale3d(1,1.1,1)"
|
|
163
|
+
}
|
|
164
|
+
}
|
package/FilterDemo/App.vue
CHANGED
package/FocusMoveStyle/App.vue
CHANGED
|
@@ -16,6 +16,11 @@ const styleShell = getKeyFramesGroup();
|
|
|
16
16
|
|
|
17
17
|
const animationCache = {};
|
|
18
18
|
const addAnimation = (fromRect, toRect, name) => {
|
|
19
|
+
if (animationCache.hasOwnProperty(name)) {
|
|
20
|
+
styleShell.removeRule(name);
|
|
21
|
+
delete animationCache[name];
|
|
22
|
+
}
|
|
23
|
+
console.log("LudlDebug anim");
|
|
19
24
|
if (!(name in animationCache)) {
|
|
20
25
|
const animStr = `@keyframes ${name} {
|
|
21
26
|
0% {
|
|
@@ -66,6 +71,8 @@ const focusSize = reactive({
|
|
|
66
71
|
onTransitionEnd: null,
|
|
67
72
|
});
|
|
68
73
|
|
|
74
|
+
let animateChange = 0; // A B版动画切换,解决animation属性不变化引起不刷新问题
|
|
75
|
+
|
|
69
76
|
const focusFrameController = {
|
|
70
77
|
preRect: null,
|
|
71
78
|
curRect: null,
|
|
@@ -75,7 +82,8 @@ const focusFrameController = {
|
|
|
75
82
|
this.preRect = this.curRect;
|
|
76
83
|
this.curRect = rect;
|
|
77
84
|
if (this.focusIndex >= 0) {
|
|
78
|
-
const animName = "
|
|
85
|
+
const animName = "test_focusMove_" + animateChange;
|
|
86
|
+
animateChange = animateChange == 0 ? 1 : 0; // A B 版切换
|
|
79
87
|
addAnimation(this.preRect, this.curRect, animName);
|
|
80
88
|
focusSize.animation = `${animName} 0.3s linear`;
|
|
81
89
|
}
|
|
@@ -135,7 +143,7 @@ onBeforeUnmount(() => {
|
|
|
135
143
|
for (let name in animationCache) {
|
|
136
144
|
removeAnimation(name);
|
|
137
145
|
}
|
|
138
|
-
})
|
|
146
|
+
});
|
|
139
147
|
</script>
|
|
140
148
|
|
|
141
149
|
<template>
|
package/FreeMove/App.vue
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<jsv-focus-block autoFocus :onKeyDown="procKeyDown">
|
|
3
|
+
<div class="bgStyle">
|
|
4
|
+
<div v-for="(item, index) in 6">
|
|
5
|
+
<div v-show="index == num - 1">
|
|
6
|
+
<jsv-free-move-actor :ref="(el) => (actRef[index] = el)">
|
|
7
|
+
<div class="box">{{ "测试文字1" }}</div>
|
|
8
|
+
</jsv-free-move-actor>
|
|
9
|
+
<jsv-free-move-actor :ref="(el) => (actRef2[index] = el)">
|
|
10
|
+
<div class="box" :style="{ backgroundColor: '#b52489' }">
|
|
11
|
+
{{ "测试文字2" }}
|
|
12
|
+
</div>
|
|
13
|
+
</jsv-free-move-actor>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="tip">{{ "左右键翻页 " + `${num}/6 页` }}</div>
|
|
17
|
+
</div>
|
|
18
|
+
</jsv-focus-block>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup>
|
|
22
|
+
import { JsvFreeMoveActor, FreeMoveDef } from "jsview";
|
|
23
|
+
import { shallowRef, onMounted, watch } from "vue";
|
|
24
|
+
|
|
25
|
+
const actEvents = FreeMoveDef.ActEventDefine;
|
|
26
|
+
const keepFlags = FreeMoveDef.KeepFlags;
|
|
27
|
+
|
|
28
|
+
let actRef = shallowRef([]);
|
|
29
|
+
let actRef2 = shallowRef([]);
|
|
30
|
+
let actorControl = null;
|
|
31
|
+
let actorControl2 = null;
|
|
32
|
+
|
|
33
|
+
let num = shallowRef(1);
|
|
34
|
+
const procKeyDown = (ev) => {
|
|
35
|
+
switch (ev.keyCode) {
|
|
36
|
+
case 13:
|
|
37
|
+
console.log("procKeyDown get ok key");
|
|
38
|
+
break;
|
|
39
|
+
case 37:
|
|
40
|
+
if (num.value !== 1) {
|
|
41
|
+
num.value -= 1;
|
|
42
|
+
} else {
|
|
43
|
+
num.value = 1;
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
46
|
+
case 39:
|
|
47
|
+
if (num.value !== 6) {
|
|
48
|
+
num.value += 1;
|
|
49
|
+
} else {
|
|
50
|
+
num.value = 6;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
// ******* 直接跳转位置 *******
|
|
55
|
+
window.DebugResetPos = (x, y) => {
|
|
56
|
+
actorControl.run([
|
|
57
|
+
actorControl.state().clearAllConditions(),
|
|
58
|
+
actorControl.action().teleportTo(x, y),
|
|
59
|
+
]);
|
|
60
|
+
|
|
61
|
+
actorControl2.run([
|
|
62
|
+
actorControl2.state().clearAllConditions(),
|
|
63
|
+
actorControl2.action().teleportTo(x, y + 50),
|
|
64
|
+
]);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
window.DebugResetOffsetPos = (x, y) => {
|
|
68
|
+
actorControl.run([
|
|
69
|
+
actorControl.state().clearAllConditions(),
|
|
70
|
+
actorControl.action().teleportOffset(x, y),
|
|
71
|
+
]);
|
|
72
|
+
|
|
73
|
+
actorControl2.run([
|
|
74
|
+
actorControl2.state().clearAllConditions(),
|
|
75
|
+
actorControl2.action().teleportOffset(x, y),
|
|
76
|
+
]);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// ******* 有参照物的刹车测试,仅X轴移动 *******
|
|
80
|
+
window.DebugBrakeToPosX = () => {
|
|
81
|
+
// 参照物
|
|
82
|
+
actorControl.run([
|
|
83
|
+
actorControl.state().clearAllConditions(),
|
|
84
|
+
actorControl.action().teleportTo(400, 50),
|
|
85
|
+
]);
|
|
86
|
+
// 运动体
|
|
87
|
+
actorControl2.run([
|
|
88
|
+
actorControl2.state().clearAllConditions(),
|
|
89
|
+
actorControl2.state().setStartPos(0, 200),
|
|
90
|
+
actorControl2.action().moveTo(300, undefined, 10, undefined),
|
|
91
|
+
actorControl2
|
|
92
|
+
.condition()
|
|
93
|
+
.reachPosition(200, undefined)
|
|
94
|
+
.then([
|
|
95
|
+
actorControl2.action(1).brakeToPosition(
|
|
96
|
+
400,
|
|
97
|
+
undefined,
|
|
98
|
+
(a, b, c, d) => {
|
|
99
|
+
console.log(
|
|
100
|
+
`LudlDebugCB DebugBrakeToPos enter a=${a} b=${b} c=${c} d=${d}`
|
|
101
|
+
);
|
|
102
|
+
},
|
|
103
|
+
() => {
|
|
104
|
+
console.log("LudlDebugCB DebugBrakeToPos onRejected");
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
]),
|
|
108
|
+
]);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// ******* 有参照物的刹车测试,XY都移动 *******
|
|
112
|
+
window.DebugBrakeToPosXY = () => {
|
|
113
|
+
// 参照物
|
|
114
|
+
actorControl.run([
|
|
115
|
+
actorControl.state().clearAllConditions(),
|
|
116
|
+
actorControl.action().teleportTo(400, 50),
|
|
117
|
+
]);
|
|
118
|
+
// 运动体
|
|
119
|
+
actorControl2.run([
|
|
120
|
+
actorControl2.state().clearAllConditions(),
|
|
121
|
+
actorControl2.state().setStartPos(800, 400),
|
|
122
|
+
actorControl2.action().moveTo(100, 50, 10, undefined),
|
|
123
|
+
actorControl2
|
|
124
|
+
.condition()
|
|
125
|
+
.reachPosition(400, undefined)
|
|
126
|
+
.then([
|
|
127
|
+
actorControl2.action(3).brakeToPosition(
|
|
128
|
+
100,
|
|
129
|
+
50,
|
|
130
|
+
(a, b, c, d) => {
|
|
131
|
+
console.log(
|
|
132
|
+
`LudlDebugCB DebugBrakeToPos enter a=${a} b=${b} c=${c} d=${d}`
|
|
133
|
+
);
|
|
134
|
+
},
|
|
135
|
+
() => {
|
|
136
|
+
console.log("LudlDebugCB DebugBrakeToPos onRejected");
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
]),
|
|
140
|
+
]);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
// ******* 定向移动 *******
|
|
144
|
+
window.DebugMoveTarget = () => {
|
|
145
|
+
actorControl2.run([
|
|
146
|
+
actorControl2.state().clearAllConditions(),
|
|
147
|
+
actorControl2.state().setStartPos(0, 400),
|
|
148
|
+
actorControl2.action().moveTo(300, undefined, 10, undefined),
|
|
149
|
+
]);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// ******* 定向移动 + 回调监听 和 共享结束监听(onActEvent) *******
|
|
153
|
+
window.DebugTestMove = (x, y) => {
|
|
154
|
+
let actRef = {};
|
|
155
|
+
actorControl.run([
|
|
156
|
+
actorControl.state().clearAllConditions(),
|
|
157
|
+
actorControl.state().setStartPos(160, 150),
|
|
158
|
+
actorControl.action(0, 0, actRef).moveTo(x, y, 2, 2, (a, b, c, d) => {
|
|
159
|
+
console.log(
|
|
160
|
+
"LudlDebugCB DebugTestMove enter " +
|
|
161
|
+
" a=" +
|
|
162
|
+
a +
|
|
163
|
+
" b=" +
|
|
164
|
+
b +
|
|
165
|
+
" c=" +
|
|
166
|
+
c +
|
|
167
|
+
" d=" +
|
|
168
|
+
d
|
|
169
|
+
);
|
|
170
|
+
}),
|
|
171
|
+
actorControl
|
|
172
|
+
.condition()
|
|
173
|
+
.onActEvent(actRef, actEvents.ActFinish)
|
|
174
|
+
.then([
|
|
175
|
+
() => {
|
|
176
|
+
console.log("on move finished");
|
|
177
|
+
},
|
|
178
|
+
]),
|
|
179
|
+
]);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
window.DebugTestOffset = (control, startPos) => {
|
|
183
|
+
control.run([
|
|
184
|
+
actorControl.state().clearAllConditions(),
|
|
185
|
+
control.state().setStartPos(startPos, 150),
|
|
186
|
+
control.action().altSpeed(3, undefined, 0),
|
|
187
|
+
control
|
|
188
|
+
.condition(undefined, true)
|
|
189
|
+
.reachPosition(460, undefined)
|
|
190
|
+
.then([actorControl.action(1, 0).teleportOffset(-300, undefined)]),
|
|
191
|
+
]);
|
|
192
|
+
};
|
|
193
|
+
window.DebugTestThrowStart = () => {
|
|
194
|
+
// 参照物
|
|
195
|
+
actorControl2.run([
|
|
196
|
+
actorControl2.state().clearAllConditions(),
|
|
197
|
+
actorControl2.action().teleportTo(400, 300),
|
|
198
|
+
]);
|
|
199
|
+
|
|
200
|
+
actorControl.run([
|
|
201
|
+
actorControl.state().clearAllConditions(),
|
|
202
|
+
actorControl.state().setStartPos(100, 300),
|
|
203
|
+
actorControl.action().setSpeed(2, undefined),
|
|
204
|
+
actorControl
|
|
205
|
+
.action(1)
|
|
206
|
+
.setSpdAndAccel(undefined, -20, undefined, 0.3, null, () => {
|
|
207
|
+
console.log("on pole");
|
|
208
|
+
// 在接触地板时停止
|
|
209
|
+
actorControl.run([
|
|
210
|
+
actorControl
|
|
211
|
+
.condition(undefined, true)
|
|
212
|
+
.reachPosition(undefined, 300)
|
|
213
|
+
.then([actorControl.action(3, 3).stopMoving()]),
|
|
214
|
+
]);
|
|
215
|
+
}),
|
|
216
|
+
]);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
window.DebugTestThrow = () => {};
|
|
220
|
+
|
|
221
|
+
watch(num, (n, o) => {
|
|
222
|
+
switch (n) {
|
|
223
|
+
case 1:
|
|
224
|
+
actorControl = actRef.value[0].control;
|
|
225
|
+
actorControl2 = actRef2.value[0].control;
|
|
226
|
+
window.DebugTestMove(200, 200);
|
|
227
|
+
break;
|
|
228
|
+
case 2:
|
|
229
|
+
actorControl = actRef.value[1].control;
|
|
230
|
+
actorControl2 = actRef2.value[1].control;
|
|
231
|
+
window.DebugTestOffset(actorControl, 160);
|
|
232
|
+
window.DebugTestOffset(actorControl2, 310);
|
|
233
|
+
break;
|
|
234
|
+
case 3:
|
|
235
|
+
actorControl = actRef.value[2].control;
|
|
236
|
+
actorControl2 = actRef2.value[2].control;
|
|
237
|
+
window.DebugMoveTarget();
|
|
238
|
+
break;
|
|
239
|
+
case 4:
|
|
240
|
+
actorControl = actRef.value[3].control;
|
|
241
|
+
actorControl2 = actRef2.value[3].control;
|
|
242
|
+
window.DebugBrakeToPosX();
|
|
243
|
+
break;
|
|
244
|
+
case 5:
|
|
245
|
+
actorControl = actRef.value[4].control;
|
|
246
|
+
actorControl2 = actRef2.value[4].control;
|
|
247
|
+
window.DebugTestThrowStart();
|
|
248
|
+
break;
|
|
249
|
+
case 6:
|
|
250
|
+
actorControl = actRef.value[5].control;
|
|
251
|
+
actorControl2 = actRef2.value[5].control;
|
|
252
|
+
window.DebugBrakeToPosXY();
|
|
253
|
+
break;
|
|
254
|
+
default:
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
onMounted(() => {
|
|
259
|
+
actorControl = actRef.value[0].control;
|
|
260
|
+
actorControl2 = actRef2.value[0].control;
|
|
261
|
+
window.DebugControl = actorControl;
|
|
262
|
+
window.DebugTestMove(200, 200);
|
|
263
|
+
});
|
|
264
|
+
</script>
|
|
265
|
+
|
|
266
|
+
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
267
|
+
<style scoped>
|
|
268
|
+
.bgStyle {
|
|
269
|
+
width: 1280;
|
|
270
|
+
height: 720;
|
|
271
|
+
background-color: #007788;
|
|
272
|
+
}
|
|
273
|
+
.box {
|
|
274
|
+
width: 150;
|
|
275
|
+
height: 150;
|
|
276
|
+
font-size: 30;
|
|
277
|
+
color: #000000;
|
|
278
|
+
background-color: #3fb524;
|
|
279
|
+
}
|
|
280
|
+
.tip {
|
|
281
|
+
width: 300;
|
|
282
|
+
height: 30;
|
|
283
|
+
line-height: 28;
|
|
284
|
+
font-size: 28;
|
|
285
|
+
left: 980;
|
|
286
|
+
top: 680;
|
|
287
|
+
text-align: center;
|
|
288
|
+
font-weight: bold;
|
|
289
|
+
color: #ffffff;
|
|
290
|
+
}
|
|
291
|
+
</style>
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import img from "../assets/jpegDemo.jpeg";
|
|
3
|
+
import { ref, shallowRef, onMounted } from "vue";
|
|
4
|
+
|
|
5
|
+
const ref1 = shallowRef();
|
|
6
|
+
const ref2 = shallowRef();
|
|
7
|
+
const ref3 = shallowRef();
|
|
8
|
+
const ref4 = shallowRef();
|
|
9
|
+
const ref5 = shallowRef();
|
|
10
|
+
|
|
11
|
+
const targetRect1 = {
|
|
12
|
+
left: 20,
|
|
13
|
+
top: 120,
|
|
14
|
+
width: 200,
|
|
15
|
+
height: 200,
|
|
16
|
+
};
|
|
17
|
+
const targetRect2 = {
|
|
18
|
+
left: 230,
|
|
19
|
+
top: 120,
|
|
20
|
+
width: 210,
|
|
21
|
+
height: 210,
|
|
22
|
+
};
|
|
23
|
+
const targetRect3 = {
|
|
24
|
+
left: 440,
|
|
25
|
+
top: 120,
|
|
26
|
+
width: 200,
|
|
27
|
+
height: 200,
|
|
28
|
+
};
|
|
29
|
+
const targetRect4 = {
|
|
30
|
+
left: 640,
|
|
31
|
+
top: 110,
|
|
32
|
+
width: 220,
|
|
33
|
+
height: 220,
|
|
34
|
+
};
|
|
35
|
+
const targetRect5 = {
|
|
36
|
+
left: 860,
|
|
37
|
+
top: 120,
|
|
38
|
+
width: 220,
|
|
39
|
+
height: 220,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const color1 = ref("#FFFF00");
|
|
43
|
+
const color2 = ref("#FFFF00");
|
|
44
|
+
const color3 = ref("#FFFF00");
|
|
45
|
+
const color4 = ref("#FFFF00");
|
|
46
|
+
const color5 = ref("#FFFF00");
|
|
47
|
+
|
|
48
|
+
const isMatch = (d1, d2) => {
|
|
49
|
+
return (
|
|
50
|
+
d1.left == d2.left &&
|
|
51
|
+
d1.top == d2.top &&
|
|
52
|
+
d1.width == d2.width &&
|
|
53
|
+
d1.height == d2.height
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
onMounted(() => {
|
|
57
|
+
ref1.value.jsvGetBoundingClientRect().then((data) => {
|
|
58
|
+
console.log("rect1", targetRect1, data);
|
|
59
|
+
color1.value = isMatch(data, targetRect1) ? "#00FF00" : "#FF0000";
|
|
60
|
+
});
|
|
61
|
+
ref2.value.jsvGetBoundingClientRect().then((data) => {
|
|
62
|
+
console.log("rect2", targetRect2, data);
|
|
63
|
+
color2.value = isMatch(data, targetRect2) ? "#00FF00" : "#FF0000";
|
|
64
|
+
});
|
|
65
|
+
ref3.value.jsvGetBoundingClientRect().then((data) => {
|
|
66
|
+
console.log("rect3", targetRect3, data);
|
|
67
|
+
color3.value = isMatch(data, targetRect3) ? "#00FF00" : "#FF0000";
|
|
68
|
+
});
|
|
69
|
+
ref4.value.jsvGetBoundingClientRect().then((data) => {
|
|
70
|
+
console.log("rect4", targetRect4, data);
|
|
71
|
+
color4.value = isMatch(data, targetRect4) ? "#00FF00" : "#FF0000";
|
|
72
|
+
});
|
|
73
|
+
ref5.value.jsvGetBoundingClientRect().then((data) => {
|
|
74
|
+
console.log("rect5", targetRect5, data);
|
|
75
|
+
color5.value = isMatch(data, targetRect5) ? "#00FF00" : "#FF0000";
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
</script>
|
|
79
|
+
<template>
|
|
80
|
+
<div
|
|
81
|
+
:style="{
|
|
82
|
+
width: 1280,
|
|
83
|
+
height: 720,
|
|
84
|
+
backgroundColor: '#FFFFFF',
|
|
85
|
+
}"
|
|
86
|
+
></div>
|
|
87
|
+
|
|
88
|
+
<div
|
|
89
|
+
:style="{
|
|
90
|
+
top: 20,
|
|
91
|
+
width: 1280,
|
|
92
|
+
height: 50,
|
|
93
|
+
fontSize: 30,
|
|
94
|
+
backgroundColor: '#007788',
|
|
95
|
+
color: '#FFFFFF',
|
|
96
|
+
textAlign: 'center'
|
|
97
|
+
}"
|
|
98
|
+
>
|
|
99
|
+
获取div区域检测, 绿色为正确, 红色为错误(浏览器端的控制台会影响结果, 注意关闭)
|
|
100
|
+
</div>
|
|
101
|
+
<div :style="{ top: 120 }">
|
|
102
|
+
<div :style="{ left: 20 }">
|
|
103
|
+
<img ref="ref1" class="view-size" :src="`url(${img})`" />
|
|
104
|
+
<div
|
|
105
|
+
class="result"
|
|
106
|
+
:style="{
|
|
107
|
+
backgroundColor: color1,
|
|
108
|
+
}"
|
|
109
|
+
></div>
|
|
110
|
+
</div>
|
|
111
|
+
<div :style="{ left: 230 }">
|
|
112
|
+
<div ref="ref2" :style="{ width: 210, height: 210 }">
|
|
113
|
+
<img class="view-size" :src="`url(${img})`" />
|
|
114
|
+
</div>
|
|
115
|
+
<div
|
|
116
|
+
class="result"
|
|
117
|
+
:style="{
|
|
118
|
+
backgroundColor: color2,
|
|
119
|
+
}"
|
|
120
|
+
></div>
|
|
121
|
+
</div>
|
|
122
|
+
<div :style="{ left: 440 }">
|
|
123
|
+
<div ref="ref3">
|
|
124
|
+
<img class="view-size" :src="`url(${img})`" />
|
|
125
|
+
</div>
|
|
126
|
+
<div
|
|
127
|
+
class="result"
|
|
128
|
+
:style="{
|
|
129
|
+
backgroundColor: color3,
|
|
130
|
+
}"
|
|
131
|
+
></div>
|
|
132
|
+
</div>
|
|
133
|
+
<div :style="{ left: 650 }">
|
|
134
|
+
<div
|
|
135
|
+
ref="ref4"
|
|
136
|
+
:style="{
|
|
137
|
+
transform: 'scale3d(1.1, 1.1, 1)',
|
|
138
|
+
width: 200,
|
|
139
|
+
height: 200,
|
|
140
|
+
backgroundColor: '#007788',
|
|
141
|
+
}"
|
|
142
|
+
>
|
|
143
|
+
<img class="view-size" :src="`url(${img})`" />
|
|
144
|
+
</div>
|
|
145
|
+
<div
|
|
146
|
+
class="result"
|
|
147
|
+
:style="{
|
|
148
|
+
backgroundColor: color4,
|
|
149
|
+
}"
|
|
150
|
+
></div>
|
|
151
|
+
</div>
|
|
152
|
+
<div :style="{ left: 860 }">
|
|
153
|
+
<div ref="ref5" :style="{ transform: 'scale3d(1.1, 1.1, 1)' }">
|
|
154
|
+
<img class="view-size" :src="`url(${img})`" />
|
|
155
|
+
</div>
|
|
156
|
+
<div
|
|
157
|
+
class="result"
|
|
158
|
+
:style="{
|
|
159
|
+
backgroundColor: color5,
|
|
160
|
+
}"
|
|
161
|
+
></div>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
</template>
|
|
165
|
+
|
|
166
|
+
<style scoped>
|
|
167
|
+
.view-size {
|
|
168
|
+
width: 200;
|
|
169
|
+
height: 200;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.result {
|
|
173
|
+
top: 220;
|
|
174
|
+
height: 50;
|
|
175
|
+
width: 200;
|
|
176
|
+
}
|
|
177
|
+
</style>
|
package/GiftRain/App.vue
CHANGED
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
|
|
51
51
|
</div>
|
|
52
52
|
<!-- 音频 -->
|
|
53
|
-
<
|
|
53
|
+
<JsvAudio key="AudioBg" :src="resourceMap._AudioBgUrl" :loop="true" :onRef="onRef1" :onLoad="audioOnLoad" />
|
|
54
54
|
|
|
55
|
-
<
|
|
55
|
+
<JsvAudio v-if="!_DisableEffectSound" :onRef="onRef2" :loop="true" />
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
</div>
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
</template>
|
|
61
61
|
<script setup>
|
|
62
62
|
/* eslint-disable */
|
|
63
|
-
import { JsvFocusBlock, JsvActorMove, JsvActorMoveControl, jJsvRuntimeBridge, JsvPreload, buildPreloadInfo,
|
|
63
|
+
import { JsvFocusBlock, JsvActorMove, JsvActorMoveControl, jJsvRuntimeBridge, JsvPreload, buildPreloadInfo, JsvAudio } from "jsview";
|
|
64
64
|
import { shallowRef, onMounted, onBeforeUnmount, provide } from "vue";
|
|
65
65
|
import { useRouter } from "vue-router";
|
|
66
66
|
import Score from "./components/Score.vue";
|