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
0c5052f5
Commit
0c5052f5
authored
Aug 08, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: remove unused components and pages
parent
e8ac3d50
Pipeline
#22959
failed with stages
in 12 minutes and 56 seconds
Changes
16
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
9 additions
and
181 deletions
+9
-181
src/service/duel/start.ts
src/service/duel/start.ts
+1
-1
src/ui/Match/MatchModal.module.scss
src/ui/Match/MatchModal.module.scss
+0
-0
src/ui/Match/MatchModal.tsx
src/ui/Match/MatchModal.tsx
+0
-0
src/ui/Match/ReplayModal.tsx
src/ui/Match/ReplayModal.tsx
+0
-0
src/ui/Match/index.module.scss
src/ui/Match/index.module.scss
+0
-0
src/ui/Match/index.tsx
src/ui/Match/index.tsx
+0
-0
src/ui/Match/util.ts
src/ui/Match/util.ts
+0
-0
src/ui/NeosRouter.tsx
src/ui/NeosRouter.tsx
+6
-7
src/ui/NewProfile/index.tsx
src/ui/NewProfile/index.tsx
+0
-2
src/ui/Profile/index.module.scss
src/ui/Profile/index.module.scss
+0
-82
src/ui/Profile/index.tsx
src/ui/Profile/index.tsx
+2
-89
src/ui/WaitRoom/Chat.module.scss
src/ui/WaitRoom/Chat.module.scss
+0
-0
src/ui/WaitRoom/Chat.tsx
src/ui/WaitRoom/Chat.tsx
+0
-0
src/ui/WaitRoom/Popover.tsx
src/ui/WaitRoom/Popover.tsx
+0
-0
src/ui/WaitRoom/index.module.scss
src/ui/WaitRoom/index.module.scss
+0
-0
src/ui/WaitRoom/index.tsx
src/ui/WaitRoom/index.tsx
+0
-0
No files found.
src/service/duel/start.ts
View file @
0c5052f5
...
...
@@ -7,7 +7,7 @@ import { fetchCard, ygopro } from "@/api";
import
{
useConfig
}
from
"
@/config
"
;
import
{
sleep
}
from
"
@/infra
"
;
import
{
cardStore
,
CardType
,
matStore
}
from
"
@/stores
"
;
import
{
replayStart
}
from
"
@/ui/
New
Match/ReplayModal
"
;
import
{
replayStart
}
from
"
@/ui/Match/ReplayModal
"
;
const
TOKEN_SIZE
=
13
;
// 每人场上最多就只可能有13个token
export
default
async
(
start
:
ygopro
.
StocGameMessage
.
MsgStart
)
=>
{
...
...
src/ui/
New
Match/MatchModal.module.scss
→
src/ui/Match/MatchModal.module.scss
View file @
0c5052f5
File moved
src/ui/
New
Match/MatchModal.tsx
→
src/ui/Match/MatchModal.tsx
View file @
0c5052f5
File moved
src/ui/
New
Match/ReplayModal.tsx
→
src/ui/Match/ReplayModal.tsx
View file @
0c5052f5
File moved
src/ui/
New
Match/index.module.scss
→
src/ui/Match/index.module.scss
View file @
0c5052f5
File moved
src/ui/
New
Match/index.tsx
→
src/ui/Match/index.tsx
View file @
0c5052f5
File moved
src/ui/
New
Match/util.ts
→
src/ui/Match/util.ts
View file @
0c5052f5
File moved
src/ui/NeosRouter.tsx
View file @
0c5052f5
import
{
createBrowserRouter
,
RouterProvider
}
from
"
react-router-dom
"
;
// TODO: finish this
const
_router
=
createBrowserRouter
([
const
router
=
createBrowserRouter
([
{
path
:
"
/
"
,
lazy
:
()
=>
import
(
"
./Layout
"
),
...
...
@@ -11,8 +10,8 @@ const _router = createBrowserRouter([
lazy
:
()
=>
import
(
"
./Start
"
),
},
{
path
:
"
/match
/*
"
,
lazy
:
()
=>
import
(
"
./
New
Match
"
),
path
:
"
/match
"
,
lazy
:
()
=>
import
(
"
./Match
"
),
},
{
path
:
"
/build
"
,
...
...
@@ -20,11 +19,11 @@ const _router = createBrowserRouter([
},
{
path
:
"
/profile
"
,
lazy
:
()
=>
import
(
"
./
New
Profile
"
),
lazy
:
()
=>
import
(
"
./Profile
"
),
},
{
path
:
"
/waitroom
"
,
lazy
:
()
=>
import
(
"
./
New
WaitRoom
"
),
lazy
:
()
=>
import
(
"
./WaitRoom
"
),
},
{
path
:
"
/duel/:ip/:player/:passWd
"
,
...
...
@@ -34,4 +33,4 @@ const _router = createBrowserRouter([
},
]);
export
const
NeosRouter
=
()
=>
<
RouterProvider
router=
{
_
router
}
/>;
export
const
NeosRouter
=
()
=>
<
RouterProvider
router=
{
router
}
/>;
src/ui/NewProfile/index.tsx
deleted
100644 → 0
View file @
e8ac3d50
export
const
Component
=
()
=>
<>
profile
</>;
Component
.
displayName
=
"
Build
"
;
src/ui/Profile/index.module.scss
deleted
100644 → 0
View file @
e8ac3d50
.account-header
{
position
:
relative
;
z-index
:
200
;
border-bottom
:
1px
solid
rgba
(
150
,
150
,
150
,
0
.2
);
width
:
100%
;
height
:
0
;
.header-user
{
position
:
absolute
;
right
:
2%
;
top
:
0
;
display
:
flex
;
align-items
:
center
;
img
{
margin
:
0
0
.5rem
;
}
.header-user-btn
{
color
:
#c9cbd0
;
}
.sep
{
margin
:
0
0
.8rem
;
}
}
}
.container
{
position
:
relative
;
display
:
flex
;
width
:
100%
;
height
:
calc
(
100vh
-
48px
);
align-items
:
center
;
.bg
{
width
:
100%
;
height
:
100%
;
background
:
url(/neos-assets/home-background.png)
;
background-size
:
cover
;
opacity
:
0
.2
;
}
.box
{
position
:
absolute
;
display
:
flex
;
flex-direction
:
column
;
width
:
500px
;
height
:
500px
;
left
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
background
:
#333b51
;
opacity
:
0
.8
;
border-radius
:
1
.2em
;
box-shadow
:
0
2px
10px
-5px
rgba
(
9
,
2
,
4
,
0
.8
);
align-items
:
center
;
p
{
font-size
:
2em
;
}
button
{
font-size
:
1
.2em
;
width
:
350px
;
height
:
45px
;
margin
:
0
.5em
;
background-color
:
#2c2c2c
;
border-width
:
0
.3em
;
border-image
:
url(/neos-assets/border.webp)
10
;
color
:
white
;
}
button
:hover
{
background-color
:
#393983
;
}
button
:active
{
background-color
:
#9d3939
;
}
}
}
src/ui/Profile/index.tsx
View file @
0c5052f5
import
React
,
{
useEffect
}
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
// import { match } from "@/api";
import
{
useConfig
}
from
"
@/config
"
;
import
{
accountStore
}
from
"
@/stores
"
;
import
styles
from
"
./index.module.scss
"
;
const
NeosConfig
=
useConfig
();
const
DefaultUserName
=
"
Guest
"
;
export
const
Component
:
React
.
FC
=
()
=>
{
const
{
user
}
=
useSnapshot
(
accountStore
);
const
navigate
=
useNavigate
();
const
onLogout
=
()
=>
{};
// TODO
const
onMatchAI
=
()
=>
{
const
username
=
accountStore
.
user
?.
username
??
DefaultUserName
;
navigate
(
`/room/
${
username
}
/
${
encodeURIComponent
(
"
AI
"
)}
/
${
NeosConfig
.
servers
[
0
].
ip
}
:
${
NeosConfig
.
servers
[
0
].
port
}
`
);
};
const
onEntertainMatch
=
async
()
=>
{
// if (user) {
// const matchInfo = await match(user.username, user.external_id);
// if (matchInfo) {
// navigate(
// `/room/${user.username}/${encodeURIComponent(matchInfo.password)}/${
// matchInfo.address
// }:${matchInfo.port}`
// );
// } else {
// alert("匹配失败");
// }
// } else {
// alert("请先登录萌卡账号");
// }
// TODO: 这部分需要修改后端逻辑,改完后端后再来补充这里
alert
(
"
暂不支持,敬请期待
"
);
};
useEffect
(()
=>
{
if
(
!
user
)
{
// 跳转SSO界面进行登录
navigate
(
"
/sso
"
);
}
},
[
user
]);
return
(
<>
<
div
className=
{
styles
[
"
account-header
"
]
}
>
<
div
className=
{
styles
[
"
header-user
"
]
}
>
<
img
src=
{
user
?.
avatar_url
??
`${NeosConfig.assetsPath}/default-avatar.png`
}
alt=
{
user
?.
username
}
height=
{
40
}
/>
<
a
className=
{
styles
[
"
header-user-btn
"
]
}
href=
{
NeosConfig
.
profileUrl
}
>
个人中心
</
a
>
<
span
className=
{
styles
.
sep
}
>
|
</
span
>
<
a
className=
{
styles
[
"
header-user-btn
"
]
}
href=
""
onClick=
{
onLogout
}
>
登出
</
a
>
</
div
>
</
div
>
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
bg
}
></
div
>
<
div
className=
{
styles
.
box
}
>
<
p
>
欢迎来到NEOS,
{
user
?.
username
}
</
p
>
<
button
onClick=
{
onEntertainMatch
}
>
娱乐匹配
</
button
>
<
button
onClick=
{
()
=>
alert
(
"
暂不支持,敬请期待
"
)
}
>
竞技匹配
</
button
>
<
button
onClick=
{
()
=>
navigate
(
"
/match
"
)
}
>
自定义匹配
</
button
>
<
button
onClick=
{
onMatchAI
}
>
人机对战
</
button
>
<
button
onClick=
{
()
=>
navigate
(
"
/replay
"
)
}
>
录像回放
</
button
>
<
button
onClick=
{
()
=>
alert
(
"
暂不支持,敬请期待
"
)
}
>
卡组编辑
</
button
>
</
div
>
</
div
>
</>
);
};
Component
.
displayName
=
"
Profile
"
;
export
const
Component
=
()
=>
<>
profile
</>;
Component
.
displayName
=
"
Build
"
;
src/ui/
New
WaitRoom/Chat.module.scss
→
src/ui/WaitRoom/Chat.module.scss
View file @
0c5052f5
File moved
src/ui/
New
WaitRoom/Chat.tsx
→
src/ui/WaitRoom/Chat.tsx
View file @
0c5052f5
File moved
src/ui/
New
WaitRoom/Popover.tsx
→
src/ui/WaitRoom/Popover.tsx
View file @
0c5052f5
File moved
src/ui/
New
WaitRoom/index.module.scss
→
src/ui/WaitRoom/index.module.scss
View file @
0c5052f5
File moved
src/ui/
New
WaitRoom/index.tsx
→
src/ui/WaitRoom/index.tsx
View file @
0c5052f5
File moved
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