Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
love_飞影
Neos
Commits
33a662d1
Commit
33a662d1
authored
Aug 03, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: some btns and style in card build
parent
37634cf7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
137 additions
and
64 deletions
+137
-64
src/ui/BuildDeck/DeckSelect.module.scss
src/ui/BuildDeck/DeckSelect.module.scss
+57
-0
src/ui/BuildDeck/DeckSelect.tsx
src/ui/BuildDeck/DeckSelect.tsx
+60
-0
src/ui/BuildDeck/index.module.scss
src/ui/BuildDeck/index.module.scss
+5
-17
src/ui/BuildDeck/index.tsx
src/ui/BuildDeck/index.tsx
+15
-47
No files found.
src/ui/BuildDeck/DeckSelect.module.scss
0 → 100644
View file @
33a662d1
.deck-select
{
display
:
flex
;
flex-direction
:
column
;
gap
:
4px
;
.item
{
height
:
40px
;
padding
:
0
20px
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
position
:
relative
;
cursor
:
pointer
;
.hover
,
.selected
{
position
:
absolute
;
width
:
auto
;
height
:
auto
;
top
:
0
;
bottom
:
0
;
--padding-x
:
5px
;
left
:
var
(
--
padding-x
);
right
:
var
(
--
padding-x
);
border-radius
:
4px
;
transition
:
0
.2s
;
}
.hover
{
background-color
:
rgba
(
255
,
255
,
255
,
0
.15
);
opacity
:
0
;
}
.selected
{
background-color
:
rgba
(
255
,
255
,
255
,
0
.2
);
}
.btns
{
transition
:
0
.2s
;
opacity
:
0
;
}
&
:hover
{
.hover
,
.btns
{
opacity
:
1
;
}
}
}
}
.btn-add
{
position
:
fixed
;
bottom
:
40px
;
left
:
calc
(
300px
/
2
);
// 暂时没想到太好的办法,只能先设为sider的一半
transform
:
translate
(
-50%
);
background-color
:
rgb
(
59
,
0
,
169
);
box-shadow
:
0
0
10px
0
rgba
(
0
,
0
,
0
,
0
.5
);
&
:hover
{
background-color
:
rgb
(
78
,
0
,
223
)
!
important
;
transform
:
translate
(
-50%
)
scale
(
1
.3
);
}
}
src/ui/BuildDeck/DeckSelect.tsx
0 → 100644
View file @
33a662d1
import
styles
from
"
./DeckSelect.module.scss
"
;
import
{
Button
}
from
"
antd
"
;
import
{
DeleteOutlined
,
DownloadOutlined
,
PlusOutlined
,
}
from
"
@ant-design/icons
"
;
export
const
DeckSelect
:
React
.
FC
<
{
decks
:
{
name
:
string
;
id
:
number
}[];
selected
:
number
;
onSelect
:
(
id
:
number
)
=>
void
;
onDelete
:
(
id
:
number
)
=>
void
;
onDownload
:
(
id
:
number
)
=>
void
;
onAdd
:
()
=>
void
;
}
>
=
({
decks
,
selected
,
onSelect
,
onDelete
,
onDownload
,
onAdd
})
=>
{
return
(
<>
<
div
className=
{
styles
[
"
deck-select
"
]
}
>
{
decks
.
map
(({
name
,
id
})
=>
(
<
div
key=
{
id
}
className=
{
styles
.
item
}
onClick=
{
()
=>
onSelect
(
id
)
}
>
<
div
className=
{
styles
.
hover
}
/>
{
selected
===
id
&&
<
div
className=
{
styles
.
selected
}
/>
}
<
span
>
{
name
}
</
span
>
<
div
className=
{
styles
.
btns
}
>
<
Button
icon=
{
<
DeleteOutlined
/>
}
type=
"text"
shape=
"circle"
onClick=
{
cancelBubble
(()
=>
onDelete
(
id
))
}
/>
<
Button
icon=
{
<
DownloadOutlined
/>
}
type=
"text"
shape=
"circle"
onClick=
{
cancelBubble
(()
=>
onDownload
(
id
))
}
/>
</
div
>
</
div
>
))
}
</
div
>
<
Button
className=
{
styles
[
"
btn-add
"
]
}
icon=
{
<
PlusOutlined
/>
}
shape=
"circle"
type=
"text"
onClick=
{
onAdd
}
/>
</>
);
};
/** 阻止事件冒泡 */
const
cancelBubble
=
<
T
,
>
(fn: (e: React.SyntheticEvent) =
>
T) =
>
(e: React.SyntheticEvent) =
>
{
e
.
stopPropagation
();
e
.
nativeEvent
.
stopImmediatePropagation
();
return
fn
(
e
);
}
;
src/ui/BuildDeck/index.module.scss
View file @
33a662d1
...
@@ -13,21 +13,11 @@
...
@@ -13,21 +13,11 @@
overflow-x
:
hidden
;
overflow-x
:
hidden
;
overflow-y
:
overlay
;
overflow-y
:
overlay
;
background
:
transparent
!
important
;
background
:
transparent
!
important
;
position
:
relative
;
@include
utils
.
scrollbar
;
@include
utils
.
scrollbar
;
// 去掉menu
.menu
{
.menu
{
min-height
:
100%
;
// min-height: 100%;
}
.btn-add
{
position
:
absolute
;
bottom
:
40px
;
left
:
50%
;
transform
:
translate
(
-50%
);
background-color
:
rgb
(
59
,
0
,
169
);
box-shadow
:
0
0
10px
0
rgba
(
0
,
0
,
0
,
0
.5
);
&
:hover
{
background-color
:
rgb
(
78
,
0
,
223
);
transform
:
translate
(
-50%
)
scale
(
1
.3
);
}
}
}
}
}
...
@@ -36,7 +26,7 @@
...
@@ -36,7 +26,7 @@
padding-bottom
:
0
;
padding-bottom
:
0
;
padding-right
:
1rem
;
padding-right
:
1rem
;
.deck
{
.deck
{
width
:
6
2
0px
;
width
:
6
6
0px
;
}
}
.select
{
.select
{
flex
:
1
;
flex
:
1
;
...
@@ -74,9 +64,7 @@
...
@@ -74,9 +64,7 @@
.main
{
.main
{
flex
:
3
;
flex
:
3
;
}
}
.extra
{
.extra
,
flex
:
1
;
}
.side
{
.side
{
flex
:
1
;
flex
:
1
;
}
}
...
...
src/ui/BuildDeck/index.tsx
View file @
33a662d1
...
@@ -3,7 +3,6 @@ import {
...
@@ -3,7 +3,6 @@ import {
DeleteOutlined
,
DeleteOutlined
,
EditOutlined
,
EditOutlined
,
FilterOutlined
,
FilterOutlined
,
PlusOutlined
,
SearchOutlined
,
SearchOutlined
,
SortAscendingOutlined
,
SortAscendingOutlined
,
UndoOutlined
,
UndoOutlined
,
...
@@ -13,8 +12,6 @@ import {
...
@@ -13,8 +12,6 @@ import {
ConfigProvider
,
ConfigProvider
,
Input
,
Input
,
Layout
,
Layout
,
Menu
,
type
MenuProps
,
Space
,
Space
,
type
ThemeConfig
,
type
ThemeConfig
,
}
from
"
antd
"
;
}
from
"
antd
"
;
...
@@ -22,40 +19,12 @@ import {
...
@@ -22,40 +19,12 @@ import {
import
{
Background
}
from
"
../Shared
"
;
import
{
Background
}
from
"
../Shared
"
;
import
styles
from
"
./index.module.scss
"
;
import
styles
from
"
./index.module.scss
"
;
const
{
Content
,
Sider
}
=
Layout
;
import
{
DeckSelect
}
from
"
./DeckSelect
"
;
type
MenuItem
=
Required
<
MenuProps
>
[
"
items
"
][
number
];
// 生成伪菜单栏
const
{
Content
,
Sider
}
=
Layout
;
function
getItem
(
label
:
React
.
ReactNode
,
key
:
React
.
Key
,
icon
?:
React
.
ReactNode
,
children
?:
MenuItem
[],
type
?:
"
group
"
):
MenuItem
{
return
{
key
,
icon
,
children
,
label
,
type
,
}
as
MenuItem
;
}
const
items
:
MenuProps
[
"
items
"
]
=
Array
.
from
({
length
:
15
}).
map
((
_
,
i
)
=>
getItem
(
`卡组
${
i
}
`
,
i
.
toString
())
);
const
theme
:
ThemeConfig
=
{
const
theme
:
ThemeConfig
=
{
components
:
{
components
:
{
Menu
:
{
colorItemBg
:
"
#ffffff00
"
,
colorItemBgSelected
:
"
#ffffff33
"
,
colorItemTextSelected
:
"
#ffffff
"
,
colorActiveBarBorderSize
:
0
,
fontSize
:
12
,
fontSizeLG
:
12
,
},
Layout
:
{
Layout
:
{
colorBgBody
:
"
transparent
"
,
colorBgBody
:
"
transparent
"
,
},
},
...
@@ -67,23 +36,22 @@ export const Component: React.FC = () => {
...
@@ -67,23 +36,22 @@ export const Component: React.FC = () => {
<
ConfigProvider
theme=
{
theme
}
>
<
ConfigProvider
theme=
{
theme
}
>
<
Background
/>
<
Background
/>
<
Layout
className=
{
styles
.
layout
}
style=
{
{
width
:
"
100%
"
}
}
>
<
Layout
className=
{
styles
.
layout
}
style=
{
{
width
:
"
100%
"
}
}
>
<
Sider
width=
{
220
}
className=
{
styles
.
sider
}
>
<
Sider
width=
{
300
}
className=
{
styles
.
sider
}
>
<
Menu
<
DeckSelect
className=
{
styles
.
menu
}
decks=
{
Array
.
from
({
length
:
17
}).
map
((
_
,
i
)
=>
({
defaultSelectedKeys=
{
[
"
1
"
]
}
name
:
`卡组 ${i}`
,
defaultOpenKeys=
{
[
"
sub1
"
]
}
id
:
i
,
items=
{
items
}
}))
}
selected=
{
4
}
onSelect=
{
(
id
)
=>
console
.
log
(
id
)
}
onDelete=
{
(
id
)
=>
console
.
log
(
id
)
}
onDownload=
{
(
id
)
=>
console
.
log
(
id
)
}
onAdd=
{
()
=>
console
.
log
(
"
add
"
)
}
/>
/>
<
Button
className=
{
styles
[
"
btn-add
"
]
}
icon=
{
<
PlusOutlined
/>
}
shape=
"circle"
type=
"text"
></
Button
>
</
Sider
>
</
Sider
>
<
Content
className=
{
styles
.
content
}
>
<
Content
className=
{
styles
.
content
}
>
<
Deck
/>
<
Deck
/>
<
Select
/>
<
Card
Select
/>
</
Content
>
</
Content
>
</
Layout
>
</
Layout
>
</
ConfigProvider
>
</
ConfigProvider
>
...
@@ -144,7 +112,7 @@ const Deck: React.FC = () => {
...
@@ -144,7 +112,7 @@ const Deck: React.FC = () => {
);
);
};
};
const
Select
:
React
.
FC
=
()
=>
{
const
Card
Select
:
React
.
FC
=
()
=>
{
return
(
return
(
<
div
className=
{
styles
.
select
}
>
<
div
className=
{
styles
.
select
}
>
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
container
}
>
...
...
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