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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
MyCard
Neos
Commits
0d3c3239
Commit
0d3c3239
authored
Aug 10, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: small
parent
5c3a29b6
Pipeline
#23025
failed with stages
in 16 minutes and 42 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
99 additions
and
43 deletions
+99
-43
src/ui/BuildDeck/DeckSelect.tsx
src/ui/BuildDeck/DeckSelect.tsx
+26
-9
src/ui/BuildDeck/index.module.scss
src/ui/BuildDeck/index.module.scss
+8
-0
src/ui/BuildDeck/index.tsx
src/ui/BuildDeck/index.tsx
+29
-5
src/ui/Duel/PlayMat/Bg/index.module.scss
src/ui/Duel/PlayMat/Bg/index.module.scss
+25
-24
src/ui/Duel/PlayMat/Bg/index.tsx
src/ui/Duel/PlayMat/Bg/index.tsx
+6
-3
src/ui/Duel/PlayMat/Underlying/index.module.scss
src/ui/Duel/PlayMat/Underlying/index.module.scss
+2
-2
src/ui/theme.ts
src/ui/theme.ts
+3
-0
No files found.
src/ui/BuildDeck/DeckSelect.tsx
View file @
0d3c3239
...
...
@@ -2,8 +2,9 @@ import {
DeleteOutlined
,
DownloadOutlined
,
PlusOutlined
,
FileAddOutlined
,
}
from
"
@ant-design/icons
"
;
import
{
Button
}
from
"
antd
"
;
import
{
Button
,
Dropdown
,
MenuProps
}
from
"
antd
"
;
import
styles
from
"
./DeckSelect.module.scss
"
;
...
...
@@ -15,6 +16,20 @@ export const DeckSelect: React.FC<{
onDownload
:
(
deckName
:
string
)
=>
void
;
onAdd
:
()
=>
void
;
}
>
=
({
decks
,
selected
,
onSelect
,
onDelete
,
onDownload
,
onAdd
})
=>
{
const
items
:
MenuProps
[
"
items
"
]
=
[
{
key
:
"
1
"
,
label
:
"
新建卡组
"
,
icon
:
<
PlusOutlined
/>,
onClick
:
()
=>
{},
},
{
key
:
"
2
"
,
label
:
"
导入卡组
"
,
icon
:
<
FileAddOutlined
/>,
onClick
:
()
=>
{},
},
];
return
(
<>
<
div
className=
{
styles
[
"
deck-select
"
]
}
>
...
...
@@ -44,14 +59,16 @@ export const DeckSelect: React.FC<{
</
div
>
))
}
</
div
>
<
Button
className=
{
styles
[
"
btn-add
"
]
}
icon=
{
<
PlusOutlined
/>
}
shape=
"circle"
type=
"text"
onClick=
{
onAdd
}
size=
"large"
/>
<
Dropdown
menu=
{
{
items
}
}
placement=
"top"
arrow
trigger=
{
[
"
click
"
]
}
>
<
Button
className=
{
styles
[
"
btn-add
"
]
}
icon=
{
<
PlusOutlined
/>
}
shape=
"circle"
type=
"text"
onClick=
{
onAdd
}
size=
"large"
/>
</
Dropdown
>
</>
);
};
...
...
src/ui/BuildDeck/index.module.scss
View file @
0d3c3239
...
...
@@ -59,9 +59,17 @@
.main
,
.extra
,
.side
{
transition
:
0
.2s
;
position
:
relative
;
border-bottom
:
1px
solid
rgba
(
255
,
255
,
255
,
0
.1
);
padding
:
0
.75rem
;
&
.over
{
background-color
:
hsla
(
0
,
0%
,
100%
,
0
.05
);
}
&
.not-allow-to-drop
{
background-color
:
rgba
(
255
,
0
,
0
,
0
.15
);
cursor
:
not
-
allowed
;
}
}
.main
{
flex
:
3
;
...
...
src/ui/BuildDeck/index.tsx
View file @
0d3c3239
...
...
@@ -13,7 +13,7 @@ import {
Button
,
ConfigProvider
,
Input
,
message
,
Dropdown
,
Space
,
type
ThemeConfig
,
}
from
"
antd
"
;
...
...
@@ -48,6 +48,7 @@ import {
iDeckToEditingDeck
,
type
Type
,
}
from
"
./utils
"
;
import
classNames
from
"
classnames
"
;
const
theme
:
ThemeConfig
=
{
components
:
{
...
...
@@ -85,9 +86,11 @@ export const Component: React.FC = () => {
if
(
result
)
{
setSelectedDeck
(
tmpIDeck
);
message
.
info
(
"
保存成功
"
);
editDeckStore
.
edited
=
false
;
}
else
{
editDeckStore
.
set
(
await
iDeckToEditingDeck
(
selectedDeck
));
message
.
error
(
"
保存失败
"
);
editDeckStore
.
edited
=
false
;
}
};
...
...
@@ -182,7 +185,7 @@ const DeckEditor: React.FC<{
重置
</
Button
>
<
Button
type=
"text"
type=
{
snapEditDeck
.
edited
?
"
primary
"
:
"
text
"
}
size=
"small"
icon=
{
<
CheckOutlined
/>
}
onClick=
{
()
=>
onSave
()
}
...
...
@@ -202,7 +205,7 @@ const DeckEditor: React.FC<{
/** 卡片库,选择卡片加入正在编辑的卡组 */
const
Search
:
React
.
FC
=
()
=>
{
const
{
m
essage
,
notification
,
m
odal
}
=
App
.
useApp
();
const
{
modal
}
=
App
.
useApp
();
const
[
searchWord
,
setSearchWord
]
=
useState
(
""
);
const
[
searchResult
,
setSearchResult
]
=
useState
<
CardMeta
[]
>
([]);
const
handleSearch
=
async
()
=>
{
...
...
@@ -238,6 +241,7 @@ const Search: React.FC = () => {
value=
{
searchWord
}
onChange=
{
(
e
)
=>
setSearchWord
(
e
.
target
.
value
)
}
onKeyUp=
{
(
e
)
=>
e
.
key
===
"
Enter
"
&&
handleSearch
()
}
allowClear
/>
</
div
>
<
div
className=
{
styles
[
"
select-btns
"
]
}
>
...
...
@@ -293,7 +297,8 @@ const DeckZone: React.FC<{
}
>
=
({
type
})
=>
{
const
{
message
}
=
App
.
useApp
();
const
cards
=
useSnapshot
(
editDeckStore
)[
type
];
const
[
_
,
dropRef
]
=
useDrop
({
const
[
allowToDrop
,
setAllowToDrop
]
=
useState
(
false
);
const
[{
isOver
},
dropRef
]
=
useDrop
({
accept
:
[
"
Card
"
],
// 指明该区域允许接收的拖放物。可以是单个,也可以是数组
// 里面的值就是useDrag所定义的type
// 当拖拽物在这个拖放区域放下时触发,这个item就是拖拽物的item(拖拽物携带的数据)
...
...
@@ -309,9 +314,23 @@ const DeckZone: React.FC<{
message
.
error
(
reason
);
}
},
hover
:
({
value
,
source
})
=>
{
setAllowToDrop
(
type
!==
source
?
canAdd
(
value
,
type
,
editDeckStore
).
result
:
true
);
},
collect
:
(
monitor
)
=>
({
isOver
:
monitor
.
isOver
(),
}),
});
return
(
<
div
className=
{
styles
[
type
]
}
ref=
{
dropRef
}
>
<
div
className=
{
classNames
(
styles
[
type
],
{
[
styles
.
over
]:
isOver
,
[
styles
[
"
not-allow-to-drop
"
]]:
isOver
&&
!
allowToDrop
,
})
}
ref=
{
dropRef
}
>
<
div
className=
{
styles
[
"
card-continer
"
]
}
>
{
cards
.
map
((
item
,
i
)
=>
(
<
Card
...
...
@@ -390,11 +409,13 @@ const editDeckStore = proxy({
add
(
type
:
Type
,
card
:
CardMeta
)
{
editDeckStore
[
type
].
push
(
card
);
editDeckStore
[
type
].
sort
(
compareCards
);
editDeckStore
.
edited
=
true
;
},
remove
(
type
:
Type
,
card
:
CardMeta
)
{
const
index
=
editDeckStore
[
type
].
findIndex
((
item
)
=>
item
.
id
===
card
.
id
);
if
(
index
!==
-
1
)
{
editDeckStore
[
type
].
splice
(
index
,
1
);
editDeckStore
.
edited
=
true
;
}
},
set
(
deck
:
EditingDeck
)
{
...
...
@@ -402,10 +423,13 @@ const editDeckStore = proxy({
editDeckStore
.
main
=
deck
.
main
.
sort
(
compareCards
);
editDeckStore
.
extra
=
deck
.
extra
.
sort
(
compareCards
);
editDeckStore
.
side
=
deck
.
side
.
sort
(
compareCards
);
editDeckStore
.
edited
=
false
;
},
clear
()
{
editDeckStore
.
main
=
[];
editDeckStore
.
extra
=
[];
editDeckStore
.
side
=
[];
editDeckStore
.
edited
=
true
;
},
edited
:
false
,
})
satisfies
EditingDeck
;
src/ui/Duel/PlayMat/Bg/index.module.scss
View file @
0d3c3239
...
...
@@ -17,7 +17,7 @@
.block
{
height
:
var
(
--
block-height-m
);
width
:
var
(
--
block-width
);
background
:
#ffffff
1c
;
background
-color
:
#ffffff
1c
;
position
:
relative
;
&
.extra
{
margin-inline
:
calc
(
var
(
--
block-width
)
/
2
+
var
(
--
col-gap
)
/
2
);
...
...
@@ -28,41 +28,42 @@
&
.highlight
{
background
:
#ffffff
35
;
cursor
:
pointer
;
.triangle
{
--color
:
#006eff
;
transform
:
scale
(
1
.5
);
}
&
:hover
{
opacity
:
0
.7
;
.triangle
{
transform
:
scale
(
1
.2
);
}
}
}
.triangle
{
width
:
0
;
height
:
0
;
--color
:
#333
;
border-width
:
4px
;
border-style
:
solid
;
display
:
none
;
--color
:
red
;
position
:
absolute
;
transition
:
0
.3s
;
transform
:
scale
(
1
.2
);
.triangle-atom
{
width
:
20px
;
height
:
5px
;
background-color
:
red
;
position
:
absolute
;
&
:last-of-type
{
transform
:
rotate
(
90deg
);
transform-origin
:
2
.5px
2
.5px
;
}
}
&
:nth-of-type
(
1
)
{
border-color
:
var
(
--
color
)
transparent
transparent
var
(
--
color
)
;
left
:
0
;
}
&
:nth-of-type
(
2
)
{
border-color
:
var
(
--
color
)
var
(
--
color
)
transparent
transparent
;
right
:
0
;
}
&
:nth-of-type
(
3
)
{
border-color
:
transparent
var
(
--
color
)
var
(
--
color
)
transparent
;
transform
:
rotate
(
90deg
);
right
:
0
;
bottom
:
0
;
}
&
:nth-of-type
(
4
)
{
border-color
:
transparent
transparent
var
(
--
color
)
var
(
--
color
);
bottom
:
0
;
}
// &:nth-of-type(3) {
// transform: rotate(180deg);
// right: 0;
// bottom: 0;
// }
// &:nth-of-type(4) {
// transform: rotate(270deg);
// bottom: 0;
// }
}
}
...
...
src/ui/Duel/PlayMat/Bg/index.tsx
View file @
0d3c3239
...
...
@@ -32,7 +32,7 @@ const BgBlock: React.FC<
[
styles
.
glowing
]:
glowing
,
})
}
>
{
/* {<DecoTriangles />} */
}
{
<
DecoTriangles
/>
}
{
<
DisabledCross
disabled=
{
disabled
}
/>
}
</
div
>
);
...
...
@@ -129,8 +129,11 @@ const onBlockClick = (placeInteractivity: PlaceInteractivity) => {
const
DecoTriangles
:
React
.
FC
=
()
=>
(
<>
{
Array
.
from
({
length
:
4
}).
map
((
_
,
i
)
=>
(
<
div
className=
{
styles
.
triangle
}
key=
{
i
}
/>
{
Array
.
from
({
length
:
2
}).
map
((
_
,
i
)
=>
(
<
div
className=
{
styles
.
triangle
}
key=
{
i
}
>
<
div
className=
{
styles
[
"
triangle-atom
"
]
}
/>
<
div
className=
{
styles
[
"
triangle-atom
"
]
}
/>
</
div
>
))
}
</>
);
...
...
src/ui/Duel/PlayMat/Underlying/index.module.scss
View file @
0d3c3239
...
...
@@ -16,7 +16,7 @@
}
.inner
{
transform
:
translateY
(
4
0%
);
transform
:
translateY
(
5
0%
);
width
:
60vw
;
height
:
100vh
;
background
:
radial-gradient
(
#00814f
,
#1c0161
);
...
...
@@ -26,7 +26,7 @@
transition
:
0
.5s
;
}
.opponent
.inner
{
background
:
radial-gradient
(
#
ff51
00
,
#54005f
98
);
background
:
radial-gradient
(
#
8100
00
,
#54005f
98
);
transform
:
translateY
(
-50%
);
filter
:
blur
(
602px
);
opacity
:
0
.8
;
...
...
src/ui/theme.ts
View file @
0d3c3239
...
...
@@ -29,5 +29,8 @@ export const theme: ThemeConfig = {
lineWidth
:
0
,
colorBgContainer
:
"
hsla(0, 0%, 100%, 0.05)
"
,
},
Dropdown
:
{
colorBgElevated
:
"
hsla(0, 0%, 100%, 0.15)
"
,
},
},
};
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