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
f1125522
Commit
f1125522
authored
Oct 30, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add mora page
parent
f2c72f63
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
16 deletions
+51
-16
src/css/Mora.css
src/css/Mora.css
+10
-0
src/main.tsx
src/main.tsx
+2
-2
src/ui/Mora.tsx
src/ui/Mora.tsx
+23
-0
src/ui/Neos.tsx
src/ui/Neos.tsx
+4
-3
src/ui/WaitRoom.tsx
src/ui/WaitRoom.tsx
+12
-11
No files found.
src/css/Mora.css
0 → 100644
View file @
f1125522
.container
{
display
:
flex
;
margin
:
auto
;
padding
:
0
;
}
.item
{
text-align
:
center
;
flex
:
1
;
}
src/main.tsx
View file @
f1125522
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
* */
* */
import
React
from
"
react
"
;
import
React
from
"
react
"
;
import
ReactDOM
from
"
react-dom/client
"
;
import
ReactDOM
from
"
react-dom/client
"
;
import
App
from
"
./ui/App
"
;
import
Neos
from
"
./ui/Neos
"
;
import
{
BrowserRouter
}
from
"
react-router-dom
"
;
import
{
BrowserRouter
}
from
"
react-router-dom
"
;
import
{
Provider
}
from
"
react-redux
"
;
import
{
Provider
}
from
"
react-redux
"
;
import
{
store
}
from
"
./store
"
;
import
{
store
}
from
"
./store
"
;
...
@@ -33,7 +33,7 @@ root.render(
...
@@ -33,7 +33,7 @@ root.render(
<
React
.
StrictMode
>
<
React
.
StrictMode
>
<
BrowserRouter
>
<
BrowserRouter
>
<
Provider
store=
{
store
}
>
<
Provider
store=
{
store
}
>
<
App
/>
<
Neos
/>
</
Provider
>
</
Provider
>
</
BrowserRouter
>
</
BrowserRouter
>
</
React
.
StrictMode
>
</
React
.
StrictMode
>
...
...
src/ui/Mora.tsx
0 → 100644
View file @
f1125522
/*
* 猜拳页面
*
* */
import
React
from
"
react
"
;
import
"
../css/Mora.css
"
;
export
default
function
Mora
()
{
return
(
<
div
className=
"container"
>
<
div
className=
"item"
>
<
button
>
rock
</
button
>
</
div
>
<
div
className=
"item"
>
<
button
>
scissors
</
button
>
</
div
>
<
div
className=
"item"
>
<
button
>
paper
</
button
>
</
div
>
</
div
>
);
}
src/ui/
App
.tsx
→
src/ui/
Neos
.tsx
View file @
f1125522
...
@@ -4,16 +4,17 @@ import WaitRoom from "./WaitRoom";
...
@@ -4,16 +4,17 @@ import WaitRoom from "./WaitRoom";
import
ThreeJs
from
"
./ThreeJs
"
;
import
ThreeJs
from
"
./ThreeJs
"
;
import
BabylonJs
from
"
./BabylonJs
"
;
import
BabylonJs
from
"
./BabylonJs
"
;
import
{
Routes
,
Route
}
from
"
react-router-dom
"
;
import
{
Routes
,
Route
}
from
"
react-router-dom
"
;
import
Mora
from
"
./Mora
"
;
function
App
()
{
export
default
function
()
{
// FIXME: 这里Mora路由应该由每个房间指定一个路径
return
(
return
(
<
Routes
>
<
Routes
>
<
Route
path=
"/"
element=
{
<
JoinRoom
/>
}
/>
<
Route
path=
"/"
element=
{
<
JoinRoom
/>
}
/>
<
Route
path=
"/:player/:passWd/:ip"
element=
{
<
WaitRoom
/>
}
/>
<
Route
path=
"/:player/:passWd/:ip"
element=
{
<
WaitRoom
/>
}
/>
<
Route
path=
"/mora"
element=
{
<
Mora
/>
}
/>
<
Route
path=
"/three"
element=
{
<
ThreeJs
/>
}
/>
<
Route
path=
"/three"
element=
{
<
ThreeJs
/>
}
/>
<
Route
path=
"/babylon"
element=
{
<
BabylonJs
/>
}
/>
<
Route
path=
"/babylon"
element=
{
<
BabylonJs
/>
}
/>
</
Routes
>
</
Routes
>
);
);
}
}
export
default
App
;
src/ui/WaitRoom.tsx
View file @
f1125522
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* */
* */
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
useParams
}
from
"
react-router-dom
"
;
import
{
Link
,
useParams
}
from
"
react-router-dom
"
;
import
{
fetchDeck
}
from
"
../api/Card
"
;
import
{
fetchDeck
}
from
"
../api/Card
"
;
import
"
../css/WaitRoom.css
"
;
import
"
../css/WaitRoom.css
"
;
import
{
useAppSelector
}
from
"
../hook
"
;
import
{
useAppSelector
}
from
"
../hook
"
;
...
@@ -87,18 +87,19 @@ export default function WaitRoom() {
...
@@ -87,18 +87,19 @@ export default function WaitRoom() {
</
p
>
</
p
>
<
p
>
<
p
>
<
button
<
button
disabled=
{
// disabled={
!
(
// !(
isHost
&&
// isHost &&
player0
.
state
!=
undefined
&&
// player0.state != undefined &&
player0
.
state
===
READY_STATE
&&
// player0.state === READY_STATE &&
player1
.
state
!=
undefined
&&
// player1.state != undefined &&
player1
.
state
===
READY_STATE
// player1.state === READY_STATE
)
// )
}
// }
disabled=
{
false
}
onClick=
{
handleChoseStart
}
onClick=
{
handleChoseStart
}
>
>
start
<
Link
to=
{
{
pathname
:
`/mora`
}
}
>
start
</
Link
>
</
button
>
</
button
>
</
p
>
</
p
>
</
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