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
b0ba8861
Commit
b0ba8861
authored
Jun 20, 2023
by
timel
Committed by
Chunchi Che
Jun 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update style2
parent
dc06b81c
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
310 additions
and
101 deletions
+310
-101
src/styles/card-modal.scss
src/styles/card-modal.scss
+45
-45
src/styles/core.scss
src/styles/core.scss
+1
-1
src/ui/Duel/Message/CardModal/Desc.scss
src/ui/Duel/Message/CardModal/Desc.scss
+31
-0
src/ui/Duel/Message/CardModal/Desc.tsx
src/ui/Duel/Message/CardModal/Desc.tsx
+71
-0
src/ui/Duel/Message/CardModal/index.scss
src/ui/Duel/Message/CardModal/index.scss
+59
-0
src/ui/Duel/Message/CardModal/index.tsx
src/ui/Duel/Message/CardModal/index.tsx
+69
-35
src/ui/Duel/Message/NewSelectActionModal/index.tsx
src/ui/Duel/Message/NewSelectActionModal/index.tsx
+12
-1
src/ui/Duel/PlayMat/Bg/index.scss
src/ui/Duel/PlayMat/Bg/index.scss
+3
-3
src/ui/Duel/PlayMat/Card/index.scss
src/ui/Duel/PlayMat/Card/index.scss
+7
-3
src/ui/Duel/PlayMat/Card/springs/moveToHand.ts
src/ui/Duel/PlayMat/Card/springs/moveToHand.ts
+1
-1
src/ui/Duel/PlayMat/utils/cssConfig.ts
src/ui/Duel/PlayMat/utils/cssConfig.ts
+1
-1
src/ui/Shared/YgoCard/index.scss
src/ui/Shared/YgoCard/index.scss
+0
-8
src/ui/Shared/YgoCard/index.tsx
src/ui/Shared/YgoCard/index.tsx
+10
-3
No files found.
src/styles/card-modal.scss
View file @
b0ba8861
.card-modal
{
//
.card-modal {
position
:
fixed
;
//
position: fixed;
display
:
flex
;
//
display: flex;
left
:
5%
;
//
left: 5%;
top
:
20%
;
//
top: 20%;
border-style
:
groove
;
//
border-style: groove;
border-radius
:
8px
;
//
border-radius: 8px;
width
:
200px
;
//
width: 200px;
flex-wrap
:
wrap
;
//
flex-wrap: wrap;
background-color
:
#303030
;
//
background-color: #303030;
padding
:
1%
;
//
padding: 1%;
--visibility
:
hidden
;
//
--visibility: hidden;
visibility
:
var
(
--
visibility
);
//
visibility: var(--visibility);
--opacity
:
0
;
//
--opacity: 0;
opacity
:
var
(
--
opacity
);
//
opacity: var(--opacity);
transition
:visibility
0
.3s
linear
,
opacity
0
.3s
linear
;
//
transition:visibility 0.3s linear, opacity 0.3s linear;
}
//
}
.card-modal-container
{
//
.card-modal-container {
display
:
flex
;
//
display: flex;
flex-direction
:
column
;
//
flex-direction: column;
gap
:
5px
;
//
gap: 5px;
}
//
}
.card-modal-name
{
//
.card-modal-name {
font-weight
:
bold
;
//
font-weight: bold;
}
//
}
.card-modal-attribute
{
//
.card-modal-attribute {
font-weight
:
bold
;
//
font-weight: bold;
}
//
}
.card-modal-atk
{
//
.card-modal-atk {
font-weight
:
bold
;
//
font-weight: bold;
}
//
}
.card-modal-counter
{
//
.card-modal-counter {
font-weight
:
bold
;
//
font-weight: bold;
}
//
}
.card-modal-effect
{
//
.card-modal-effect {
font-weight
:
lighter
;
//
font-weight: lighter;
text-align
:
left
;
//
text-align: left;
max-height
:
200px
;
//
max-height: 200px;
overflow
:
auto
;
//
overflow: auto;
}
//
}
.card-modal-btn
{
//
.card-modal-btn {
margin
:
1px
5px
;
//
margin: 1px 5px;
font-size
:
80%
;
//
font-size: 80%;
border-color
:
yellow
;
//
border-color: yellow;
}
//
}
src/styles/core.scss
View file @
b0ba8861
...
@@ -33,7 +33,7 @@ table {
...
@@ -33,7 +33,7 @@ table {
body
{
body
{
color-scheme
:
light
dark
;
color-scheme
:
light
dark
;
color
:
rgba
(
255
,
255
,
255
,
0
.87
);
color
:
rgba
(
255
,
255
,
255
,
0
.87
);
background-color
:
#
202022
;
background-color
:
#
141414
;
font
:
87
.5%
/
1
.5em
"Open Sans"
,
sans-serif
;
font
:
87
.5%
/
1
.5em
"Open Sans"
,
sans-serif
;
display
:
flex
;
display
:
flex
;
margin
:
0
;
margin
:
0
;
...
...
src/ui/Duel/Message/CardModal/Desc.scss
0 → 100644
View file @
b0ba8861
.card-modal-desc
{
line-height
:
1
.6
;
font-size
:
15px
;
font-family
:
var
(
--
theme-font
);
max-height
:
calc
(
100%
-
237px
);
overflow-y
:
overlay
;
&
:hover
{
&
:
:-
webkit-scrollbar-thumb
{
background
:
#535353
;
}
}
&
>
div
{
margin-bottom
:
6px
;
}
&
:
:-
webkit-scrollbar
{
/*滚动条整体样式*/
width
:
6px
;
/*高宽分别对应横竖滚动条的尺寸*/
height
:
1px
;
}
&
:
:-
webkit-scrollbar-thumb
{
/*滚动条里面小方块*/
border-radius
:
10px
;
background
:
#535353
3b
;
cursor
:
pointer
;
}
.maro-item
{
display
:
flex
;
gap
:
8px
;
}
}
src/ui/Duel/Message/CardModal/Desc.tsx
0 → 100644
View file @
b0ba8861
import
"
./Desc.scss
"
;
import
{
Fragment
}
from
"
react
"
;
export
const
Desc
:
React
.
FC
<
{
desc
?:
string
}
>
=
({
desc
=
""
})
=>
{
if
(
!
desc
)
return
<></>;
return
(
<
div
className=
"card-modal-desc"
>
{
/* https://125naroom.com/web/2877 */
}
{
/* 牛逼的丸文字css教程 */
}
<
RegexWrapper
text=
{
addSpaces
(
desc
)
}
re=
{
/
(
①|②|③|④|⑤|⑥|⑦|⑧|⑨|⑩
)
:.+
?(?=((
①|②|③|④|⑤|⑥|⑦|⑧|⑨|⑩
)
:|$
))
/g
s
}
Wrapper=
{
MaroListItem
}
/>
</
div
>
);
};
const
RegexWrapper
:
React
.
FC
<
{
text
:
string
;
re
:
RegExp
;
Wrapper
:
React
.
FunctionComponent
<
any
>
;
}
>
=
({
text
,
re
,
Wrapper
})
=>
{
const
matches
=
text
.
match
(
re
);
if
(
!
matches
)
return
<>
{
text
}
</>;
const
sepRe
=
new
RegExp
(
matches
?.
reduce
((
acc
,
cur
)
=>
`
${
acc
}
|
${
cur
}
`
)
??
""
);
const
parts
=
text
.
split
(
sepRe
);
return
(
<>
{
parts
.
map
((
part
,
index
)
=>
(
<
Fragment
key=
{
`${part}-${index}`
}
>
<
div
>
{
part
}
</
div
>
{
index
!==
parts
.
length
-
1
&&
<
Wrapper
>
{
matches
?.[
index
]
}
</
Wrapper
>
}
</
Fragment
>
))
}
</>
);
};
const
MaroListItem
:
React
.
FC
<
{
children
:
string
}
>
=
({
children
})
=>
{
return
(
<
div
className=
"maro-item"
>
<
span
>
{
children
[
0
]
}
</
span
>
<
span
>
<
RegexWrapper
text=
{
children
.
slice
(
2
)
}
re=
{
/●.+
?(?=(
●|$
))
/g
s
}
Wrapper=
{
CircleListItem
}
/>
</
span
>
</
div
>
);
};
const
CircleListItem
:
React
.
FC
<
{
children
:
string
}
>
=
({
children
})
=>
{
return
children
?
(
<
div
className=
"maro-item"
>
<
span
>
{
children
[
0
]
}
</
span
>
<
span
>
{
children
.
slice
(
1
)
}
</
span
>
</
div
>
)
:
(
<></>
);
};
function
addSpaces
(
str
:
string
):
string
{
const
regex
=
/
\d
+/g
;
return
str
.
replace
(
regex
,
(
match
)
=>
`
${
match
}
`
);
}
src/ui/Duel/Message/CardModal/index.scss
0 → 100644
View file @
b0ba8861
@import
url("https://fonts.googleapis.com/css2?family=Electrolize&display=swap")
;
.card-modal-root
{
--theme-font
:
"Electrolize"
,
sans-serif
;
.ant-drawer-content-wrapper
{
box-shadow
:
none
;
}
.card-modal-drawer
{
width
:
90%
;
left
:
10%
;
--height
:
640px
;
top
:
calc
((
100%
-
var
(
--
height
))
/
2
);
height
:
var
(
--
height
);
position
:
relative
;
border-radius
:
6px
;
background
:
#242424
;
.ant-drawer-header
{
padding
:
10px
0
;
button
{
margin-right
:
0
;
}
.ant-drawer-header-title
{
flex-direction
:
row-reverse
;
padding-left
:
24px
;
}
}
}
.card-modal-container
{
position
:
relative
;
height
:
100%
;
}
}
.card-modal-name
{
font-weight
:
bold
;
font-size
:
1
.2rem
;
}
.atkLine
{
.title
,
.number
{
font-family
:
var
(
--
theme-font
);
}
.number
{
font-size
:
30px
;
line-height
:
36px
;
}
}
.attline
{
display
:
flex
;
flex-wrap
:
wrap
;
row-gap
:
10px
;
}
.card-modal-info
{
justify-content
:
space-between
;
position
:
relative
;
height
:
204px
;
// TODO - fix this
}
src/ui/Duel/Message/CardModal.tsx
→
src/ui/Duel/Message/CardModal
/index
.tsx
View file @
b0ba8861
import
"
@/styles/card-modal.scss
"
;
import
"
@/styles/card-modal.scss
"
;
import
classnames
from
"
classnames
"
;
import
classnames
from
"
classnames
"
;
import
React
from
"
react
"
;
import
React
,
{
FC
}
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
fetchStrings
,
sendSelectIdleCmdResponse
}
from
"
@/api
"
;
import
{
fetchStrings
,
sendSelectIdleCmdResponse
}
from
"
@/api
"
;
...
@@ -13,12 +13,21 @@ import {
...
@@ -13,12 +13,21 @@ import {
extraCardTypes
,
extraCardTypes
,
Race2StringCodeMap
,
Race2StringCodeMap
,
Type2StringCodeMap
,
Type2StringCodeMap
,
}
from
"
../../../common
"
;
}
from
"
../../../../common
"
;
import
{
EffectButton
}
from
"
./EffectButton
"
;
import
{
EffectButton
}
from
"
../EffectButton
"
;
import
{
Drawer
,
Space
,
Tag
,
Divider
,
Timeline
,
Typography
}
from
"
antd
"
;
import
{
LeftOutlined
}
from
"
@ant-design/icons
"
;
import
"
./index.scss
"
;
import
{
YgoCard
}
from
"
@/ui/Shared
"
;
import
{
Desc
}
from
"
./Desc
"
;
const
{
cardModal
}
=
messageStore
;
const
{
cardModal
}
=
messageStore
;
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
const
CARD_WIDTH
=
200
;
const
CARD_WIDTH
=
140
;
const
{
Title
,
Paragraph
,
Text
,
Link
}
=
Typography
;
export
const
CardModal
=
()
=>
{
export
const
CardModal
=
()
=>
{
const
snap
=
useSnapshot
(
cardModal
);
const
snap
=
useSnapshot
(
cardModal
);
...
@@ -35,9 +44,6 @@ export const CardModal = () => {
...
@@ -35,9 +44,6 @@ export const CardModal = () => {
const
def
=
meta
?.
data
.
def
;
const
def
=
meta
?.
data
.
def
;
const
counters
=
snap
.
counters
;
const
counters
=
snap
.
counters
;
const
imgUrl
=
meta
?.
id
?
`
${
NeosConfig
.
cardImgUrl
}
/
${
meta
.
id
}
.jpg`
:
undefined
;
const
nonEffectInteractivies
=
snap
.
interactivies
.
filter
(
const
nonEffectInteractivies
=
snap
.
interactivies
.
filter
(
(
item
)
=>
item
.
desc
!=
"
发动效果
"
(
item
)
=>
item
.
desc
!=
"
发动效果
"
);
);
...
@@ -46,27 +52,43 @@ export const CardModal = () => {
...
@@ -46,27 +52,43 @@ export const CardModal = () => {
);
);
return
(
return
(
<
div
// TODO: 宽度要好好设置 根据屏幕宽度
className=
{
classnames
(
"
card-modal
"
)
}
<
Drawer
style=
{
open=
{
isOpen
}
{
placement=
"left"
"
--visibility
"
:
isOpen
?
"
visible
"
:
"
hidden
"
,
onClose=
{
()
=>
(
cardModal
.
isOpen
=
false
)
}
"
--opacity
"
:
isOpen
?
1
:
0
,
rootClassName=
"card-modal-root"
}
as
any
className=
"card-modal-drawer"
}
headerStyle=
{
{}
}
mask=
{
false
}
title=
{
name
}
closeIcon=
{
<
LeftOutlined
/>
}
>
>
<
div
className=
"card-modal-container"
>
<
div
className=
"card-modal-container"
>
<
img
src=
{
imgUrl
}
width=
{
CARD_WIDTH
}
/>
<
Space
<
div
className=
"card-modal-name"
>
{
name
}
</
div
>
align=
"start"
<
AttLine
size=
{
18
}
types=
{
extraCardTypes
(
types
||
0
)
}
style=
{
{
position
:
"
relative
"
,
display
:
"
flex
"
}
}
race=
{
race
}
>
attribute=
{
attribute
}
<
YgoCard
/>
code=
{
meta
?.
id
}
<
AtkLine
atk=
{
atk
}
def=
{
def
}
/>
width=
{
CARD_WIDTH
}
<
CounterLine
counters=
{
counters
}
/>
style=
{
{
borderRadius
:
4
}
}
<
div
className=
"card-modal-effect"
>
{
desc
}
</
div
>
/>
{
nonEffectInteractivies
.
map
((
interactive
,
idx
)
=>
{
<
Space
direction=
"vertical"
className=
"card-modal-info"
>
<
AtkLine
atk=
{
atk
}
def=
{
def
}
/>
<
AttLine
types=
{
extraCardTypes
(
types
||
0
)
}
race=
{
race
}
attribute=
{
attribute
}
/>
{
/* TODO: 只有怪兽卡需要展示攻击防御 */
}
{
/* <CounterLine counters={counters} /> */
}
</
Space
>
</
Space
>
<
Divider
style=
{
{
margin
:
"
14px 0
"
}
}
></
Divider
>
<
Desc
desc=
{
desc
}
/>
{
/* {nonEffectInteractivies.map((interactive, idx) => {
return (
return (
<button
<button
key={idx}
key={idx}
...
@@ -85,9 +107,9 @@ export const CardModal = () => {
...
@@ -85,9 +107,9 @@ export const CardModal = () => {
</button>
</button>
);
);
})}
})}
<
EffectButton
meta=
{
meta
}
effectInteractivies=
{
effectInteractivies
}
/>
<EffectButton meta={meta} effectInteractivies={effectInteractivies} />
*/
}
</
div
>
</
div
>
</
div
>
</
Drawer
>
);
);
};
};
...
@@ -98,24 +120,36 @@ const AttLine = (props: {
...
@@ -98,24 +120,36 @@ const AttLine = (props: {
})
=>
{
})
=>
{
const
race
=
props
.
race
const
race
=
props
.
race
?
fetchStrings
(
"
!system
"
,
Race2StringCodeMap
.
get
(
props
.
race
)
||
0
)
?
fetchStrings
(
"
!system
"
,
Race2StringCodeMap
.
get
(
props
.
race
)
||
0
)
:
"
?
"
;
:
undefined
;
const
attribute
=
props
.
attribute
const
attribute
=
props
.
attribute
?
fetchStrings
(
"
!system
"
,
Attribute2StringCodeMap
.
get
(
props
.
attribute
)
||
0
)
?
fetchStrings
(
"
!system
"
,
Attribute2StringCodeMap
.
get
(
props
.
attribute
)
||
0
)
:
"
?
"
;
:
undefined
;
const
types
=
props
.
types
const
types
=
props
.
types
.
map
((
t
)
=>
fetchStrings
(
"
!system
"
,
Type2StringCodeMap
.
get
(
t
)
||
0
))
.
map
((
t
)
=>
fetchStrings
(
"
!system
"
,
Type2StringCodeMap
.
get
(
t
)
||
0
))
.
join
(
"
|
"
);
.
join
(
"
/
"
);
return
(
return
(
<
div
className=
"card-modal-attribute"
>
{
`【 ${race} / ${types} 】【 ${attribute} 】`
}
</
div
>
<
div
className=
"attline"
>
{
attribute
&&
<
Tag
>
{
attribute
}
</
Tag
>
}
{
race
&&
<
Tag
>
{
race
}
</
Tag
>
}
{
types
&&
<
Tag
>
{
types
}
</
Tag
>
}
</
div
>
);
);
};
};
const
AtkLine
=
(
props
:
{
atk
?:
number
;
def
?:
number
})
=>
(
const
AtkLine
=
(
props
:
{
atk
?:
number
;
def
?:
number
})
=>
(
<
div
className=
"card-modal-atk"
>
{
`ATK/${
<
Space
size=
{
10
}
className=
"atkLine"
direction=
"vertical"
>
props.atk !== undefined ? props.atk : "?"
<
div
>
} DEF/${props.def !== undefined ? props.def : "?"}`
}
</
div
>
<
div
className=
"title"
>
ATK
</
div
>
<
div
className=
"number"
>
{
props
.
atk
??
"
?
"
}
</
div
>
</
div
>
<
div
>
<
div
className=
"title"
>
DEF
</
div
>
<
div
className=
"number"
>
{
props
.
def
??
"
?
"
}
</
div
>
</
div
>
</
Space
>
);
);
// TODO: 未完成
const
CounterLine
=
(
props
:
{
counters
:
{
[
type
:
number
]:
number
}
})
=>
{
const
CounterLine
=
(
props
:
{
counters
:
{
[
type
:
number
]:
number
}
})
=>
{
const
counters
=
[];
const
counters
=
[];
for
(
const
counterType
in
props
.
counters
)
{
for
(
const
counterType
in
props
.
counters
)
{
...
...
src/ui/Duel/Message/NewSelectActionModal/index.tsx
View file @
b0ba8861
...
@@ -186,7 +186,18 @@ export const NewSelectActionsModal: FC = () => {
...
@@ -186,7 +186,18 @@ export const NewSelectActionsModal: FC = () => {
<
Tooltip
title=
{
card
.
effectDesc
}
placement=
"bottom"
key=
{
j
}
>
<
Tooltip
title=
{
card
.
effectDesc
}
placement=
"bottom"
key=
{
j
}
>
<
div
>
<
div
>
<
CheckCard
<
CheckCard
cover=
{
<
YgoCard
code=
{
card
.
meta
.
id
}
/>
}
cover=
{
<
YgoCard
code=
{
card
.
meta
.
id
}
style=
{
{
width
:
"
100%
"
,
height
:
"
100%
"
,
position
:
"
absolute
"
,
left
:
0
,
top
:
0
,
}
}
/>
}
style=
{
{
style=
{
{
width
:
100
,
width
:
100
,
aspectRatio
:
5.9
/
8.6
,
aspectRatio
:
5.9
/
8.6
,
...
...
src/ui/Duel/PlayMat/Bg/index.scss
View file @
b0ba8861
...
@@ -19,7 +19,7 @@ section#mat {
...
@@ -19,7 +19,7 @@ section#mat {
height
:
var
(
--
block-height-m
);
height
:
var
(
--
block-height-m
);
width
:
var
(
--
block-width
);
width
:
var
(
--
block-width
);
// background-color: rgba(128, 128, 128, 0.447);
// background-color: rgba(128, 128, 128, 0.447);
background
:
radial-gradient
(
#
262626
,
#303030
);
background
:
radial-gradient
(
#
1d1d1d
,
#222
);
// box-shadow: 0 0 0 1px purple;
// box-shadow: 0 0 0 1px purple;
position
:
relative
;
position
:
relative
;
&
.extra
{
&
.extra
{
...
@@ -39,8 +39,8 @@ section#mat {
...
@@ -39,8 +39,8 @@ section#mat {
.triangle
{
.triangle
{
width
:
0
;
width
:
0
;
height
:
0
;
height
:
0
;
--color
:
#
444444
;
--color
:
#
333
;
border-width
:
5
px
;
border-width
:
4
px
;
border-style
:
solid
;
border-style
:
solid
;
position
:
absolute
;
position
:
absolute
;
&
:nth-of-type
(
1
)
{
&
:nth-of-type
(
1
)
{
...
...
src/ui/Duel/PlayMat/Card/index.scss
View file @
b0ba8861
section
#mat
{
section
#mat
{
.mat-card
{
.mat-card
{
position
:
absolute
;
position
:
absolute
;
// left: 50%;
// top: 50%;
--card-height
:
100px
;
--card-height
:
100px
;
width
:
auto
!
important
;
height
:
var
(
--
card-height
);
height
:
var
(
--
card-height
);
aspect-ratio
:
var
(
--
card-ratio
);
aspect-ratio
:
var
(
--
card-ratio
);
transform-style
:
preserve-3d
;
transform-style
:
preserve-3d
;
...
@@ -16,9 +15,14 @@ section#mat {
...
@@ -16,9 +15,14 @@ section#mat {
width
:
96%
;
width
:
96%
;
transform
:
translateZ
(
calc
(
var
(
--
z
)
*
1px
+
0
.1px
))
transform
:
translateZ
(
calc
(
var
(
--
z
)
*
1px
+
0
.1px
))
rotateY
(
calc
(
var
(
--
ry
)
*
1deg
));
rotateY
(
calc
(
var
(
--
ry
)
*
1deg
));
transition
:
0
.2s
scale
;
cursor
:
pointer
;
&
:hover
{
scale
:
1
.05
;
}
.card-cover
,
.card-cover
,
.card-back
{
.card-back
{
width
:
100%
;
width
:
100%
!
important
;
height
:
100%
;
height
:
100%
;
position
:
absolute
;
position
:
absolute
;
left
:
0
;
left
:
0
;
...
...
src/ui/Duel/PlayMat/Card/springs/moveToHand.ts
View file @
b0ba8861
...
@@ -44,7 +44,7 @@ export const moveToHand = async (props: { card: CardType; api: SpringApi }) => {
...
@@ -44,7 +44,7 @@ export const moveToHand = async (props: { card: CardType; api: SpringApi }) => {
const
negativeX
=
Math
.
sin
(
angle
)
*
r
;
const
negativeX
=
Math
.
sin
(
angle
)
*
r
;
const
negativeY
=
Math
.
cos
(
angle
)
*
r
+
HAND_CARD_HEIGHT
.
value
/
2
;
const
negativeY
=
Math
.
cos
(
angle
)
*
r
+
HAND_CARD_HEIGHT
.
value
/
2
;
const
x
=
hand_circle_center_x
+
negativeX
*
(
isMe
(
controller
)
?
1
:
-
1
);
const
x
=
hand_circle_center_x
+
negativeX
*
(
isMe
(
controller
)
?
1
:
-
1
);
const
y
=
hand_circle_center_y
-
negativeY
+
1
3
0
;
// 常量 是手动调的 这里肯定有问题 有空来修
const
y
=
hand_circle_center_y
-
negativeY
+
1
4
0
;
// 常量 是手动调的 这里肯定有问题 有空来修
const
_rz
=
(
angle
*
180
)
/
Math
.
PI
;
const
_rz
=
(
angle
*
180
)
/
Math
.
PI
;
...
...
src/ui/Duel/PlayMat/utils/cssConfig.ts
View file @
b0ba8861
...
@@ -61,7 +61,7 @@ export const matConfig = {
...
@@ -61,7 +61,7 @@ export const matConfig = {
unit
:
UNIT
.
PX
,
unit
:
UNIT
.
PX
,
},
},
HAND_CARD_HEIGHT
:
{
HAND_CARD_HEIGHT
:
{
value
:
1
2
0
,
value
:
1
4
0
,
unit
:
UNIT
.
PX
,
unit
:
UNIT
.
PX
,
},
},
DECK_OFFSET_X
:
{
DECK_OFFSET_X
:
{
...
...
src/ui/Shared/YgoCard/index.scss
View file @
b0ba8861
.skeleton-cover
{
.skeleton-cover
{
background-color
:
gray
;
background-color
:
gray
;
}
}
.ygo-card
{
width
:
100%
;
height
:
100%
;
position
:
absolute
;
left
:
0
;
top
:
0
;
}
src/ui/Shared/YgoCard/index.tsx
View file @
b0ba8861
...
@@ -10,23 +10,30 @@ interface Props {
...
@@ -10,23 +10,30 @@ interface Props {
isBack
?:
boolean
;
isBack
?:
boolean
;
code
?:
number
;
code
?:
number
;
style
?:
CSSProperties
;
style
?:
CSSProperties
;
width
?:
number
;
}
}
export
const
YgoCard
:
FC
<
Props
>
=
(
props
)
=>
{
export
const
YgoCard
:
FC
<
Props
>
=
(
props
)
=>
{
const
{
className
,
code
:
cardCode
=
0
,
isBack
=
false
,
style
}
=
props
;
const
{
className
,
code
:
cardCode
=
0
,
isBack
=
false
,
width
=
80
,
style
,
}
=
props
;
return
useMemo
(
return
useMemo
(
()
=>
(
()
=>
(
<>
<>
{
cardCode
===
0
&&
!
isBack
?
(
{
cardCode
===
0
&&
!
isBack
?
(
<
div
<
div
className=
{
classNames
(
"
ygo-card
"
,
"
skeleton-cover
"
)
}
className=
{
classNames
(
"
ygo-card
"
,
"
skeleton-cover
"
)
}
style=
{
style
}
style=
{
{
width
,
...
style
}
}
/>
/>
)
:
(
)
:
(
<
img
<
img
className=
{
classNames
(
"
ygo-card
"
,
className
)
}
className=
{
classNames
(
"
ygo-card
"
,
className
)
}
src=
{
getCardImgUrl
(
cardCode
,
isBack
)
}
src=
{
getCardImgUrl
(
cardCode
,
isBack
)
}
style=
{
style
}
style=
{
{
width
,
...
style
}
}
/>
/>
)
}
)
}
</>
</>
...
...
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