Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wangjin-front-end
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
张媛
wangjin-front-end
Commits
da6348b3
Commit
da6348b3
authored
Jul 19, 2021
by
张媛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组件概览完善
parent
6a2de5f4
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
101 additions
and
80 deletions
+101
-80
preview.js
.storybook/preview.js
+1
-1
reactDanmu.gif
src/asserts/resource/reactDanmu.gif
+0
-0
丰富文本.gif
src/asserts/resource/丰富文本.gif
+0
-0
多边形坐标系统.gif
src/asserts/resource/多边形坐标系统.gif
+0
-0
轮播.gif
src/asserts/resource/轮播.gif
+0
-0
金币动效.gif
src/asserts/resource/金币动效.gif
+0
-0
carouselCom.tsx
src/canvasCom/carouselCom/carouselCom.tsx
+6
-0
carousel.stories.tsx
src/canvasStories/carousel.stories.tsx
+2
-0
TotalCanvas.stories.tsx
src/docs/TotalCanvas.stories.tsx
+0
-15
TotalCom.stories.tsx
src/docs/TotalCom.stories.tsx
+7
-3
totalCanvasCom.css
src/docs/totalCanvasCom.css
+0
-20
totalCom.less
src/docs/totalCom.less
+9
-3
totalCom.tsx
src/docs/totalCom.tsx
+76
-0
totalReactCom.tsx
src/docs/totalReactCom.tsx
+0
-38
No files found.
.storybook/preview.js
View file @
da6348b3
...
...
@@ -52,7 +52,7 @@ export const parameters = {
viewport
:
{
viewports
:
customViewports
},
options
:
{
storySort
:
{
order
:
[
"Introduction"
,
"
Canvas
组件概览"
,
"React组件概览"
,
"Canvas组件"
,
"React组件"
],
order
:
[
"Introduction"
,
"组件概览"
,
"React组件概览"
,
"Canvas组件"
,
"React组件"
],
},
},
};
src/asserts/resource/reactDanmu.gif
0 → 100644
View file @
da6348b3
This diff is collapsed.
Click to expand it.
src/asserts/resource/丰富文本.gif
0 → 100644
View file @
da6348b3
This diff is collapsed.
Click to expand it.
src/asserts/resource/多边形坐标系统.gif
0 → 100644
View file @
da6348b3
This diff is collapsed.
Click to expand it.
src/asserts/resource/轮播.gif
0 → 100644
View file @
da6348b3
This diff is collapsed.
Click to expand it.
src/asserts/resource/金币动效.gif
0 → 100644
View file @
da6348b3
479 KB
src/canvasCom/carouselCom/carouselCom.tsx
View file @
da6348b3
...
...
@@ -15,8 +15,13 @@ interface TestProps {
num
:
number
;
/** 缓动系数,系数越大移动越快。在0-1之间*/
k
:
number
;
/**轮播组件的x坐标 */
x
:
number
;
/**轮播组件的y坐标 */
y
:
number
;
/**轮播的数据 */
data
:
any
;
}
export
const
CarouselCom
=
(
pros
:
TestProps
)
=>
{
...
...
@@ -25,6 +30,7 @@ export const CarouselCom = (pros:TestProps)=>{
window
.
stage
.
removeAllChildren
();
const
{
carouselItem
,
itemWidth
,
itemHeight
,
vertical
,
num
,
k
}
=
pros
const
carouseCom
=
new
CarouselComponent
(
carouselItem
,
itemWidth
,
itemHeight
,
vertical
,
num
,
k
);
carouseCom
.
position
.
set
(
pros
.
x
,
pros
.
y
)
window
.
stage
.
addChild
(
carouseCom
);
carouseCom
.
updateData
(
pros
.
data
);
})
...
...
src/canvasStories/carousel.stories.tsx
View file @
da6348b3
...
...
@@ -66,6 +66,8 @@ Demo1.args = {
vertical
:
false
,
num
:
3
,
k
:
0.3
,
x
:
100
,
y
:
100
,
data
:[
{
"rule"
:
"ru_1"
,
...
...
src/docs/TotalCanvas.stories.tsx
deleted
100644 → 0
View file @
6a2de5f4
import
React
from
'react'
;
import
{
TotalCom
}
from
"./totalCanvasCom"
;
import
{
Title
,
Subtitle
,
Description
,
ArgsTable
,
PRIMARY_STORY
,
}
from
'@storybook/addon-docs'
;
export
default
{
component
:
TotalCom
,
title
:
'Canvas组件概览'
,
};
const
Template
=
()
=>
<
TotalCom
/>;
export
const
CanvasPreview
=
Template
.
bind
({});
\ No newline at end of file
src/docs/Tota
React
.stories.tsx
→
src/docs/Tota
lCom
.stories.tsx
View file @
da6348b3
import
React
from
'react'
;
import
{
TotalCom
}
from
"./total
React
Com"
;
import
{
TotalCom
}
from
"./totalCom"
;
import
{
Title
,
Subtitle
,
...
...
@@ -9,7 +9,11 @@ import {
}
from
'@storybook/addon-docs'
;
export
default
{
component
:
TotalCom
,
title
:
'React组件概览'
,
title
:
'组件概览'
,
parameters
:{
layout
:
"left"
}
};
const
Template
=
()
=>
<
TotalCom
/>;
export
const
CanvasPreview
=
Template
.
bind
({});
\ No newline at end of file
export
const
componentsPreview
=
Template
.
bind
({});
src/docs/totalCanvasCom.css
deleted
100644 → 0
View file @
6a2de5f4
.container-div
{
width
:
750px
;
height
:
1624px
;
display
:
flex
;
flex-direction
:
row
;
flex-wrap
:
wrap
;
justify-content
:
flex-start
;
align-items
:
flex-start
;
align-content
:
flex-start
;
}
.itemCom
{
width
:
250px
;
height
:
200px
;
}
span
{
display
:
block
;
color
:
#ffffff
;
}
*
{
color
:
#ffffff
;}
\ No newline at end of file
src/docs/total
ReactCom.c
ss
→
src/docs/total
Com.le
ss
View file @
da6348b3
.total-container{
margin: 50px;
}
.container-div{
width
:
750px
;
height
:
1624px
;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
align-items: flex-start;
align-content: flex-start;
}
.itemCom{
width: 250px;
...
...
@@ -15,6 +15,12 @@
}
span{
display: block;
width: 200px;
text-align: center;
color: #ffffff;
&:hover{
color: cyan;
cursor: pointer;
}
}
*{color: #ffffff;}
\ No newline at end of file
src/docs/totalC
anvasC
om.tsx
→
src/docs/totalCom.tsx
View file @
da6348b3
...
...
@@ -2,45 +2,68 @@ import React from 'react';
import
{
clearStage
}
from
"../common/createStage"
import
{
useEffect
}
from
'react'
;
import
{
navigate
,
LinkTo
,
linkTo
,
hrefTo
}
from
'@storybook/addon-links'
;
import
"./totalC
anvasCom.c
ss"
import
"./totalC
om.le
ss"
const
clickFun
=
(
name
)
=>
{
const
c
anvasC
lickFun
=
(
name
)
=>
{
linkTo
(
'Canvas组件/'
+
name
)();
}
const
reactClickFun
=
(
name
)
=>
{
linkTo
(
'React组件/'
+
name
)();
}
const
comArrData
=
[
{
name
:
"金币动效"
,
imgUrl
:
"/resource/
test
.gif"
,
imgUrl
:
"/resource/
金币动效
.gif"
,
href
:
"金币动效"
},
{
name
:
"轮播组件"
,
imgUrl
:
"/resource/
test
.gif"
,
imgUrl
:
"/resource/
轮播
.gif"
,
href
:
"轮播组件"
},
{
name
:
"多边形坐标系统"
,
imgUrl
:
"/resource/
test
.gif"
,
imgUrl
:
"/resource/
多边形坐标系统
.gif"
,
href
:
"多边形坐标系统"
},
{
name
:
"丰富文本"
,
imgUrl
:
"/resource/
test
.gif"
,
imgUrl
:
"/resource/
丰富文本
.gif"
,
href
:
"丰富文本"
},
}
]
const
reactArrData
=
[
{
name
:
"弹幕"
,
imgUrl
:
"/resource/reactDanmu.gif"
,
href
:
"弹幕"
}
]
export
const
TotalCom
=
()
=>
{
clearStage
();
return
(
<
div
>
<
div
className=
"total-container"
>
<
h2
>
canvas组件概览
</
h2
>
<
div
className
="
container
-
div
"
>
{
comArrData
.
map
((
el
,
index
)
=>
{
return
(
<
div
className=
"itemCom"
>
<
div
key=
{
index
}
className=
"itemCom"
>
<
img
src=
{
el
.
imgUrl
}
width
=
"200"
height
=
"150"
/>
<
span
onClick
=
{
canvasClickFun
.
bind
(
this
,
el
.
name
)}
>
{
el
.
name
}
</
span
>
</
div
>
)
})
}
</
div
>
<
h2
>
React组件概览
</
h2
>
<
div
className
="
container
-
div
"
>
{
reactArrData
.
map
((
el
,
index
)
=>
{
return
(
<
div
key=
{
index
}
className=
"itemCom"
>
<
img
src=
{
el
.
imgUrl
}
width
=
"200"
height
=
"150"
/>
<
span
onClick
=
{
c
lickFun
.
bind
(
this
,
el
.
name
)}
>
{
el
.
name
}
</
span
>
<
span
onClick
=
{
reactC
lickFun
.
bind
(
this
,
el
.
name
)}
>
{
el
.
name
}
</
span
>
</
div
>
)
})
...
...
src/docs/totalReactCom.tsx
deleted
100644 → 0
View file @
6a2de5f4
import
React
from
'react'
;
import
{
clearStage
}
from
"../common/createStage"
import
{
useEffect
}
from
'react'
;
import
{
navigate
,
LinkTo
,
linkTo
,
hrefTo
}
from
'@storybook/addon-links'
;
import
"./totalCanvasCom.css"
const
clickFun
=
(
name
)
=>
{
linkTo
(
'React组件/'
+
name
)();
}
const
comArrData
=
[
{
name
:
"弹幕"
,
imgUrl
:
"/resource/test.gif"
,
href
:
"弹幕"
}
]
export
const
TotalCom
=
()
=>
{
clearStage
();
return
(
<
div
>
<
h2
>
canvas组件概览
</
h2
>
<
div
className
="
container
-
div
"
>
{
comArrData
.
map
((
el
,
index
)
=>
{
return
(
<
div
className=
"itemCom"
>
<
img
src=
{
el
.
imgUrl
}
width
=
"200"
height
=
"150"
/>
<
span
onClick
=
{
clickFun
.
bind
(
this
,
el
.
name
)}
>
{
el
.
name
}
</
span
>
</
div
>
)
})
}
</
div
>
</
div
>
)
}
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