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
35d9e8ed
Commit
35d9e8ed
authored
Aug 07, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: new waitroom ui
parent
462ef67b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
118 additions
and
85 deletions
+118
-85
src/ui/Layout/index.tsx
src/ui/Layout/index.tsx
+28
-19
src/ui/NewWaitRoom/index.module.scss
src/ui/NewWaitRoom/index.module.scss
+21
-14
src/ui/NewWaitRoom/index.tsx
src/ui/NewWaitRoom/index.tsx
+68
-51
src/ui/Shared/IconFont/index.tsx
src/ui/Shared/IconFont/index.tsx
+1
-1
No files found.
src/ui/Layout/index.tsx
View file @
35d9e8ed
import
{
Avatar
}
from
"
antd
"
;
import
{
Avatar
}
from
"
antd
"
;
import
{
type
LoaderFunction
,
NavLink
,
Outlet
}
from
"
react-router-dom
"
;
import
{
type
LoaderFunction
,
NavLink
,
Outlet
,
useLocation
,
}
from
"
react-router-dom
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
CookieKeys
,
getCookie
}
from
"
@/api
"
;
import
{
CookieKeys
,
getCookie
}
from
"
@/api
"
;
...
@@ -19,8 +24,11 @@ export const loader: LoaderFunction = () => {
...
@@ -19,8 +24,11 @@ export const loader: LoaderFunction = () => {
export
const
Component
=
()
=>
{
export
const
Component
=
()
=>
{
// TODO 根据是否登录,显示内容
// TODO 根据是否登录,显示内容
const
{
pathname
}
=
useLocation
();
const
pathnamesHideHeader
=
[
"
/waitroom
"
];
return
(
return
(
<>
<>
{
!
pathnamesHideHeader
.
includes
(
pathname
)
&&
(
<
nav
className=
{
styles
.
navbar
}
>
<
nav
className=
{
styles
.
navbar
}
>
<
div
className=
{
styles
[
"
logo-container
"
]
}
>
<
div
className=
{
styles
[
"
logo-container
"
]
}
>
<
img
<
img
...
@@ -43,6 +51,7 @@ export const Component = () => {
...
@@ -43,6 +51,7 @@ export const Component = () => {
<
NavLink
to=
"/profile"
>
个人中心
</
NavLink
>
<
NavLink
to=
"/profile"
>
个人中心
</
NavLink
>
</
span
>
</
span
>
</
nav
>
</
nav
>
)
}
<
main
className=
{
styles
.
main
}
>
<
main
className=
{
styles
.
main
}
>
<
Outlet
/>
<
Outlet
/>
</
main
>
</
main
>
...
...
src/ui/NewWaitRoom/index.module.scss
View file @
35d9e8ed
...
@@ -6,15 +6,21 @@
...
@@ -6,15 +6,21 @@
--border-radius
:
10px
;
--border-radius
:
10px
;
--sider-width
:
300px
;
--sider-width
:
300px
;
.content
{
.content
{
height
:
500px
;
// TODO: 修正这里的高度,或者说修正全局的高度设置。高度不应该超过100%
height
:
100%
;
position
:
relative
;
position
:
relative
;
flex
:
1
;
flex
:
1
;
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
// padding-bottom: 5%;
transition
:
transform
0
.3s
;
transition
:
transform
0
.3s
;
.wrap
{
height
:
500px
;
// TODO: 修正这里的高度,或者说修正全局的高度设置。高度不应该超过100%
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
}
}
}
.sider
{
.sider
{
position
:
relative
;
position
:
relative
;
...
@@ -99,26 +105,27 @@
...
@@ -99,26 +105,27 @@
padding-left
:
8px
;
padding-left
:
8px
;
}
}
.btn-sider
{
.btns-side
{
--length
:
30px
;
width
:
var
(
--
length
);
height
:
var
(
--
length
);
background
:
hsla
(
0
,
0%
,
100%
,
0
.1
);
position
:
absolute
;
position
:
absolute
;
right
:
calc
(
-1
*
var
(
--
length
)
-
10px
)
;
left
:
10px
;
bottom
:
10px
;
bottom
:
10px
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
flex-direction
:
column
;
justify-content
:
center
;
gap
:
10px
;
font-size
:
18px
;
transition
:
0
.3s
;
transition
:
0
.2s
;
.btn
{
background
:
hsla
(
0
,
0%
,
100%
,
0
.1
);
}
}
}
.collapsed
{
.collapsed
{
.sider
{
.sider
{
transform
:
translateX
(
calc
(
-1
*
var
(
--
sider-width
)));
transform
:
translateX
(
calc
(
-1
*
var
(
--
sider-width
)));
}
}
.main
{
.content
{
transform
:
translateX
(
calc
(
-1
*
var
(
--
sider-width
)
/
2
));
}
.btns-side
{
transform
:
translateX
(
calc
(
-1
*
var
(
--
sider-width
)
/
2
));
transform
:
translateX
(
calc
(
-1
*
var
(
--
sider-width
)
/
2
));
}
}
}
}
...
@@ -163,6 +170,6 @@
...
@@ -163,6 +170,6 @@
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.btn-action
{
.btn
s
-action
{
margin-top
:
auto
;
margin-top
:
auto
;
}
}
src/ui/NewWaitRoom/index.tsx
View file @
35d9e8ed
import
{
CheckCircleFilled
}
from
"
@ant-design/icons
"
;
import
{
CheckCircleFilled
,
LogoutOutlined
}
from
"
@ant-design/icons
"
;
import
{
import
{
sendHsNotReady
,
sendHsNotReady
,
...
@@ -12,7 +12,15 @@ import {
...
@@ -12,7 +12,15 @@ import {
import
socketMiddleWare
,
{
socketCmd
}
from
"
@/middleware/socket
"
;
import
socketMiddleWare
,
{
socketCmd
}
from
"
@/middleware/socket
"
;
import
PlayerState
=
ygopro
.
StocHsPlayerChange
.
State
;
import
PlayerState
=
ygopro
.
StocHsPlayerChange
.
State
;
import
SelfType
=
ygopro
.
StocTypeChange
.
SelfType
;
import
SelfType
=
ygopro
.
StocTypeChange
.
SelfType
;
import
{
Avatar
,
Button
,
ConfigProvider
,
Popover
,
Skeleton
,
Space
}
from
"
antd
"
;
import
{
Avatar
,
Button
,
ConfigProvider
,
Popover
,
Skeleton
,
Space
,
Tooltip
,
}
from
"
antd
"
;
import
classNames
from
"
classnames
"
;
import
classNames
from
"
classnames
"
;
import
{
import
{
forwardRef
,
forwardRef
,
...
@@ -72,11 +80,6 @@ export const Component: React.FC = () => {
...
@@ -72,11 +80,6 @@ export const Component: React.FC = () => {
>
>
<
Background
/>
<
Background
/>
<
div
className=
{
styles
.
sider
}
>
<
div
className=
{
styles
.
sider
}
>
<
Button
className=
{
styles
[
"
btn-sider
"
]
}
icon=
{
<
IconFont
type=
"icon-side-bar-fill"
size=
{
16
}
/>
}
onClick=
{
()
=>
setCollapsed
(
!
collapsed
)
}
/>
<
Chat
/>
<
Chat
/>
</
div
>
</
div
>
<
div
className=
{
styles
.
content
}
>
<
div
className=
{
styles
.
content
}
>
...
@@ -84,6 +87,22 @@ export const Component: React.FC = () => {
...
@@ -84,6 +87,22 @@ export const Component: React.FC = () => {
<LoadingOutlined />
<LoadingOutlined />
对方正在选择先后
对方正在选择先后
</div> */
}
</div> */
}
<
div
className=
{
styles
[
"
btns-side
"
]
}
>
<
Tooltip
title=
"退出房间"
placement=
"right"
>
<
Button
className=
{
styles
[
"
btn
"
]
}
danger
icon=
{
<
IconFont
type=
"icon-exit"
size=
{
16
}
/>
}
/>
</
Tooltip
>
<
Button
className=
{
styles
[
"
btn
"
]
}
icon=
{
<
IconFont
type=
"icon-side-bar-fill"
size=
{
16
}
/>
}
onClick=
{
()
=>
setCollapsed
(
!
collapsed
)
}
/>
</
div
>
<
div
className=
{
styles
.
wrap
}
>
<
Controller
<
Controller
onDeckChange=
{
(
deckName
:
string
)
=>
{
onDeckChange=
{
(
deckName
:
string
)
=>
{
const
deck
=
deckStore
.
get
(
deckName
);
const
deck
=
deckStore
.
get
(
deckName
);
...
@@ -122,11 +141,12 @@ export const Component: React.FC = () => {
...
@@ -122,11 +141,12 @@ export const Component: React.FC = () => {
<
PlayerZone
who=
{
Who
.
Op
}
player=
{
room
.
getOpPlayer
()
}
/>
<
PlayerZone
who=
{
Who
.
Op
}
player=
{
room
.
getOpPlayer
()
}
/>
</
div
>
</
div
>
<
SpecialButton
className=
{
styles
[
"
btn
-action
"
]
}
>
<
SpecialButton
className=
{
styles
[
"
btns
-action
"
]
}
>
开始游戏
开始游戏
</
SpecialButton
>
</
SpecialButton
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
ConfigProvider
>
</
ConfigProvider
>
);
);
};
};
...
@@ -320,15 +340,15 @@ const Controller: React.FC<{ onDeckChange: (deckName: string) => void }> = ({
...
@@ -320,15 +340,15 @@ const Controller: React.FC<{ onDeckChange: (deckName: string) => void }> = ({
))
}
))
}
</
Avatar
.
Group
>
</
Avatar
.
Group
>
</
Button
>
</
Button
>
<
Button
{
/*
<Button
size="large"
size="large"
icon={<IconFont type="icon-play" size={12} />}
icon={<IconFont type="icon-play" size={12} />}
disabled={!snapRoom.isHost}
disabled={!snapRoom.isHost}
onClick={() => sendHsStart()}
onClick={() => sendHsStart()}
>
>
开始游戏
开始游戏
</
Button
>
</Button>
*/
}
<
Button
{
/*
<Button
size="large"
size="large"
danger
danger
onClick={() => {
onClick={() => {
...
@@ -339,9 +359,6 @@ const Controller: React.FC<{ onDeckChange: (deckName: string) => void }> = ({
...
@@ -339,9 +359,6 @@ const Controller: React.FC<{ onDeckChange: (deckName: string) => void }> = ({
}}
}}
>
>
退出房间
退出房间
</
Button
>
{
/* <Button size="large" icon={<IconFont type="icon-play" size={12} />}>
开始游戏
</Button> */
}
</Button> */
}
</
Space
>
</
Space
>
);
);
...
...
src/ui/Shared/IconFont/index.tsx
View file @
35d9e8ed
import
{
createFromIconfontCN
}
from
"
@ant-design/icons
"
;
import
{
createFromIconfontCN
}
from
"
@ant-design/icons
"
;
const
_IconFont
=
createFromIconfontCN
({
const
_IconFont
=
createFromIconfontCN
({
scriptUrl
:
[
"
//at.alicdn.com/t/c/font_4188978_
6q59nqrc9i
x.js
"
],
scriptUrl
:
[
"
//at.alicdn.com/t/c/font_4188978_
kvwn9bcpn
x.js
"
],
});
});
export
const
IconFont
:
React
.
FC
<
{
export
const
IconFont
:
React
.
FC
<
{
...
...
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