Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
icbcRPG
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wildfirecode13
icbcRPG
Commits
8598bf3c
Commit
8598bf3c
authored
Dec 17, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
a4f579d2
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
58 additions
and
8 deletions
+58
-8
dsl.json
dsl.json
+1
-1
.DS_Store
project/.DS_Store
+0
-0
package-lock.json
project/package-lock.json
+5
-0
package.json
project/package.json
+5
-4
readme.md
project/readme.md
+1
-0
sparkrc.js
project/sparkrc.js
+1
-1
main.jsx
project/src/pages/main/main.jsx
+8
-0
main.less
project/src/pages/main/main.less
+2
-2
svga.js
project/src/svga.js
+35
-0
No files found.
dsl.json
View file @
8598bf3c
This diff is collapsed.
Click to expand it.
project/.DS_Store
0 → 100644
View file @
8598bf3c
File added
project/package-lock.json
View file @
8598bf3c
...
@@ -763,6 +763,11 @@
...
@@ -763,6 +763,11 @@
"has-flag"
:
"^3.0.0"
"has-flag"
:
"^3.0.0"
}
}
},
},
"svgaplayerweb"
:
{
"version"
:
"2.3.1"
,
"resolved"
:
"http://npm.dui88.com:80/svgaplayerweb/-/svgaplayerweb-2.3.1.tgz"
,
"integrity"
:
"sha1-Au3BavFiCvn1dKU254E/wlE55Hs="
},
"symbol-observable"
:
{
"symbol-observable"
:
{
"version"
:
"1.2.0"
,
"version"
:
"1.2.0"
,
"resolved"
:
"http://npm.dui88.com:80/symbol-observable/-/symbol-observable-1.2.0.tgz"
,
"resolved"
:
"http://npm.dui88.com:80/symbol-observable/-/symbol-observable-1.2.0.tgz"
,
...
...
project/package.json
View file @
8598bf3c
...
@@ -8,8 +8,11 @@
...
@@ -8,8 +8,11 @@
"tb"
:
"spark build --type taobao"
"tb"
:
"spark build --type taobao"
},
},
"dependencies"
:
{
"dependencies"
:
{
"@spark/api-base"
:
"^1.0.11"
,
"@spark/projectx"
:
"^1.0.3"
,
"axios"
:
"^0.19.2"
,
"axios"
:
"^0.19.2"
,
"css-loader"
:
"^3.6.0"
,
"css-loader"
:
"^3.6.0"
,
"duiba-utils"
:
"^1.0.2"
,
"fyge-tbmini"
:
"^1.3.1"
,
"fyge-tbmini"
:
"^1.3.1"
,
"postcss-loader"
:
"^3.0.0"
,
"postcss-loader"
:
"^3.0.0"
,
"prettier"
:
"^2.0.5"
,
"prettier"
:
"^2.0.5"
,
...
@@ -19,11 +22,9 @@
...
@@ -19,11 +22,9 @@
"react-redux"
:
"^5.0.7"
,
"react-redux"
:
"^5.0.7"
,
"redux"
:
"^4.0.0"
,
"redux"
:
"^4.0.0"
,
"redux-thunk"
:
"^2.3.0"
,
"redux-thunk"
:
"^2.3.0"
,
"style-loader"
:
"^1.2.1"
,
"spark-utils"
:
"^0.0.12"
,
"spark-utils"
:
"^0.0.12"
,
"duiba-utils"
:
"^1.0.2"
,
"style-loader"
:
"^1.2.1"
,
"@spark/api-base"
:
"^1.0.11"
,
"svgaplayerweb"
:
"^2.3.1"
"@spark/projectx"
:
"^1.0.3"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"mockjs"
:
"^1.1.0"
"mockjs"
:
"^1.1.0"
...
...
project/readme.md
0 → 100644
View file @
8598bf3c
"teddi-svga": "git+ssh://git@gitlab2.dui88.com:wildfirecode13/teddi-svga.git"
\ No newline at end of file
project/sparkrc.js
View file @
8598bf3c
...
@@ -4,6 +4,6 @@ module.exports = {
...
@@ -4,6 +4,6 @@ module.exports = {
TEMP_DIR
:
"./.temp"
,
TEMP_DIR
:
"./.temp"
,
ENTRY
:
"src/app.jsx"
,
ENTRY
:
"src/app.jsx"
,
TEMPLATE
:
"./public/index.html"
,
TEMPLATE
:
"./public/index.html"
,
MOCK_STATUS
:
tru
e
,
MOCK_STATUS
:
fals
e
,
PX2REM
:
true
PX2REM
:
true
};
};
project/src/pages/main/main.jsx
View file @
8598bf3c
...
@@ -5,6 +5,7 @@ import resList from '../../resconfig/resList'; //import API from '../../api';
...
@@ -5,6 +5,7 @@ import resList from '../../resconfig/resList'; //import API from '../../api';
import
'./main.less'
;
import
'./main.less'
;
import
Select
from
'../../components/select/select.jsx'
;
import
Select
from
'../../components/select/select.jsx'
;
import
{
getSVGA
,
loadSVGA
}
from
'../../svga.js'
;
class
Main
extends
Component
{
class
Main
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -18,12 +19,19 @@ class Main extends Component {
...
@@ -18,12 +19,19 @@ class Main extends Component {
222222
;
222222
;
};
};
componentDidMount
()
{
const
url
=
'https://yun.duiba.com.cn/aurora/assets/dffd145ab76b633d180db947d813ec0fd4fd602f.svga'
;
// loadSVGA(url); //
getSVGA
(
url
,
'.svga-placeholder'
);
}
getElement
()
{}
getElement
()
{}
render
()
{
render
()
{
const
{
guide
}
=
this
.
state
;
const
{
guide
}
=
this
.
state
;
return
(
return
(
<
div
className=
"main "
uuid=
"7d70e354-c6e9-47c8-a482-4101c0a75401"
>
<
div
className=
"main "
uuid=
"7d70e354-c6e9-47c8-a482-4101c0a75401"
>
<
div
className=
"svga-placeholder"
uuid=
"c718b8c3-43da-43d0-8422-91459c8f29a9"
/>
<
img
<
img
className=
"main_bg "
className=
"main_bg "
uuid=
"122bc8da-cec5-4044-93ea-d998cc08bac3"
uuid=
"122bc8da-cec5-4044-93ea-d998cc08bac3"
...
...
project/src/pages/main/main.less
View file @
8598bf3c
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
width: 752px;
width: 752px;
height: 1666px;
height: 1666px;
position: absolute;
position: absolute;
.svga-placeholder {
}
.main_bg {
.main_bg {
width: 750px;
width: 750px;
height: 1624px;
height: 1624px;
...
@@ -85,6 +87,4 @@
...
@@ -85,6 +87,4 @@
top: 1394px;
top: 1394px;
position: absolute;
position: absolute;
}
}
.hello456 {
}
}
}
project/src/svga.js
0 → 100644
View file @
8598bf3c
const
SVGA
=
require
(
"svgaplayerweb"
);
var
svgaParser
=
new
SVGA
.
Parser
();
/**
* 快速加载svga资源,但不装载
* @param url 资源URL
*/
export
const
loadSVGA
=
(
url
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
svgaParser
.
load
(
url
,
(
videoItem
)
=>
{
resolve
(
videoItem
)
},
(
err
)
=>
{
reject
(
err
)
})
})
}
/**
* 快速装载一个svga动画
* @param url 资源URL
* @param className 挂载元素的class name
* @param loops 播放次数。默认为空,循环播放。
* @param clearsAfterStop
*/
export
const
getSVGA
=
async
(
url
,
className
,
loops
,
clearsAfterStop
)
=>
{
const
videoItem
=
await
loadSVGA
(
url
);
var
svga
=
new
SVGA
.
Player
(
className
);
// if (loops)
// svga.loops = loops;
// if (clearsAfterStop)
// svga.clearsAfterStop = clearsAfterStop;
svga
.
setVideoItem
(
videoItem
);
svga
.
startAnimation
();
return
svga
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment