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
a00d11f1
Commit
a00d11f1
authored
Aug 10, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: underlying in duel
parent
c295640e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
20 deletions
+73
-20
src/ui/Duel/Main.tsx
src/ui/Duel/Main.tsx
+2
-2
src/ui/Duel/PlayMat/Bg/index.module.scss
src/ui/Duel/PlayMat/Bg/index.module.scss
+1
-1
src/ui/Duel/PlayMat/Underlying/index.module.scss
src/ui/Duel/PlayMat/Underlying/index.module.scss
+33
-0
src/ui/Duel/PlayMat/Underlying/index.tsx
src/ui/Duel/PlayMat/Underlying/index.tsx
+21
-0
src/ui/Duel/PlayMat/index.ts
src/ui/Duel/PlayMat/index.ts
+1
-0
src/ui/Shared/Background/index.tsx
src/ui/Shared/Background/index.tsx
+15
-17
No files found.
src/ui/Duel/Main.tsx
View file @
a00d11f1
...
...
@@ -16,12 +16,12 @@ import {
YesNoModal
,
}
from
"
./Message
"
;
import
{
LifeBar
,
Mat
,
Menu
}
from
"
./PlayMat
"
;
import
{
Background
}
from
"
@/ui/Shared
"
;
import
{
Underlying
}
from
"
./PlayMat
"
;
export
const
Component
:
React
.
FC
=
()
=>
{
return
(
<>
<
Background
/>
<
Underlying
/>
<
SelectActionsModal
/>
<
Alert
/>
<
Menu
/>
...
...
src/ui/Duel/PlayMat/Bg/index.module.scss
View file @
a00d11f1
...
...
@@ -26,7 +26,7 @@
height
:
var
(
--
block-height-s
);
}
&
.highlight
{
background
:
#
102639
;
background
:
#
ffffff
35
;
cursor
:
pointer
;
.triangle
{
--color
:
#006eff
;
...
...
src/ui/Duel/PlayMat/Underlying/index.module.scss
0 → 100644
View file @
a00d11f1
@use
"/src/styles/utils.scss"
;
.background
{
position
:
fixed
;
left
:
0
;
top
:
0
;
height
:
100%
;
max-height
:
100%
;
overflow
:
hidden
;
width
:
100%
;
background-color
:
#010514
;
z-index
:
-1
;
display
:
flex
;
justify-content
:
center
;
@include
utils
.
noise-bg
;
}
.inner
{
transform
:
translateY
(
40%
);
width
:
60vw
;
height
:
100vh
;
background
:
radial-gradient
(
#00814f
,
#1c0161
);
background-size
:
contain
;
background-repeat
:
repeat
;
filter
:
blur
(
502px
);
transition
:
0
.5s
;
}
.opponent
.inner
{
background
:
radial-gradient
(
#ff5100
,
#54005f
98
);
transform
:
translateY
(
-50%
);
filter
:
blur
(
602px
);
opacity
:
0
.8
;
}
src/ui/Duel/PlayMat/Underlying/index.tsx
0 → 100644
View file @
a00d11f1
import
{
useEffect
}
from
"
react
"
;
import
{
createRoot
}
from
"
react-dom/client
"
;
import
{
withPortalToBody
}
from
"
@/ui/Shared
"
;
import
styles
from
"
./index.module.scss
"
;
import
classNames
from
"
classnames
"
;
import
{
matStore
,
isMe
}
from
"
@/stores
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
export
const
Underlying
:
React
.
FC
<
{}
>
=
withPortalToBody
(()
=>
{
const
{
currentPlayer
}
=
useSnapshot
(
matStore
);
return
(
<
div
className=
{
classNames
(
styles
.
background
,
{
[
styles
.
opponent
]:
!
isMe
(
currentPlayer
),
})
}
>
<
div
className=
{
styles
.
inner
}
></
div
>
</
div
>
);
});
src/ui/Duel/PlayMat/index.ts
View file @
a00d11f1
export
*
from
"
./LifeBar
"
;
export
*
from
"
./Mat
"
;
export
*
from
"
./Menu
"
;
export
*
from
"
./Underlying
"
;
src/ui/Shared/Background/index.tsx
View file @
a00d11f1
...
...
@@ -3,23 +3,8 @@ import { createRoot } from "react-dom/client";
import
styles
from
"
./index.module.scss
"
;
const
_Background
:
React
.
FC
<
{
style
?:
React
.
CSSProperties
;
innerStyle
?:
React
.
CSSProperties
;
innerOpacity
?:
number
;
}
>
=
({
style
,
innerStyle
,
innerOpacity
=
1
})
=>
{
return
(
<
div
className=
{
styles
.
background
}
style=
{
style
}
>
<
div
className=
{
styles
.
inner
}
style=
{
{
...
innerStyle
,
opacity
:
innerOpacity
}
}
></
div
>
</
div
>
);
};
/** HOC: 将组件发射到body下 */
const
withPortalToBody
=
<
P
extends
object
>
(
export
const
withPortalToBody
=
<
P
extends
object
>
(
WrappedComponent: React.ComponentType
<
P
>
) =
>
{
return
(
props
:
P
)
=>
{
...
...
@@ -45,4 +30,17 @@ const withPortalToBody = <P extends object>(
};
}
;
export const Background = withPortalToBody(_Background);
export const Background: React.FC
<
{
style
?:
React
.
CSSProperties
;
innerStyle
?:
React
.
CSSProperties
;
innerOpacity
?:
number
;
}
>
= withPortalToBody((
{
style
,
innerStyle
,
innerOpacity
=
1
}
) =
>
{
return
(
<
div
className=
{
styles
.
background
}
style=
{
style
}
>
<
div
className=
{
styles
.
inner
}
style=
{
{
...
innerStyle
,
opacity
:
innerOpacity
}
}
></
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