@shijiu/jsview-vue-samples 2.3.151-test.0 → 3.0.0-test.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/ABImageAlt/App.vue +114 -0
- package/ABImageAlt/Item.vue +133 -0
- package/{MetroWidgetDemos/SkeletonDiagram/assets/imageList.json → ABImageAlt/assets/imageList.js} +9 -1
- package/ABImageAlt/data.js +17 -0
- package/AI_Check_Rules.txt +5 -0
- package/AnimPicture/App.vue +20 -10
- package/ApicSwitch/App.vue +90 -0
- package/ApicSwitch/TabItem.vue +65 -0
- package/ApicSwitch/WebpShow.vue +24 -0
- package/ApicSwitch/data.js +50 -0
- package/Basic/AI_skills_update.md +1 -0
- package/Basic/components/div/ColorFormatTest.vue +93 -0
- package/Basic/components/div/DivRadius.vue +97 -15
- package/Basic/components/div/DivTag3Group.vue +30 -0
- package/Basic/components/img/ImageType.vue +65 -0
- package/Basic/components/panel/Panel2.vue +13 -1
- package/Basic/components/text/TextAlign.vue +7 -1
- package/BlobLoadTest/App.vue +201 -0
- package/BreakLinesApi/App.vue +82 -0
- package/CanvasDrawChart/App.vue +11 -0
- package/CanvasDrawChart/Graph1.vue +104 -0
- package/CanvasDrawChart/Graph2.vue +115 -0
- package/CssPreprocessor/Scss/PanelData.js +1 -1
- package/CssPreprocessor/Scss/components/scss-group4/ScssMaps.vue +4 -3
- package/CssPreprocessor/Scss/components/scss-group5/ScssImporting.vue +2 -2
- package/DemoForOperator/Bounce/FreeMoveBuilder.js +1 -1
- package/DemoForOperator/Firework1/App.vue +12 -1
- package/DemoForOperator/Firework1/Fireworks.vue +18 -0
- package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +1 -0
- package/DemoForOperator/Focus/Alpha/Item.vue +1 -0
- package/DemoForOperator/Focus/Light/Item.vue +1 -0
- package/DemoForOperator/Focus/Normal/Item.vue +1 -0
- package/DemoForOperator/FrameShadow/FrameShadow.vue +1 -1
- package/DemoForOperator/Genie/App.vue +20 -6
- package/DemoForOperator/Genie/App2.vue +61 -0
- package/DemoForOperator/Genie/geniePakcer/GenieImage.vue +298 -0
- package/DemoForOperator/Genie/geniePakcer/GenieSlot.vue +292 -0
- package/DemoForOperator/Genie/geniePakcer/GenieTools.ts +463 -0
- package/DemoForOperator/Jigsaw/JigsawFull.vue +12 -7
- package/DemoForOperator/Jigsaw/JigsawSingle.vue +13 -7
- package/DemoForOperator/LongChatBox/App.vue +13 -13
- package/DemoForOperator/LongChatBox/Bubble.vue +78 -66
- package/DemoForOperator/LongChatBox/LongChat.vue +68 -36
- package/DemoForOperator/LongChatBox/testData.js +7 -44
- package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +1 -1
- package/DemoForOperator/routeList.js +8 -2
- package/DemoHomepage/App.vue +74 -1
- package/DemoHomepage/components/BodyFrame.vue +1 -0
- package/DemoHomepage/components/TabFrame.vue +1 -1
- package/DemoHomepage/router.js +723 -160
- package/DemoHomepage/views/Homepage.vue +60 -2
- package/DemoHomepage/watchTest.vue +50 -0
- package/FilterDemo/AnimatePic.vue +63 -17
- package/FilterDemo/App.vue +3 -3
- package/FlexCellDemo/AI_skills_update.md +4 -0
- package/FlexCellDemo/TestFrame1.vue +12 -2
- package/FlexCellDemo/TestFrame2.vue +10 -1
- package/FlexCellDemo/TestFrame3.vue +114 -59
- package/FpsLimit/App.vue +102 -0
- package/FreeMoveChildAttract/App.vue +18 -8
- package/FreeMoveLink/App.vue +49 -20
- package/Hover/App.vue +144 -0
- package/HttpRequestSSE/SSEReader.js +200 -0
- package/ImpactStop/App.vue +2 -2
- package/Input/FullKeyboard.vue +3 -3
- package/Input/InputPanel.vue +63 -3
- package/JsvLine/App.vue +53 -38
- package/LatexDemo/App.vue +3 -1
- package/LatexFormula/App.vue +196 -0
- package/LongImage/App.vue +1 -1
- package/LongImage/LongImageScroll.vue +100 -47
- package/LongImage/Scroll.vue +28 -9
- package/LongText/LongTextScroll.vue +1 -0
- package/Markdown/App.vue +36 -0
- package/Markdown/Bubble.vue +109 -0
- package/Markdown/LongChat.vue +206 -0
- package/Markdown/Markdown/Markdown.vue +156 -0
- package/Markdown/Markdown/index.ts +1 -0
- package/Markdown/Markdown/marked/LICENSE.md +45 -0
- package/Markdown/Markdown/marked/index.ts +2 -0
- package/Markdown/Markdown/marked/marked.d.ts +756 -0
- package/Markdown/Markdown/marked/marked.js +71 -0
- package/Markdown/Markdown/parser.ts +1365 -0
- package/Markdown/data.js +581 -0
- package/MetroWidgetDemos/AI_skills_update.md +2 -0
- package/MetroWidgetDemos/ListExpand/ChildItem.vue +130 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem.vue +375 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem1.vue +403 -0
- package/MetroWidgetDemos/ListExpand/assets/arrow-down.png +0 -0
- package/MetroWidgetDemos/ListExpand/assets/up-arrow.png +0 -0
- package/MetroWidgetDemos/ListExpand/components/WidgetListHandler.vue +150 -0
- package/MetroWidgetDemos/ListExpand/index.vue +88 -0
- package/MetroWidgetDemos/ListExpand/list.js +2421 -0
- package/MetroWidgetDemos/RefreshDemo/App.vue +14 -1
- package/MetroWidgetDemos/RenderAccelerate/App.vue +142 -0
- package/MetroWidgetDemos/RenderAccelerate/AppPage.vue +78 -0
- package/MetroWidgetDemos/RenderAccelerate/AppTab.vue +62 -0
- package/MetroWidgetDemos/RenderAccelerate/ContentItem.vue +409 -0
- package/MetroWidgetDemos/RenderAccelerate/Item.vue +67 -0
- package/MetroWidgetDemos/RenderAccelerate/TabItem.vue +100 -0
- package/MetroWidgetDemos/RenderAccelerate/ViewSwiper.vue +215 -0
- package/MetroWidgetDemos/RenderAccelerate/WidgetItem.vue +107 -0
- package/MetroWidgetDemos/SkeletonDiagram/App.vue +35 -8
- package/MetroWidgetDemos/SkeletonDiagram/Item.vue +11 -2
- package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.js +245 -0
- package/MetroWidgetDemos/SkeletonDiagram/data.js +3 -3
- package/MetroWidgetDemos/SpatialNav/App.vue +177 -0
- package/MetroWidgetDemos/SpatialNav/Buttons.vue +83 -0
- package/MetroWidgetDemos/SpatialNav/CustomFocus.vue +57 -0
- package/MetroWidgetDemos/{TripleWidget → SpatialNav}/Item.vue +1 -8
- package/MetroWidgetDemos/{TripleWidget/WidgetItem.vue → SpatialNav/SimpleFloor.vue} +14 -45
- package/MetroWidgetDemos/SpatialNav/StepMw.vue +113 -0
- package/MetroWidgetDemos/SpatialNav/TabContent/TabContent.vue +185 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/TripleSection.vue +69 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/WidgetItem.vue +100 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/List.vue +75 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/TvSection.vue +91 -0
- package/MetroWidgetDemos/basic2/App.vue +407 -0
- package/MetroWidgetDemos/basic2/Item.vue +68 -0
- package/MetroWidgetDemos/direction/App.vue +22 -0
- package/MetroWidgetDemos/gazeFocusDiff/App.vue +126 -0
- package/MetroWidgetDemos/gazeFocusDiff/Item.vue +87 -0
- package/MetroWidgetDemos/minimalUsage/App.vue +66 -0
- package/MetroWidgetDemos/minimalUsage/Item.vue +54 -0
- package/MetroWidgetDemos/ninePatchFocusPage/App.vue +22 -7
- package/MetroWidgetDemos/ninePatchFocusPage/Item.vue +7 -5
- package/MetroWidgetDemos/ninePatchFocusPage/focusConstants.js +2 -0
- package/MetroWidgetDemos/routeList.js +203 -12
- package/MetroWidgetDemos/slideSetting/App.vue +288 -99
- package/MetroWidgetDemos/zIndex/App.vue +117 -0
- package/MetroWidgetDemos/zIndex/Item.vue +61 -0
- package/NinePatchTester/App.vue +24 -31
- package/PreDecode/App.vue +140 -0
- package/ReactiveTest/App.vue +115 -0
- package/ReactiveTest/Item.vue +92 -0
- package/ReactiveTest/assets/imageList.js +245 -0
- package/ReactiveTest/component/TestSmartDiv.vue +50 -0
- package/ReactiveTest/component/TestSmartDivSrcList.vue +74 -0
- package/ReactiveTest/component/TestSmartImage.vue +46 -0
- package/ReactiveTest/component/TestSmartImageSrcList.vue +90 -0
- package/ReactiveTest/component/TestSmartImageStyle.vue +41 -0
- package/ReactiveTest/data.js +49 -0
- package/ScreenToBlob/App.vue +250 -0
- package/SecTorTest/App.vue +9 -3
- package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +3 -3
- package/SyncDecode/App.vue +137 -0
- package/TextSizeLimit/App.vue +211 -0
- package/TransitPage/App.vue +2 -0
- package/assets/logo.png +0 -0
- package/package.json +5 -5
- package/DemoForOperator/Genie/geniePakcer/Genie.vue +0 -741
- package/DemoForOperator/LongChatBox/TextManager.ts +0 -147
- package/DemoForOperator/LongChatBox/VirtualList.vue +0 -298
- package/DemoForOperator/LongChatBox/utile.js +0 -331
- package/DivMetroPerformance/App.vue +0 -157
- package/DivMetroPerformance/Item.vue +0 -58
- package/DivMetroPerformance/assets/bg.jpg +0 -0
- package/DivMetroPerformance/assets/coupon_content.png +0 -0
- package/DivMetroPerformance/assets/coupon_left.png +0 -0
- package/DivMetroPerformance/assets/coupon_mid.png +0 -0
- package/DivMetroPerformance/assets/coupon_right.png +0 -0
- package/DivMetroPerformance/assets/focus_border.png +0 -0
- package/DivMetroPerformance/assets/holder_logo.png +0 -0
- package/DivMetroPerformance/assets/jrbm.png +0 -0
- package/DivMetroPerformance/assets/line_left.png +0 -0
- package/DivMetroPerformance/assets/line_mid.png +0 -0
- package/DivMetroPerformance/assets/line_right.png +0 -0
- package/DivMetroPerformance/assets/loading.png +0 -0
- package/DivMetroPerformance/assets/logo.png +0 -0
- package/DivMetroPerformance/assets/mcjx.png +0 -0
- package/DivMetroPerformance/assets/tao.png +0 -0
- package/DivMetroPerformance/assets/tmall.png +0 -0
- package/DivMetroPerformance/border.png +0 -0
- package/DivMetroPerformance/components/ContentItem.vue +0 -384
- package/DivMetroPerformance/components/MyTab.vue +0 -129
- package/DivMetroPerformance/data.js +0 -124
- package/DivMetroPerformance/utils/GridItem.vue +0 -28
- package/DivMetroPerformance/utils/GridPlate.vue +0 -85
- package/MediaDemo/App.vue +0 -127
- package/MediaDemo/assets/audio-poster.png +0 -0
- package/MediaDemo/components/Button.vue +0 -69
- package/MediaDemo/components/Controllor.vue +0 -286
- package/MediaDemo/components/StatusBar.vue +0 -100
- package/MediaDemo/components/frames/AudioFrame.vue +0 -39
- package/MediaDemo/components/frames/AudioPoster.vue +0 -48
- package/MediaDemo/components/frames/MediaFrame.vue +0 -153
- package/MediaDemo/components/frames/VideoFrame.vue +0 -39
- package/MetroWidgetDemos/TripleWidget/App.vue +0 -87
- package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +0 -99
- package/Parkour/App.vue +0 -13
- package/Parkour/Common/Context.js +0 -21
- package/Parkour/Common/MatchmanInfo.js +0 -62
- package/Parkour/Common/Random.js +0 -61
- package/Parkour/Common/Sound.js +0 -50
- package/Parkour/appConfig/HOW_TO_CONFIG.md +0 -20
- package/Parkour/appConfig/app.config.mjs +0 -5
- package/Parkour/appConfig/app_sign_private_key_sample.crt +0 -28
- package/Parkour/appConfig/app_sign_public_key_sample.pem +0 -9
- package/Parkour/appConfig/jsview.config.mjs +0 -39
- package/Parkour/assets/Bgimages/bg1.png +0 -0
- package/Parkour/assets/Bgimages/bg2.png +0 -0
- package/Parkour/assets/Bgimages/bg3.png +0 -0
- package/Parkour/assets/Bgimages/bg4.png +0 -0
- package/Parkour/assets/Bgimages/bg5.png +0 -0
- package/Parkour/assets/audio/jump.mp3 +0 -0
- package/Parkour/assets/audio/lose.mp3 +0 -0
- package/Parkour/assets/role_skin1/fail.json +0 -44
- package/Parkour/assets/role_skin1/fail.png +0 -0
- package/Parkour/assets/role_skin1/jump_down.json +0 -20
- package/Parkour/assets/role_skin1/jump_down.png +0 -0
- package/Parkour/assets/role_skin1/jump_up.json +0 -44
- package/Parkour/assets/role_skin1/jump_up.png +0 -0
- package/Parkour/assets/role_skin1/roll.json +0 -44
- package/Parkour/assets/role_skin1/roll.png +0 -0
- package/Parkour/assets/role_skin1/run.json +0 -52
- package/Parkour/assets/role_skin1/run.png +0 -0
- package/Parkour/components/Backdrop.vue +0 -61
- package/Parkour/components/GameSence.vue +0 -602
- package/Parkour/components/Matchman.vue +0 -85
- package/ThrowMoveDemo/AccelerateDemo.vue +0 -85
- package/ThrowMoveDemo/App.vue +0 -104
- package/ThrowMoveDemo/LRParabolicDemo.vue +0 -101
- package/ThrowMoveDemo/TargetDemo.vue +0 -87
- package/ThrowMoveDemo/UDParabolicDemo.vue +0 -92
- /package/{AnimPicture/assets → assets}/animated_webp.webp +0 -0
- /package/{AnimPicture/assets → assets}/ball_3.webp +0 -0
- /package/{AnimPicture/assets → assets}/girl_run.gif +0 -0
- /package/{AnimPicture/assets → assets}/quan.webp +0 -0
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
import genieLeft from "./genieLeft.glsl?raw";
|
|
2
|
+
import genieRight from "./genieRight.glsl?raw";
|
|
3
|
+
import genieBottom from "./genieBottom.glsl?raw";
|
|
4
|
+
import genieTop from "./genieTop.glsl?raw";
|
|
5
|
+
|
|
6
|
+
export default function buildGenieAnimation(position: {x: number, y: number}, width: number, height: number, direction: string) {
|
|
7
|
+
let vDistanceX:number = 0;
|
|
8
|
+
let vDistanceY:number = 0;
|
|
9
|
+
let vRelease:string = "";
|
|
10
|
+
let vContract:string = "";
|
|
11
|
+
let vShaderMode:string = "";
|
|
12
|
+
let vRange1:number = 0;
|
|
13
|
+
let vRange2:number = 0;
|
|
14
|
+
let vTransformScale:number = 1;
|
|
15
|
+
let vTransformDirection:string = "";
|
|
16
|
+
const keyFrameRandom: number = Math.floor(Math.random() * 100000) + 1;
|
|
17
|
+
const KeyFrameReleaseName = `Genie-release-${keyFrameRandom}`;
|
|
18
|
+
const KeyFrameContractName = `Genie-contract-${keyFrameRandom}`;
|
|
19
|
+
|
|
20
|
+
//在组件外部的八种情况
|
|
21
|
+
//左上方
|
|
22
|
+
if (position.x < 0 && position.y < 0) {
|
|
23
|
+
vDistanceX = position.x;
|
|
24
|
+
vDistanceY = position.y;
|
|
25
|
+
//释放的动画
|
|
26
|
+
vRelease = `@keyframes ${KeyFrameReleaseName} {
|
|
27
|
+
0% {
|
|
28
|
+
transform: translate3d(${vDistanceX},${vDistanceY}, 0);
|
|
29
|
+
}
|
|
30
|
+
70%{
|
|
31
|
+
transform: translate3d(${vDistanceX},${vDistanceY}, 0);
|
|
32
|
+
}
|
|
33
|
+
80% {
|
|
34
|
+
transform: translate3d(0, 0, 0);
|
|
35
|
+
}
|
|
36
|
+
100% {
|
|
37
|
+
transform: translate3d(0, 0, 0);
|
|
38
|
+
}
|
|
39
|
+
}`;
|
|
40
|
+
vContract = `@keyframes ${KeyFrameContractName} {
|
|
41
|
+
0% {
|
|
42
|
+
transform: translate3d(0, 0, 0);
|
|
43
|
+
}
|
|
44
|
+
30% {
|
|
45
|
+
transform: translate3d(0, 0, 0);
|
|
46
|
+
}
|
|
47
|
+
40%{
|
|
48
|
+
transform: translate3d(${vDistanceX}, ${vDistanceY}, 0);
|
|
49
|
+
}
|
|
50
|
+
100% {
|
|
51
|
+
transform: translate3d(${vDistanceX}, ${vDistanceY}, 0);
|
|
52
|
+
}
|
|
53
|
+
}`;
|
|
54
|
+
if (direction == "horizontal") {
|
|
55
|
+
vShaderMode = genieLeft;
|
|
56
|
+
vRange1 = 1 - 1 / height;
|
|
57
|
+
vRange2 = 1 - 2 / height;
|
|
58
|
+
} else if (direction == "vertical") {
|
|
59
|
+
vShaderMode = genieTop;
|
|
60
|
+
vRange1 = 1 / width;
|
|
61
|
+
vRange2 = 2 / width;
|
|
62
|
+
}
|
|
63
|
+
} else if (position.x < width && position.y < 0) {
|
|
64
|
+
//正上方
|
|
65
|
+
vDistanceY = position.y;
|
|
66
|
+
//释放的动画
|
|
67
|
+
vRelease = `@keyframes ${KeyFrameReleaseName} {
|
|
68
|
+
0% {
|
|
69
|
+
transform: translate3d(0,${vDistanceY}, 0);
|
|
70
|
+
}
|
|
71
|
+
70% {
|
|
72
|
+
transform: translate3d(0,${vDistanceY}, 0);
|
|
73
|
+
}
|
|
74
|
+
80%{
|
|
75
|
+
transform: translate3d(0, 0, 0);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
100% {
|
|
79
|
+
transform: translate3d(0, 0, 0);
|
|
80
|
+
}
|
|
81
|
+
}`;
|
|
82
|
+
vContract = `@keyframes ${KeyFrameContractName} {
|
|
83
|
+
0% {
|
|
84
|
+
transform: translate3d(0, 0, 0);
|
|
85
|
+
}
|
|
86
|
+
30% {
|
|
87
|
+
transform: translate3d($0, 0, 0);
|
|
88
|
+
}
|
|
89
|
+
40%{
|
|
90
|
+
transform: translate3d($0, ${vDistanceY}, 0);
|
|
91
|
+
}
|
|
92
|
+
100% {
|
|
93
|
+
transform: translate3d(0, ${vDistanceY}, 0);
|
|
94
|
+
}
|
|
95
|
+
}`;
|
|
96
|
+
|
|
97
|
+
vShaderMode = genieTop;
|
|
98
|
+
|
|
99
|
+
vRange1 = (position.x + 1) / width;
|
|
100
|
+
vRange2 = position.x / width;
|
|
101
|
+
} else if (position.x > width && position.y < 0) {
|
|
102
|
+
//右上角
|
|
103
|
+
if (direction == "horizontal") {
|
|
104
|
+
vDistanceX = position.x - width;
|
|
105
|
+
vDistanceY = position.y;
|
|
106
|
+
vShaderMode = genieRight;
|
|
107
|
+
vRange1 = 1 - 1 / height;
|
|
108
|
+
vRange2 = 1 - 2 / height;
|
|
109
|
+
} else if (direction == "vertical") {
|
|
110
|
+
vDistanceX = position.x - width;
|
|
111
|
+
vDistanceY = position.y;
|
|
112
|
+
vShaderMode = genieTop;
|
|
113
|
+
vRange2 = 1 - 2 / width;
|
|
114
|
+
vRange1 = 1 - 1 / width;
|
|
115
|
+
}
|
|
116
|
+
//释放的动画
|
|
117
|
+
vRelease = `@keyframes ${KeyFrameReleaseName} {
|
|
118
|
+
0% {
|
|
119
|
+
transform: translate3d(${vDistanceX},${vDistanceY}, 0);
|
|
120
|
+
}
|
|
121
|
+
70% {
|
|
122
|
+
transform: translate3d(${vDistanceX},${vDistanceY}, 0);
|
|
123
|
+
}
|
|
124
|
+
80%{
|
|
125
|
+
transform: translate3d(0, 0, 0);
|
|
126
|
+
}
|
|
127
|
+
100% {
|
|
128
|
+
transform: translate3d(0, 0, 0);
|
|
129
|
+
}
|
|
130
|
+
}`;
|
|
131
|
+
vContract = `@keyframes ${KeyFrameContractName} {
|
|
132
|
+
0% {
|
|
133
|
+
transform: translate3d(0, 0, 0);
|
|
134
|
+
}
|
|
135
|
+
30% {
|
|
136
|
+
transform: translate3d(0, 0, 0);
|
|
137
|
+
}
|
|
138
|
+
40%{
|
|
139
|
+
transform: translate3d(${vDistanceX}, ${vDistanceY}, 0);
|
|
140
|
+
}
|
|
141
|
+
100% {
|
|
142
|
+
transform: translate3d(${vDistanceX}, ${vDistanceY}, 0);
|
|
143
|
+
}
|
|
144
|
+
}`;
|
|
145
|
+
} else if (
|
|
146
|
+
position.x < 0 &&
|
|
147
|
+
position.y > 0 &&
|
|
148
|
+
position.y <= height
|
|
149
|
+
) {
|
|
150
|
+
//正左边
|
|
151
|
+
vDistanceX = position.x;
|
|
152
|
+
//释放的动画
|
|
153
|
+
vRelease = `@keyframes ${KeyFrameReleaseName} {
|
|
154
|
+
0% {
|
|
155
|
+
transform: translate3d(${vDistanceX},0, 0);
|
|
156
|
+
}
|
|
157
|
+
70% {
|
|
158
|
+
transform: translate3d(${vDistanceX},0, 0);
|
|
159
|
+
}
|
|
160
|
+
80%{
|
|
161
|
+
transform: translate3d(0, 0, 0);
|
|
162
|
+
}
|
|
163
|
+
100% {
|
|
164
|
+
transform: translate3d(0, 0, 0);
|
|
165
|
+
}
|
|
166
|
+
}`;
|
|
167
|
+
vContract = `@keyframes ${KeyFrameContractName} {
|
|
168
|
+
0% {
|
|
169
|
+
transform: translate3d(0, 0, 0);
|
|
170
|
+
}
|
|
171
|
+
30% {
|
|
172
|
+
transform: translate3d(0, 0, 0);
|
|
173
|
+
}
|
|
174
|
+
40%{
|
|
175
|
+
transform: translate3d(${vDistanceX},0, 0);
|
|
176
|
+
}
|
|
177
|
+
100% {
|
|
178
|
+
transform: translate3d(${vDistanceX},0, 0);
|
|
179
|
+
}
|
|
180
|
+
}`;
|
|
181
|
+
|
|
182
|
+
vShaderMode = genieLeft;
|
|
183
|
+
|
|
184
|
+
vRange2 = 1 - position.y / height;
|
|
185
|
+
vRange1 = 1 - (position.y + 1) / height;
|
|
186
|
+
} else if (
|
|
187
|
+
position.x > width &&
|
|
188
|
+
position.y > 0 &&
|
|
189
|
+
position.y <= height
|
|
190
|
+
) {
|
|
191
|
+
//正右边
|
|
192
|
+
vDistanceX = position.x - width;
|
|
193
|
+
vDistanceY = position.y;
|
|
194
|
+
vShaderMode = genieRight;
|
|
195
|
+
vRange1 = 1 - position.y / height;
|
|
196
|
+
vRange2 = 1 - (1 + position.y) / height;
|
|
197
|
+
//释放的动画
|
|
198
|
+
vRelease = `@keyframes ${KeyFrameReleaseName} {
|
|
199
|
+
0% {
|
|
200
|
+
transform: translate3d(${vDistanceX},0, 0);
|
|
201
|
+
}
|
|
202
|
+
70% {
|
|
203
|
+
transform: translate3d(${vDistanceX},0, 0);
|
|
204
|
+
}
|
|
205
|
+
80%{
|
|
206
|
+
transform: translate3d(0, 0, 0);
|
|
207
|
+
}
|
|
208
|
+
100% {
|
|
209
|
+
transform: translate3d(0, 0, 0);
|
|
210
|
+
}
|
|
211
|
+
}`;
|
|
212
|
+
vContract = `@keyframes ${KeyFrameContractName} {
|
|
213
|
+
0% {
|
|
214
|
+
transform: translate3d(0, 0, 0);
|
|
215
|
+
}
|
|
216
|
+
30% {
|
|
217
|
+
transform: translate3d(0, 0, 0);
|
|
218
|
+
}
|
|
219
|
+
40%{
|
|
220
|
+
transform: translate3d(${vDistanceX},0, 0);
|
|
221
|
+
}
|
|
222
|
+
100% {
|
|
223
|
+
transform: translate3d(${vDistanceX},0, 0);
|
|
224
|
+
}
|
|
225
|
+
}`;
|
|
226
|
+
} else if (position.x < 0 && position.y > height) {
|
|
227
|
+
//左下方
|
|
228
|
+
if (direction == "horizontal") {
|
|
229
|
+
vDistanceX = position.x;
|
|
230
|
+
vDistanceY = position.y - height;
|
|
231
|
+
vShaderMode = genieLeft;
|
|
232
|
+
vRange2 = 1 / height;
|
|
233
|
+
vRange1 = (1 + 1) / height;
|
|
234
|
+
} else if (direction == "vertical") {
|
|
235
|
+
vDistanceX = position.x;
|
|
236
|
+
vDistanceY = position.y - height;
|
|
237
|
+
vShaderMode = genieBottom;
|
|
238
|
+
vRange1 = 1 / width;
|
|
239
|
+
vRange2 = (1 + 1) / width;
|
|
240
|
+
}
|
|
241
|
+
//释放的动画
|
|
242
|
+
vRelease = `@keyframes ${KeyFrameReleaseName} {
|
|
243
|
+
0% {
|
|
244
|
+
transform: translate3d(${vDistanceX},${vDistanceY}, 0);
|
|
245
|
+
}
|
|
246
|
+
70% {
|
|
247
|
+
transform: translate3d(${vDistanceX},${vDistanceY}, 0);
|
|
248
|
+
}
|
|
249
|
+
80%{
|
|
250
|
+
transform: translate3d(0, 0, 0);
|
|
251
|
+
}
|
|
252
|
+
100% {
|
|
253
|
+
transform: translate3d(0, 0, 0);
|
|
254
|
+
}
|
|
255
|
+
}`;
|
|
256
|
+
vContract = `@keyframes ${KeyFrameContractName} {
|
|
257
|
+
0% {
|
|
258
|
+
transform: translate3d(0, 0, 0);
|
|
259
|
+
}
|
|
260
|
+
30% {
|
|
261
|
+
transform: translate3d(0, 0, 0);
|
|
262
|
+
}
|
|
263
|
+
40%{
|
|
264
|
+
transform: translate3d(${vDistanceX}, ${vDistanceY}, 0);
|
|
265
|
+
}
|
|
266
|
+
100% {
|
|
267
|
+
transform: translate3d(${vDistanceX}, ${vDistanceY}, 0);
|
|
268
|
+
}
|
|
269
|
+
}`;
|
|
270
|
+
} else if (
|
|
271
|
+
position.x > 0 &&
|
|
272
|
+
position.x < width &&
|
|
273
|
+
position.y > height
|
|
274
|
+
) {
|
|
275
|
+
//正下方
|
|
276
|
+
vDistanceY = position.y - height;
|
|
277
|
+
//释放的动画
|
|
278
|
+
vRelease = `@keyframes ${KeyFrameReleaseName} {
|
|
279
|
+
0% {
|
|
280
|
+
transform: translate3d(0,${vDistanceY}, 0);
|
|
281
|
+
}
|
|
282
|
+
70% {
|
|
283
|
+
transform: translate3d(0,${vDistanceY}, 0);
|
|
284
|
+
}
|
|
285
|
+
80%{
|
|
286
|
+
transform: translate3d(0, 0, 0);
|
|
287
|
+
}
|
|
288
|
+
100% {
|
|
289
|
+
transform: translate3d(0, 0, 0);
|
|
290
|
+
}
|
|
291
|
+
}`;
|
|
292
|
+
vContract = `@keyframes ${KeyFrameContractName} {
|
|
293
|
+
0% {
|
|
294
|
+
transform: translate3d(0, 0, 0);
|
|
295
|
+
}
|
|
296
|
+
30% {
|
|
297
|
+
transform: translate3d(0, 0, 0);
|
|
298
|
+
}
|
|
299
|
+
40%{
|
|
300
|
+
transform: translate3d($0, ${vDistanceY}, 0);
|
|
301
|
+
}
|
|
302
|
+
100% {
|
|
303
|
+
transform: translate3d(0, ${vDistanceY}, 0);
|
|
304
|
+
}
|
|
305
|
+
}`;
|
|
306
|
+
|
|
307
|
+
vShaderMode = genieBottom;
|
|
308
|
+
|
|
309
|
+
vRange1 = position.x / width;
|
|
310
|
+
vRange2 = (position.x - 1) / width;
|
|
311
|
+
} else if (position.x > width && position.y > height) {
|
|
312
|
+
//右下方
|
|
313
|
+
if (direction == "horizontal") {
|
|
314
|
+
vDistanceX = position.x - width;
|
|
315
|
+
vDistanceY = position.y - height;
|
|
316
|
+
vShaderMode = genieRight;
|
|
317
|
+
vRange2 = 1 / height;
|
|
318
|
+
vRange1 = (1 + 1) / height;
|
|
319
|
+
} else if (direction == "vertical") {
|
|
320
|
+
vDistanceX = position.x - width;
|
|
321
|
+
vDistanceY = position.y - height;
|
|
322
|
+
vShaderMode = genieBottom;
|
|
323
|
+
vRange2 = 1 - 2 / width;
|
|
324
|
+
vRange1 = 1 - 1 / width;
|
|
325
|
+
}
|
|
326
|
+
//释放的动画
|
|
327
|
+
vRelease = `@keyframes ${KeyFrameReleaseName} {
|
|
328
|
+
0% {
|
|
329
|
+
transform: translate3d(${vDistanceX},${vDistanceY}, 0);
|
|
330
|
+
}
|
|
331
|
+
70% {
|
|
332
|
+
transform: translate3d(${vDistanceX},${vDistanceY}, 0);
|
|
333
|
+
}
|
|
334
|
+
80%{
|
|
335
|
+
transform: translate3d(0, 0, 0);
|
|
336
|
+
}
|
|
337
|
+
100% {
|
|
338
|
+
transform: translate3d(0, 0, 0);
|
|
339
|
+
}
|
|
340
|
+
}`;
|
|
341
|
+
vContract = `@keyframes ${KeyFrameContractName} {
|
|
342
|
+
0% {
|
|
343
|
+
transform: translate3d(0, 0, 0);
|
|
344
|
+
}
|
|
345
|
+
30% {
|
|
346
|
+
transform: translate3d(0, 0, 0);
|
|
347
|
+
}
|
|
348
|
+
40%{
|
|
349
|
+
transform: translate3d(${vDistanceX}, ${vDistanceY}, 0);
|
|
350
|
+
}
|
|
351
|
+
100% {
|
|
352
|
+
transform: translate3d(${vDistanceX}, ${vDistanceY}, 0);
|
|
353
|
+
}
|
|
354
|
+
}`;
|
|
355
|
+
} else {
|
|
356
|
+
//在组件内
|
|
357
|
+
//根据传入进来的方向和中心点位置确定缩放动画
|
|
358
|
+
if (direction == "vertical") {
|
|
359
|
+
if (position.y < height / 2) {
|
|
360
|
+
vTransformDirection = "bottom center";
|
|
361
|
+
vShaderMode = genieTop;
|
|
362
|
+
vTransformScale = 1 - position.y / height;
|
|
363
|
+
} else {
|
|
364
|
+
vTransformDirection = "top center";
|
|
365
|
+
vShaderMode = genieBottom;
|
|
366
|
+
vTransformScale = position.y / height;
|
|
367
|
+
}
|
|
368
|
+
vRange1 = position.x / width;
|
|
369
|
+
vRange2 = (position.x - 1) / width;
|
|
370
|
+
} else if (direction == "horizontal") {
|
|
371
|
+
//解析坐标位置是否要进行移动动画
|
|
372
|
+
if (position.x < width / 2) {
|
|
373
|
+
vTransformDirection = "center right";
|
|
374
|
+
vShaderMode = genieLeft;
|
|
375
|
+
vTransformScale = 1 - position.x / width;
|
|
376
|
+
} else {
|
|
377
|
+
vTransformDirection = "center left";
|
|
378
|
+
vShaderMode = genieRight;
|
|
379
|
+
vTransformScale = position.x / width;
|
|
380
|
+
}
|
|
381
|
+
vRange1 = 1 - position.y / height;
|
|
382
|
+
vRange2 = 1 - (position.y + 1) / height;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
if (direction == "horizontal") {
|
|
386
|
+
// //收的动画
|
|
387
|
+
vContract = `@keyframes ${KeyFrameContractName} {
|
|
388
|
+
0% {
|
|
389
|
+
transform: scale3d(1, 1, 1);
|
|
390
|
+
transform-origin:${vTransformDirection};
|
|
391
|
+
}
|
|
392
|
+
30% {
|
|
393
|
+
transform: scale3d(${vTransformScale}, 1, 1);
|
|
394
|
+
transform-origin:${vTransformDirection};
|
|
395
|
+
}
|
|
396
|
+
100% {
|
|
397
|
+
transform: scale3d(${vTransformScale}, 1, 1);
|
|
398
|
+
transform-origin:${vTransformDirection};
|
|
399
|
+
}
|
|
400
|
+
}`;
|
|
401
|
+
// //释放的动画
|
|
402
|
+
vRelease = `@keyframes ${KeyFrameReleaseName} {
|
|
403
|
+
0% {
|
|
404
|
+
transform: scale3d(${vTransformScale}, 1, 1);
|
|
405
|
+
transform-origin:${vTransformDirection};
|
|
406
|
+
}
|
|
407
|
+
70% {
|
|
408
|
+
transform: scale3d(${vTransformScale}, 1, 1);
|
|
409
|
+
transform-origin:${vTransformDirection};
|
|
410
|
+
}
|
|
411
|
+
100% {
|
|
412
|
+
transform: scale3d(1, 1, 1);
|
|
413
|
+
transform-origin:${vTransformDirection};
|
|
414
|
+
}
|
|
415
|
+
}`;
|
|
416
|
+
} else if (direction == "vertical") {
|
|
417
|
+
//收的动画
|
|
418
|
+
vContract = `@keyframes ${KeyFrameContractName} {
|
|
419
|
+
0% {
|
|
420
|
+
transform: scale3d(1, 1, 1);
|
|
421
|
+
transform-origin:${vTransformDirection};
|
|
422
|
+
}
|
|
423
|
+
30% {
|
|
424
|
+
transform: scale3d(1,${vTransformScale}, 1);
|
|
425
|
+
transform-origin:${vTransformDirection};
|
|
426
|
+
}
|
|
427
|
+
100% {
|
|
428
|
+
transform: scale3d(1, ${vTransformScale}, 1);
|
|
429
|
+
transform-origin:${vTransformDirection};
|
|
430
|
+
}
|
|
431
|
+
}`;
|
|
432
|
+
//释放的动画
|
|
433
|
+
vRelease = `@keyframes ${KeyFrameReleaseName} {
|
|
434
|
+
0% {
|
|
435
|
+
transform: scale3d(1,${vTransformScale}, 1);
|
|
436
|
+
transform-origin:${vTransformDirection};
|
|
437
|
+
}
|
|
438
|
+
70% {
|
|
439
|
+
transform: scale3d(1,${vTransformScale}, 1);
|
|
440
|
+
transform-origin:${vTransformDirection};
|
|
441
|
+
}
|
|
442
|
+
100% {
|
|
443
|
+
transform: scale3d(1, 1, 1);
|
|
444
|
+
transform-origin:${vTransformDirection};
|
|
445
|
+
}
|
|
446
|
+
}`;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
const cLocalizationShader = vShaderMode
|
|
451
|
+
.replace(/\$\{RANGE_1\}/g, vRange1.toString())
|
|
452
|
+
.replace(/\$\{RANGE_2\}/g, vRange2.toString());
|
|
453
|
+
|
|
454
|
+
return {
|
|
455
|
+
vRelease,
|
|
456
|
+
vContract,
|
|
457
|
+
vShader: cLocalizationShader,
|
|
458
|
+
vTransformDirection,
|
|
459
|
+
KeyFrameReleaseName,
|
|
460
|
+
KeyFrameContractName,
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
|
|
@@ -115,9 +115,12 @@ function prepareSrc() {
|
|
|
115
115
|
preloadList.push(buildPreloadInfo(props.strokeSrc));
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
// samples中未安装axios, 实际项目可以用axios改写
|
|
119
|
+
const xhr = new XMLHttpRequest();
|
|
120
|
+
xhr.open('GET', props.configUrl);
|
|
121
|
+
xhr.onload = function() {
|
|
122
|
+
if (xhr.status === 200) {
|
|
123
|
+
const data = JSON.parse(xhr.responseText);
|
|
121
124
|
const lastSlashIndex = props.configUrl.lastIndexOf("/");
|
|
122
125
|
const baseUrl = props.configUrl.substring(0, lastSlashIndex + 1);
|
|
123
126
|
for (let i = 0; i < data.pieces.length; i++) {
|
|
@@ -132,10 +135,12 @@ function prepareSrc() {
|
|
|
132
135
|
});
|
|
133
136
|
}
|
|
134
137
|
showPreload.value = true;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
xhr.onerror = function() {
|
|
141
|
+
console.log("fetch mask config failed", xhr.statusText);
|
|
142
|
+
};
|
|
143
|
+
xhr.send();
|
|
139
144
|
}
|
|
140
145
|
|
|
141
146
|
prepareSrc();
|
|
@@ -90,9 +90,13 @@ function prepareSrc() {
|
|
|
90
90
|
if (props.strokeSrc) {
|
|
91
91
|
preloadList.push(buildPreloadInfo(props.strokeSrc));
|
|
92
92
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
|
|
94
|
+
// samples中未安装axios, 实际项目可以用axios改写
|
|
95
|
+
const xhr = new XMLHttpRequest();
|
|
96
|
+
xhr.open('GET', props.configUrl);
|
|
97
|
+
xhr.onload = function() {
|
|
98
|
+
if (xhr.status === 200) {
|
|
99
|
+
const data = JSON.parse(xhr.responseText);
|
|
96
100
|
const lastSlashIndex = props.configUrl.lastIndexOf("/");
|
|
97
101
|
const baseUrl = props.configUrl.substring(0, lastSlashIndex + 1);
|
|
98
102
|
if (data.pieces[props.pieceIndex]) {
|
|
@@ -109,10 +113,12 @@ function prepareSrc() {
|
|
|
109
113
|
} else {
|
|
110
114
|
console.error("pieceIndex out of range", data, props.pieceIndex);
|
|
111
115
|
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
xhr.onerror = function() {
|
|
119
|
+
console.log("fetch mask config failed", xhr.statusText);
|
|
120
|
+
};
|
|
121
|
+
xhr.send();
|
|
116
122
|
}
|
|
117
123
|
prepareSrc();
|
|
118
124
|
</script>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref } from "vue";
|
|
3
2
|
import LongChat from "./LongChat.vue";
|
|
4
3
|
</script>
|
|
5
4
|
|
|
@@ -11,9 +10,21 @@ import LongChat from "./LongChat.vue";
|
|
|
11
10
|
backgroundColor: '#666',
|
|
12
11
|
}"
|
|
13
12
|
>
|
|
13
|
+
<div :style="{
|
|
14
|
+
width: 1280,
|
|
15
|
+
height: 30,
|
|
16
|
+
left: 50,
|
|
17
|
+
top: 10,
|
|
18
|
+
backgroundColor: '#666',
|
|
19
|
+
fontSize: 20,
|
|
20
|
+
color: '#fff',
|
|
21
|
+
}">
|
|
22
|
+
按ok键添加对话框,按上下键滚动
|
|
23
|
+
</div>
|
|
14
24
|
<div
|
|
15
25
|
:style="{
|
|
16
|
-
top:
|
|
26
|
+
top: 70,
|
|
27
|
+
left: 50,
|
|
17
28
|
width: 1280,
|
|
18
29
|
height: 600,
|
|
19
30
|
overflow: 'hidden',
|
|
@@ -21,16 +32,5 @@ import LongChat from "./LongChat.vue";
|
|
|
21
32
|
>
|
|
22
33
|
<LongChat />
|
|
23
34
|
</div>
|
|
24
|
-
<div
|
|
25
|
-
:style="{
|
|
26
|
-
width: 1280,
|
|
27
|
-
height: 50,
|
|
28
|
-
backgroundColor: '#666',
|
|
29
|
-
fontSize: 30,
|
|
30
|
-
color: '#fff',
|
|
31
|
-
}"
|
|
32
|
-
>
|
|
33
|
-
按ok键开始生成, 按上下键滚动
|
|
34
|
-
</div>
|
|
35
35
|
</div>
|
|
36
36
|
</template>
|