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
e001cd31
Commit
e001cd31
authored
Aug 16, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: small
parent
3a9b2d64
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
4 deletions
+28
-4
src/ui/Duel/PlayMat/Card/index.tsx
src/ui/Duel/PlayMat/Card/index.tsx
+1
-0
src/ui/Shared/YgoCard/index.module.scss
src/ui/Shared/YgoCard/index.module.scss
+13
-0
src/ui/Shared/YgoCard/index.tsx
src/ui/Shared/YgoCard/index.tsx
+14
-4
No files found.
src/ui/Duel/PlayMat/Card/index.tsx
View file @
e001cd31
...
@@ -313,6 +313,7 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
...
@@ -313,6 +313,7 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
>
>
<
YgoCard
<
YgoCard
className=
{
styles
.
cover
}
className=
{
styles
.
cover
}
cardName=
{
snap
.
meta
.
text
.
name
}
code=
{
snap
.
code
===
0
?
snap
.
meta
.
id
:
snap
.
code
}
code=
{
snap
.
code
===
0
?
snap
.
meta
.
id
:
snap
.
code
}
/>
/>
<
YgoCard
className=
{
styles
.
back
}
isBack
/>
<
YgoCard
className=
{
styles
.
back
}
isBack
/>
...
...
src/ui/Shared/YgoCard/index.module.scss
View file @
e001cd31
.ygo-card
{
.ygo-card
{
color
:
white
;
aspect-ratio
:
var
(
--
card-ratio
);
aspect-ratio
:
var
(
--
card-ratio
);
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
12px
;
padding
:
5px
;
line-height
:
1
.75em
;
overflow
:
hidden
;
//超出的文本隐藏
text-overflow
:
ellipsis
;
//溢出用省略号显示
background-color
:
#313746
;
background-image
:
var
(
--
src
);
background-size
:
contain
;
text-align
:
center
;
}
}
src/ui/Shared/YgoCard/index.tsx
View file @
e001cd31
...
@@ -9,6 +9,7 @@ interface Props {
...
@@ -9,6 +9,7 @@ interface Props {
className
?:
string
;
className
?:
string
;
isBack
?:
boolean
;
isBack
?:
boolean
;
code
?:
number
;
code
?:
number
;
cardName
?:
string
;
style
?:
CSSProperties
;
style
?:
CSSProperties
;
width
?:
number
;
width
?:
number
;
onClick
?:
()
=>
void
;
onClick
?:
()
=>
void
;
...
@@ -19,6 +20,7 @@ export const YgoCard: React.FC<Props> = (props) => {
...
@@ -19,6 +20,7 @@ export const YgoCard: React.FC<Props> = (props) => {
const
{
const
{
className
,
className
,
code
=
0
,
code
=
0
,
cardName
,
isBack
=
false
,
isBack
=
false
,
width
,
width
,
style
,
style
,
...
@@ -27,14 +29,22 @@ export const YgoCard: React.FC<Props> = (props) => {
...
@@ -27,14 +29,22 @@ export const YgoCard: React.FC<Props> = (props) => {
}
=
props
;
}
=
props
;
return
useMemo
(
return
useMemo
(
()
=>
(
()
=>
(
<
img
<
div
className=
{
classNames
(
styles
[
"
ygo-card
"
],
className
)
}
className=
{
classNames
(
styles
[
"
ygo-card
"
],
className
)
}
src=
{
getCardImgUrl
(
code
,
isBack
)
}
style=
{
style=
{
{
width
,
...
style
}
}
{
width
,
"
--src
"
:
`url(${getCardImgUrl(code, isBack)})`
,
...
style
,
}
as
any
}
onClick=
{
onClick
}
onClick=
{
onClick
}
// 加载完成
// 加载完成
onLoad=
{
onLoad
}
onLoad=
{
onLoad
}
/>
>
{
/* 暂时不能这么写...但如果用onload的话来判断可能又很消耗性能,再看看吧 */
}
{
/* {cardName} */
}
</
div
>
),
),
[
code
],
[
code
],
);
);
...
...
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