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
4a641b35
Commit
4a641b35
authored
Apr 29, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add outer block
parent
3400fea1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
4 deletions
+50
-4
src/styles/mat.css
src/styles/mat.css
+8
-0
src/ui/Duel/PlayMat2/Block.tsx
src/ui/Duel/PlayMat2/Block.tsx
+34
-2
src/ui/Duel/PlayMat2/Mat.tsx
src/ui/Duel/PlayMat2/Mat.tsx
+8
-2
No files found.
src/styles/mat.css
View file @
4a641b35
...
@@ -165,6 +165,14 @@ button:focus-visible {
...
@@ -165,6 +165,14 @@ button:focus-visible {
gap
:
var
(
--block-column-gap
);
gap
:
var
(
--block-column-gap
);
}
}
.block-left
{
margin-left
:
calc
((
var
(
--block-width
)
+
var
(
--block-column-gap
))
*
-1
);
}
.block-right
{
margin-right
:
calc
((
var
(
--block-width
)
+
var
(
--block-column-gap
))
*
-1
);
}
#board-bg
{
#board-bg
{
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
...
...
src/ui/Duel/PlayMat2/Block.tsx
View file @
4a641b35
...
@@ -9,10 +9,20 @@ export const Block: React.FC<{
...
@@ -9,10 +9,20 @@ export const Block: React.FC<{
isExtra
?:
boolean
;
isExtra
?:
boolean
;
highlight
?:
boolean
;
highlight
?:
boolean
;
onClick
?:
MouseEventHandler
;
onClick
?:
MouseEventHandler
;
}
>
=
({
isExtra
=
false
,
highlight
=
false
,
onClick
})
=>
(
outerLeft
?:
boolean
;
outerRight
?:
boolean
;
}
>
=
({
isExtra
=
false
,
highlight
=
false
,
onClick
,
outerLeft
=
false
,
outerRight
=
false
,
})
=>
(
<
div
<
div
className=
{
classnames
(
"
block
"
,
{
className=
{
classnames
(
"
block
"
,
{
"
block-extra
"
:
isExtra
,
"
block-extra
"
:
isExtra
,
"
block-left
"
:
outerLeft
,
"
block-right
"
:
outerRight
,
})
}
})
}
style=
{
style=
{
{
{
...
@@ -23,9 +33,22 @@ export const Block: React.FC<{
...
@@ -23,9 +33,22 @@ export const Block: React.FC<{
/>
/>
);
);
export
function
BlockRow
<
T
extends
DuelFieldState
>
(
props
:
{
states
:
T
})
{
export
function
BlockRow
<
T
extends
DuelFieldState
>
(
props
:
{
states
:
T
;
leftState
?:
CardState
;
rightState
?:
CardState
;
})
{
return
(
return
(
<
div
className=
"block-row"
>
<
div
className=
"block-row"
>
{
props
.
leftState
?
(
<
Block
highlight=
{
props
.
leftState
.
placeInteractivity
!==
undefined
}
onClick=
{
()
=>
{}
}
outerLeft
/>
)
:
(
<></>
)
}
{
props
.
states
.
map
((
block
,
idx
)
=>
(
{
props
.
states
.
map
((
block
,
idx
)
=>
(
<
Block
<
Block
key=
{
idx
}
key=
{
idx
}
...
@@ -35,6 +58,15 @@ export function BlockRow<T extends DuelFieldState>(props: { states: T }) {
...
@@ -35,6 +58,15 @@ export function BlockRow<T extends DuelFieldState>(props: { states: T }) {
}
}
}
}
/>
/>
))
}
))
}
{
props
.
rightState
?
(
<
Block
highlight=
{
props
.
rightState
.
placeInteractivity
!==
undefined
}
onClick=
{
()
=>
{}
}
outerRight
/>
)
:
(
<></>
)
}
</
div
>
</
div
>
);
);
}
}
...
...
src/ui/Duel/PlayMat2/Mat.tsx
View file @
4a641b35
...
@@ -24,14 +24,20 @@ export const Mat = () => {
...
@@ -24,14 +24,20 @@ export const Mat = () => {
<
div
id=
"board"
>
<
div
id=
"board"
>
<
div
id=
"board-bg"
>
<
div
id=
"board-bg"
>
<
BlockRow
states=
{
magics
.
op
.
slice
(
0
,
5
)
as
DuelFieldState
}
/>
<
BlockRow
states=
{
magics
.
op
.
slice
(
0
,
5
)
as
DuelFieldState
}
/>
<
BlockRow
states=
{
monsters
.
op
.
slice
(
0
,
5
)
as
DuelFieldState
}
/>
<
BlockRow
states=
{
monsters
.
op
.
slice
(
0
,
5
)
as
DuelFieldState
}
rightState=
{
magics
.
op
[
5
]
as
CardState
}
/>
<
ExtraBlockRow
<
ExtraBlockRow
meLeft=
{
monsters
.
me
[
5
]
as
CardState
}
meLeft=
{
monsters
.
me
[
5
]
as
CardState
}
meRight=
{
monsters
.
me
[
6
]
as
CardState
}
meRight=
{
monsters
.
me
[
6
]
as
CardState
}
opLeft=
{
monsters
.
op
[
5
]
as
CardState
}
opLeft=
{
monsters
.
op
[
5
]
as
CardState
}
opRight=
{
monsters
.
op
[
6
]
as
CardState
}
opRight=
{
monsters
.
op
[
6
]
as
CardState
}
/>
/>
<
BlockRow
states=
{
monsters
.
me
.
slice
(
0
,
5
)
as
DuelFieldState
}
/>
<
BlockRow
states=
{
monsters
.
me
.
slice
(
0
,
5
)
as
DuelFieldState
}
leftState=
{
magics
.
me
[
5
]
as
CardState
}
/>
<
BlockRow
states=
{
magics
.
me
.
slice
(
0
,
5
)
as
DuelFieldState
}
/>
<
BlockRow
states=
{
magics
.
me
.
slice
(
0
,
5
)
as
DuelFieldState
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
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