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
c5cee725
Commit
c5cee725
authored
Feb 19, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize
parent
138a8447
Pipeline
#20271
passed with stages
in 4 minutes and 24 seconds
Changes
17
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
27 additions
and
53 deletions
+27
-53
.gitlab-ci.yml
.gitlab-ci.yml
+3
-3
neos-assets/background.png
neos-assets/background.png
+0
-0
neos-assets/card_back.jpg
neos-assets/card_back.jpg
+0
-0
neos-assets/card_slot.png
neos-assets/card_slot.png
+0
-0
neos-assets/mycard.icon.png
neos-assets/mycard.icon.png
+0
-0
neos-assets/newfield.png
neos-assets/newfield.png
+0
-0
neos-assets/sql-wasm.wasm
neos-assets/sql-wasm.wasm
+0
-0
neos.config.json
neos.config.json
+3
-0
src/config/ui.ts
src/config/ui.ts
+0
-40
src/middleware/sqlite.ts
src/middleware/sqlite.ts
+2
-1
src/styles/core.scss
src/styles/core.scss
+1
-1
src/ui/Duel/fixedSlot.tsx
src/ui/Duel/fixedSlot.tsx
+3
-2
src/ui/Duel/hands.tsx
src/ui/Duel/hands.tsx
+2
-1
src/ui/Duel/main.tsx
src/ui/Duel/main.tsx
+2
-1
src/ui/Duel/singleSlot.tsx
src/ui/Duel/singleSlot.tsx
+4
-1
src/ui/Login.tsx
src/ui/Login.tsx
+7
-2
src/ui/Neos.tsx
src/ui/Neos.tsx
+0
-1
No files found.
.gitlab-ci.yml
View file @
c5cee725
...
@@ -47,9 +47,9 @@ deploy:
...
@@ -47,9 +47,9 @@ deploy:
-
npm_build
-
npm_build
script
:
script
:
-
sudo apt-get install rsync
-
sudo apt-get install rsync
-
'
rsync
-atv
--progress
--human-readable
dist/
kirayamato@8.142.104.5:$NEOS_DEPLOY_PATH'
-
'
rsync
-atv
--progress
--human-readable
--delete
--exclude="neos-assets/"
dist/
kirayamato@8.142.104.5:$NEOS_DEPLOY_PATH'
-
'
rsync
-atv
--progress
--human-readable
assets/
kirayamato@8.142.104.5:$NEOS_DEPLOY_PATH/
assets'
-
'
rsync
-atv
--progress
--human-readable
--delete
neos-assets/
kirayamato@8.142.104.5:$NEOS_DEPLOY_PATH/neos-
assets'
-
'
rsync
-atv
--progress
--human-readable
ygopro-database
kirayamato@8.142.104.5:$NEOS_DEPLOY_PATH/ygopro-database'
-
'
rsync
-atv
--progress
--human-readable
--delete
ygopro-database
kirayamato@8.142.104.5:$NEOS_DEPLOY_PATH/ygopro-database'
before_script
:
before_script
:
-
'
command
-v
ssh-agent
>/dev/null
||
(
apt-get
update
-y
&&
apt-get
install
openssh-client
-y
)'
-
'
command
-v
ssh-agent
>/dev/null
||
(
apt-get
update
-y
&&
apt-get
install
openssh-client
-y
)'
...
...
assets/background.png
→
neos-
assets/background.png
View file @
c5cee725
File moved
assets/card_back.jpg
→
neos-
assets/card_back.jpg
View file @
c5cee725
File moved
assets/card_slot.png
→
neos-
assets/card_slot.png
View file @
c5cee725
File moved
assets/mycard.icon.png
→
neos-
assets/mycard.icon.png
View file @
c5cee725
File moved
assets/newfield.png
→
neos-
assets/newfield.png
View file @
c5cee725
File moved
assets/sql-wasm.wasm
→
neos-
assets/sql-wasm.wasm
View file @
c5cee725
File moved
neos.config.json
0 → 100644
View file @
c5cee725
{
"assetsPath"
:
"/neso-assets"
}
src/config/ui.ts
View file @
c5cee725
...
@@ -71,43 +71,3 @@ export const HandInteractShape = () => {
...
@@ -71,43 +71,3 @@ export const HandInteractShape = () => {
return
{
width
:
0.8
,
height
:
0.2
};
return
{
width
:
0.8
,
height
:
0.2
};
};
};
export
const
HandInteractFontSize
=
200
;
export
const
HandInteractFontSize
=
200
;
// 怪兽区
export
const
MonsterColor
=
()
=>
{
return
BABYLON
.
Color3
.
Red
();
};
// 额外怪兽区
export
const
extraMonsterColor
=
()
=>
{
return
BABYLON
.
Color3
.
Yellow
();
};
// 魔法陷阱区
export
const
MagicColor
=
()
=>
{
return
BABYLON
.
Color3
.
Blue
();
};
// 卡组
export
const
DeckColor
=
()
=>
{
return
BABYLON
.
Color3
.
Gray
();
};
// 额外卡组
export
const
ExtraDeckColor
=
()
=>
{
return
BABYLON
.
Color3
.
Purple
();
};
// 墓地
export
const
CemeteryColor
=
()
=>
{
return
BABYLON
.
Color3
.
Teal
();
};
// 除外区
export
const
ExclusionColor
=
()
=>
{
return
BABYLON
.
Color3
.
Black
();
};
// 场地
export
const
FieldColor
=
()
=>
{
return
BABYLON
.
Color3
.
White
();
};
src/middleware/sqlite.ts
View file @
c5cee725
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
import
initSqlJs
,
{
Database
}
from
"
sql.js
"
;
import
initSqlJs
,
{
Database
}
from
"
sql.js
"
;
import
{
CardMeta
,
CardData
,
CardText
}
from
"
../api/cards
"
;
import
{
CardMeta
,
CardData
,
CardText
}
from
"
../api/cards
"
;
import
NeosConfig
from
"
../../neos.config.json
"
;
export
enum
sqliteCmd
{
export
enum
sqliteCmd
{
// 初始化
// 初始化
...
@@ -37,7 +38,7 @@ export interface sqliteResult {
...
@@ -37,7 +38,7 @@ export interface sqliteResult {
let
YGODB
:
Database
|
null
=
null
;
let
YGODB
:
Database
|
null
=
null
;
const
sqlPromise
=
initSqlJs
({
const
sqlPromise
=
initSqlJs
({
locateFile
:
(
file
)
=>
`
/assets
/
${
file
}
`
,
locateFile
:
(
file
)
=>
`
${
NeosConfig
.
assetsPath
}
/
${
file
}
`
,
});
});
// FIXME: 应该有个返回值,告诉业务方本次请求的结果,比如初始化DB失败
// FIXME: 应该有个返回值,告诉业务方本次请求的结果,比如初始化DB失败
...
...
src/styles/core.scss
View file @
c5cee725
...
@@ -66,7 +66,7 @@ url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css")
...
@@ -66,7 +66,7 @@ url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css")
}
}
body
{
body
{
background-image
:
url(/assets/background.png)
;
background-image
:
url(/
neos-
assets/background.png)
;
background-size
:cover
;
background-size
:cover
;
color
:
#606468
;
color
:
#606468
;
font
:
87
.5%
/
1
.5em
'Open Sans'
,
sans-serif
;
font
:
87
.5%
/
1
.5em
'Open Sans'
,
sans-serif
;
...
...
src/ui/Duel/fixedSlot.tsx
View file @
c5cee725
...
@@ -14,6 +14,7 @@ import {
...
@@ -14,6 +14,7 @@ import {
}
from
"
../../reducers/duel/mod
"
;
}
from
"
../../reducers/duel/mod
"
;
import
{
ActionCreatorWithPayload
}
from
"
@reduxjs/toolkit
"
;
import
{
ActionCreatorWithPayload
}
from
"
@reduxjs/toolkit
"
;
import
{
interactTypeToString
}
from
"
./util
"
;
import
{
interactTypeToString
}
from
"
./util
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
const
shape
=
CONFIG
.
CardSlotShape
();
const
shape
=
CONFIG
.
CardSlotShape
();
...
@@ -99,11 +100,11 @@ const FixedSlot = (props: {
...
@@ -99,11 +100,11 @@ const FixedSlot = (props: {
diffuseTexture=
{
diffuseTexture=
{
props
.
state
.
occupant
props
.
state
.
occupant
?
faceDown
?
faceDown
?
new
BABYLON
.
Texture
(
`
/assets
/card_back.jpg`
)
?
new
BABYLON
.
Texture
(
`
${NeosConfig.assetsPath}
/card_back.jpg`
)
:
new
BABYLON
.
Texture
(
:
new
BABYLON
.
Texture
(
`https://cdn02.moecube.com:444/images/ygopro-images-zh-CN/${props.state.occupant.id}.jpg`
`https://cdn02.moecube.com:444/images/ygopro-images-zh-CN/${props.state.occupant.id}.jpg`
)
)
:
new
BABYLON
.
Texture
(
`
/assets
/card_slot.png`
)
:
new
BABYLON
.
Texture
(
`
${NeosConfig.assetsPath}
/card_slot.png`
)
}
}
alpha=
{
props
.
state
.
occupant
?
1
:
0
}
alpha=
{
props
.
state
.
occupant
?
1
:
0
}
></
standardMaterial
>
></
standardMaterial
>
...
...
src/ui/Duel/hands.tsx
View file @
c5cee725
...
@@ -15,6 +15,7 @@ import { useClick } from "./hook";
...
@@ -15,6 +15,7 @@ import { useClick } from "./hook";
import
{
useState
,
useRef
,
useEffect
}
from
"
react
"
;
import
{
useState
,
useRef
,
useEffect
}
from
"
react
"
;
import
{
useSpring
,
animated
}
from
"
./spring
"
;
import
{
useSpring
,
animated
}
from
"
./spring
"
;
import
{
zip
,
interactTypeToString
}
from
"
./util
"
;
import
{
zip
,
interactTypeToString
}
from
"
./util
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
const
groundShape
=
CONFIG
.
GroundShape
();
const
groundShape
=
CONFIG
.
GroundShape
();
const
left
=
-
(
groundShape
.
width
/
2
);
const
left
=
-
(
groundShape
.
width
/
2
);
...
@@ -51,7 +52,7 @@ const Hands = () => {
...
@@ -51,7 +52,7 @@ const Hands = () => {
sequence=
{
idx
}
sequence=
{
idx
}
position=
{
position
}
position=
{
position
}
rotation=
{
handRotation
}
rotation=
{
handRotation
}
cover=
{
(
_
)
=>
`
/assets
/card_back.jpg`
}
cover=
{
(
_
)
=>
`
${NeosConfig.assetsPath}
/card_back.jpg`
}
/>
/>
);
);
})
}
})
}
...
...
src/ui/Duel/main.tsx
View file @
c5cee725
...
@@ -21,6 +21,7 @@ import Phase from "./phase";
...
@@ -21,6 +21,7 @@ import Phase from "./phase";
import
CheckCardModalV2
from
"
./checkCardModalV2
"
;
import
CheckCardModalV2
from
"
./checkCardModalV2
"
;
import
ExtraDeck
from
"
./extraDeck
"
;
import
ExtraDeck
from
"
./extraDeck
"
;
import
{
initStrings
}
from
"
../../api/strings
"
;
import
{
initStrings
}
from
"
../../api/strings
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126
const
NeosDuel
=
()
=>
{
const
NeosDuel
=
()
=>
{
...
@@ -94,7 +95,7 @@ const Light = () => (
...
@@ -94,7 +95,7 @@ const Light = () => (
const
Ground
=
()
=>
{
const
Ground
=
()
=>
{
const
shape
=
CONFIG
.
GroundShape
();
const
shape
=
CONFIG
.
GroundShape
();
const
texture
=
new
BABYLON
.
Texture
(
`
/assets
/newfield.png`
);
const
texture
=
new
BABYLON
.
Texture
(
`
${
NeosConfig
.
assetsPath
}
/newfield.png`
);
texture
.
hasAlpha
=
true
;
texture
.
hasAlpha
=
true
;
return
(
return
(
...
...
src/ui/Duel/singleSlot.tsx
View file @
c5cee725
...
@@ -9,6 +9,7 @@ import {
...
@@ -9,6 +9,7 @@ import {
setCardListModalIsOpen
,
setCardListModalIsOpen
,
}
from
"
../../reducers/duel/mod
"
;
}
from
"
../../reducers/duel/mod
"
;
import
{
interactTypeToString
}
from
"
./util
"
;
import
{
interactTypeToString
}
from
"
./util
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
const
shape
=
CONFIG
.
SingleSlotShape
;
const
shape
=
CONFIG
.
SingleSlotShape
;
export
const
Depth
=
0.005
;
export
const
Depth
=
0.005
;
...
@@ -77,7 +78,9 @@ const SingleSlot = (props: {
...
@@ -77,7 +78,9 @@ const SingleSlot = (props: {
>
>
<standardMaterial
<standardMaterial
name="single-slot-mat"
name="single-slot-mat"
diffuseTexture={new BABYLON.Texture(`
/
assets
/
card_back
.
jpg
`)}
diffuseTexture={
new BABYLON.Texture(`
$
{
NeosConfig
.
assetsPath
}
/card_back.jpg`
)
}
alpha
=
{
props
.
state
.
length
==
0
?
0
:
1
}
alpha
=
{
props
.
state
.
length
==
0
?
0
:
1
}
/
>
/
>
<
/box
>
<
/box
>
...
...
src/ui/Login.tsx
View file @
c5cee725
...
@@ -10,6 +10,7 @@ import { Input } from "antd";
...
@@ -10,6 +10,7 @@ import { Input } from "antd";
import
React
,
{
useState
,
ChangeEvent
}
from
"
react
"
;
import
React
,
{
useState
,
ChangeEvent
}
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
"
../styles/core.scss
"
;
import
"
../styles/core.scss
"
;
import
NeosConfig
from
"
../../neos.config.json
"
;
export
default
function
Login
()
{
export
default
function
Login
()
{
const
[
player
,
setPlayer
]
=
useState
(
""
);
const
[
player
,
setPlayer
]
=
useState
(
""
);
...
@@ -65,7 +66,8 @@ export default function Login() {
...
@@ -65,7 +66,8 @@ export default function Login() {
</
div
>
</
div
>
<
div
className=
"sign-up__actions clearfix"
>
<
div
className=
"sign-up__actions clearfix"
>
<
p
>
<
p
>
Don't know how to play?
<
a
href=
"https://neos.doc/"
>
Player Guide
</
a
>
Don't know how to play?
{
"
"
}
<
a
href=
"https://neos.moe/doc/"
>
Player Guide
</
a
>
<
span
className=
"fa fa-arrow-right"
></
span
>
<
span
className=
"fa fa-arrow-right"
></
span
>
</
p
>
</
p
>
</
div
>
</
div
>
...
@@ -85,7 +87,10 @@ export default function Login() {
...
@@ -85,7 +87,10 @@ export default function Login() {
</
li
>
</
li
>
<
li
>
<
li
>
<
a
href=
"https://mycard.moe/"
>
<
a
href=
"https://mycard.moe/"
>
<
img
src=
"/assets/mycard.icon.png"
style=
{
{
width
:
"
25%
"
}
}
/>
<
img
src=
{
`${NeosConfig.assetsPath}/mycard.icon.png`
}
style=
{
{
width
:
"
25%
"
}
}
/>
</
a
>
</
a
>
</
li
>
</
li
>
<
li
>
<
li
>
...
...
src/ui/Neos.tsx
View file @
c5cee725
...
@@ -8,7 +8,6 @@ const Mora = React.lazy(() => import("./Mora"));
...
@@ -8,7 +8,6 @@ const Mora = React.lazy(() => import("./Mora"));
const
NeosDuel
=
React
.
lazy
(()
=>
import
(
"
./Duel/main
"
));
const
NeosDuel
=
React
.
lazy
(()
=>
import
(
"
./Duel/main
"
));
export
default
function
()
{
export
default
function
()
{
// FIXME: 这里Mora/Duel路由应该由每个房间指定一个路径
return
(
return
(
<
Routes
>
<
Routes
>
<
Route
path=
"/"
element=
{
<
LazyLoad
lazy=
{
<
Login
/>
}
/>
}
/>
<
Route
path=
"/"
element=
{
<
LazyLoad
lazy=
{
<
Login
/>
}
/>
}
/>
...
...
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