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
cdb54980
Commit
cdb54980
authored
Aug 15, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: small
parent
3a9b2d64
Pipeline
#23141
passed with stages
in 13 minutes and 47 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
68 additions
and
19 deletions
+68
-19
src/common.ts
src/common.ts
+5
-0
src/styles/core.scss
src/styles/core.scss
+2
-1
src/ui/BuildDeck/CardDetail.module.scss
src/ui/BuildDeck/CardDetail.module.scss
+21
-9
src/ui/BuildDeck/CardDetail.tsx
src/ui/BuildDeck/CardDetail.tsx
+34
-4
src/ui/BuildDeck/index.module.scss
src/ui/BuildDeck/index.module.scss
+4
-1
src/ui/Shared/CardEffectText/index.module.scss
src/ui/Shared/CardEffectText/index.module.scss
+2
-2
src/ui/Shared/CardEffectText/index.tsx
src/ui/Shared/CardEffectText/index.tsx
+0
-2
No files found.
src/common.ts
View file @
cdb54980
...
...
@@ -145,6 +145,11 @@ export function isLinkMonster(typeCode: number): boolean {
return
(
typeCode
&
TYPE_LINK
)
>
0
;
}
/** 判断是灵摆怪兽 */
export
function
isPendulumMonster
(
typeCode
:
number
):
boolean
{
return
(
typeCode
&
TYPE_PENDULUM
)
>
0
;
}
// 属性
// const ATTRIBUTE_ALL = 0x7f; //
const
ATTRIBUTE_EARTH
=
0x01
;
//
...
...
src/styles/core.scss
View file @
cdb54980
@charset
"utf-8"
;
@import
url("https://fonts.font.im/css2?family=Electrolize&display=swap")
;
@import
url("https://fonts.font.im/css2?family=Electrolize&
family=Noto+Serif+SC:wght@700&
display=swap")
;
body
{
color-scheme
:
dark
;
...
...
@@ -16,6 +16,7 @@ body {
right
:
0
;
font-family
:
var
(
--
theme-font
);
--theme-font
:
"Electrolize"
,
sans-serif
;
--nato-serif-font
:
"Noto Serif SC"
,
serif
;
--header-height
:
56px
;
#root
{
height
:
100%
;
...
...
src/ui/BuildDeck/CardDetail.module.scss
View file @
cdb54980
...
...
@@ -17,14 +17,21 @@
.container
{
height
:
100%
;
background-color
:
hsla
(
0
,
0%
,
100%
,
0
.1
);
box-shadow
:
0
0
0
1px
rgba
(
255
,
255
,
255
,
0
.2
)
,
0
0
30px
0
#ffffff
54
;
background
:
linear-gradient
(
to
bottom
right
,
hsla
(
0
,
0%
,
100%
,
0
.2
)
,
hsla
(
0
,
0%
,
100%
,
0
)
);
box-shadow
:
-1px
0
0
2px
rgba
(
255
,
255
,
255
,
0
.15
)
,
0
0
30px
0
#ffffff
54
;
backdrop-filter
:
blur
(
20px
);
@include
utils
.
noise-bg
;
padding
:
15px
;
display
:
flex
;
flex-direction
:
column
;
position
:
relative
;
border-radius
:
8px
;
}
.btn-close
{
...
...
@@ -40,17 +47,23 @@
flex-shrink
:
0
;
border-radius
:
4px
;
overflow
:
hidden
;
box-shadow
:
0px
14px
20px
-5px
rgba
(
0
,
0
,
0
,
0
.3
);
transition
:
0
.2s
;
box-shadow
:
0
0px
0px
-15px
#5a627a
,
0
0px
5px
-30px
#41485f
;
transition
:
0
.3s
;
cursor
:
pointer
;
&
:hover
{
--width
:
220px
;
box-shadow
:
0px
20px
20px
-5px
rgb
(
0
0
0
/
60%
);
--width
:
200px
;
filter
:
contrast
(
1
.1
);
box-shadow
:
25px
0px
2px
-15px
#5a627a
,
50px
0px
5px
-30px
#41485f
;
}
}
.title
{
font-size
:
16
px
;
font-family
:
var
(
--
theme
-font
);
font-size
:
20
px
;
font-family
:
var
(
--
nato-serif
-font
);
margin
:
20px
0
15px
;
display
:
flex
;
justify-content
:
space-between
;
...
...
@@ -58,6 +71,5 @@
}
.content
{
// font-size: ;
color
:
white
;
}
src/ui/BuildDeck/CardDetail.tsx
View file @
cdb54980
...
...
@@ -10,6 +10,7 @@ import {
isMonster
,
Race2StringCodeMap
,
Type2StringCodeMap
,
isPendulumMonster
,
}
from
"
@/common
"
;
import
{
CardEffectText
,
IconFont
,
ScrollableArea
,
YgoCard
}
from
"
@/ui/Shared
"
;
...
...
@@ -31,6 +32,14 @@ export const CardDetail: React.FC<{
.
join
(
"
/
"
),
[
card
?.
data
.
type
],
);
const
desc
=
useMemo
(
()
=>
isPendulumMonster
(
card
?.
data
.
type
??
0
)
?
processPendulumString
(
card
?.
text
.
desc
??
""
)
:
[
card
?.
text
.
desc
],
[
card
?.
text
.
desc
],
);
return
(
<
div
className=
{
classNames
(
styles
.
detail
,
{
[
styles
.
open
]:
open
})
}
>
<
div
className=
{
styles
.
container
}
>
...
...
@@ -40,7 +49,9 @@ export const CardDetail: React.FC<{
type=
"text"
onClick=
{
onClose
}
/>
<
YgoCard
className=
{
styles
.
card
}
code=
{
code
}
/>
<
a
href=
{
`https://ygocdb.com/card/${code}`
}
target=
"_blank"
>
<
YgoCard
className=
{
styles
.
card
}
code=
{
code
}
/>
</
a
>
<
div
className=
{
styles
.
title
}
>
<
span
>
{
card
?.
text
.
name
}
</
span
>
{
/* <Avatar size={22}>光</Avatar> */
}
...
...
@@ -87,12 +98,31 @@ export const CardDetail: React.FC<{
)
}
</
Descriptions
>
<
Descriptions
layout=
"vertical"
size=
"small"
>
<
Descriptions
.
Item
label=
"卡片效果"
span=
{
3
}
>
<
CardEffectText
desc=
{
card
?.
text
.
desc
}
/>
</
Descriptions
.
Item
>
{
desc
.
filter
(
Boolean
).
map
((
d
,
i
)
=>
(
<
Descriptions
.
Item
label=
{
desc
.
length
>
1
?
(
i
?
"
怪兽效果
"
:
"
灵摆效果
"
)
:
"
卡片效果
"
}
span=
{
3
}
key=
{
i
}
>
<
CardEffectText
desc=
{
d
}
/>
</
Descriptions
.
Item
>
))
}
</
Descriptions
>
</
ScrollableArea
>
</
div
>
</
div
>
);
};
function
processPendulumString
(
input
:
string
):
string
[]
{
// 删除形如“← ... →”的结构
const
withoutArrows
=
input
.
replace
(
/←.*
?
→/g
,
""
);
// 以 "【怪兽效果】" 作为分隔符切割字符串
const
splitStrings
=
withoutArrows
.
split
(
"
【怪兽效果】
"
);
// 返回切割后的字符串列表
return
splitStrings
.
map
((
s
)
=>
s
.
trim
());
}
src/ui/BuildDeck/index.module.scss
View file @
cdb54980
...
...
@@ -105,6 +105,10 @@
position
:
relative
;
background-size
:
contain
;
content-visibility
:
auto
;
transition
:
0
.1s
;
&
:hover
{
filter
:
brightness
(
0
.9
);
}
.cardname
{
font-size
:
12px
;
position
:
absolute
;
...
...
@@ -123,7 +127,6 @@
}
.cardcover
{
position
:
relative
;
// z-index: 1;
}
}
...
...
src/ui/Shared/CardEffectText/index.module.scss
View file @
cdb54980
...
...
@@ -3,10 +3,10 @@
font-size
:
14px
;
max-height
:
calc
(
100%
-
237px
);
font-family
:
var
(
--
theme-font
);
white-space
:
pre-wrap
;
.maro-item
{
display
:
flex
;
margin-top
:
8px
;
gap
:
6px
;
gap
:
8px
;
}
}
src/ui/Shared/CardEffectText/index.tsx
View file @
cdb54980
...
...
@@ -72,5 +72,3 @@ function addSpaces(str: string): string {
const
regex
=
/
\d
+/g
;
return
str
.
replace
(
regex
,
(
match
)
=>
`
${
match
}
`
);
}
// function removePendulumPrefix(str: string): string {}
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