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
112a3952
Commit
112a3952
authored
Jul 28, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add home page
parent
79a496e5
Pipeline
#22815
passed with stages
in 12 minutes and 32 seconds
Changes
10
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
112 additions
and
3 deletions
+112
-3
neos-assets/default-avatar.png
neos-assets/default-avatar.png
+0
-0
neos.config.json
neos.config.json
+1
-0
neos.config.prod.json
neos.config.prod.json
+1
-0
src/stores/accountStore.ts
src/stores/accountStore.ts
+1
-0
src/styles/core.scss
src/styles/core.scss
+2
-1
src/ui/Home/index.module.scss
src/ui/Home/index.module.scss
+49
-0
src/ui/Home/index.tsx
src/ui/Home/index.tsx
+52
-0
src/ui/Neos.tsx
src/ui/Neos.tsx
+2
-0
src/ui/SSO/index.tsx
src/ui/SSO/index.tsx
+3
-1
src/ui/Start/index.module.scss
src/ui/Start/index.module.scss
+1
-1
No files found.
neos-assets/default-avatar.png
0 → 100644
View file @
112a3952
3.95 KB
neos.config.json
View file @
112a3952
...
...
@@ -12,6 +12,7 @@
"stringsUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf"
,
"replayUrl"
:
"replay.neos.moe"
,
"accountUrl"
:
"https://accounts.moecube.com"
,
"profileUrl"
:
"https://accounts.moecube.com/profiles"
,
"chainALL"
:
false
,
"streamInterval"
:
20
,
"startDelay"
:
1000
,
...
...
neos.config.prod.json
View file @
112a3952
...
...
@@ -12,6 +12,7 @@
"stringsUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf"
,
"replayUrl"
:
"replay.neos.moe"
,
"accountUrl"
:
"https://accounts.moecube.com"
,
"profileUrl"
:
"https://accounts.moecube.com/profiles"
,
"chainALL"
:
false
,
"streamInterval"
:
20
,
"startDelay"
:
1000
,
...
...
src/stores/accountStore.ts
View file @
112a3952
...
...
@@ -9,6 +9,7 @@ export interface User {
email
:
string
;
token
:
string
;
external_id
:
number
;
avatar_url
:
string
;
}
class
AccountStore
implements
NeosStore
{
...
...
src/styles/core.scss
View file @
112a3952
...
...
@@ -26,6 +26,7 @@ table {
#root
{
margin
:
0
auto
;
text-align
:
center
;
width
:
100%
}
@import
url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css")
,
...
...
@@ -34,7 +35,7 @@ table {
body
{
color-scheme
:
light
dark
;
color
:
rgba
(
255
,
255
,
255
,
0
.87
);
background
-color
:
#141414
;
background
:
#0f131e
;
// font: 87.5%/1.5em "Open Sans", sans-serif;
font-size
:
14px
;
display
:
flex
;
...
...
src/ui/Home/index.module.scss
0 → 100644
View file @
112a3952
body
{
text-align
:
center
;
position
:
relative
;
margin
:
0
;
padding
:
0
;
border
:
0
;
}
.account-header
{
position
:
relative
;
z-index
:
200
;
top
:
0
;
left
:
0
;
background
:
#28272d
99
;
border-bottom
:
1px
solid
rgba
(
150
,
150
,
150
,
.2
);
width
:
100%
;
height
:
40px
;
.header-user
{
position
:
absolute
;
right
:
2%
;
top
:
0
;
display
:
flex
;
align-items
:
center
;
img
{
margin
:
0
.5rem
;
}
.header-user-btn
{
color
:
#c9cbd0
;
}
.sep
{
margin
:
0
.8rem
;
}
}
}
.account-header
>
a
:first-child
{
display
:
inline-block
;
position
:
absolute
;
left
:
2%
;
top
:
0
;
}
.container
{
position
:
relative
;
}
src/ui/Home/index.tsx
0 → 100644
View file @
112a3952
import
React
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
accountStore
}
from
"
@/stores
"
;
import
styles
from
"
./index.module.scss
"
;
const
NeosConfig
=
useConfig
();
const
Home
:
React
.
FC
=
()
=>
{
const
{
user
}
=
useSnapshot
(
accountStore
);
const
onLogout
=
()
=>
{};
// TODO
return
(
<>
<
div
className=
{
styles
[
"
account-header
"
]
}
>
<
a
href=
"https://mycard.moe/"
>
<
img
src=
{
`${NeosConfig.assetsPath}/mycard_logo.png`
}
alt=
"MyCard"
width=
{
130
}
height=
{
40
}
/>
</
a
>
<
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=
"javascript:void(0)"
onClick=
{
onLogout
}
>
登出
</
a
>
</
div
>
</
div
>
</>
);
};
export
default
Home
;
src/ui/Neos.tsx
View file @
112a3952
...
...
@@ -10,11 +10,13 @@ const Mora = React.lazy(() => import("./Mora"));
const
NeosDuel
=
React
.
lazy
(()
=>
import
(
"
./Duel/Main
"
));
const
Replay
=
React
.
lazy
(()
=>
import
(
"
./Replay
"
));
const
SSO
=
React
.
lazy
(()
=>
import
(
"
./SSO
"
));
const
Home
=
React
.
lazy
(()
=>
import
(
"
./Home
"
));
export
default
function
()
{
return
(
<
Routes
>
<
Route
path=
"/"
element=
{
<
LazyLoad
lazy=
{
<
Start
/>
}
/>
}
/>
<
Route
path=
"/home"
element=
{
<
LazyLoad
lazy=
{
<
Home
/>
}
/>
}
/>
<
Route
path=
"/match"
element=
{
<
LazyLoad
lazy=
{
<
Match
/>
}
/>
}
/>
<
Route
path=
"/room/:player/:passWd/:ip"
...
...
src/ui/SSO/index.tsx
View file @
112a3952
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
accountStore
,
User
}
from
"
@/stores
"
;
...
...
@@ -14,6 +15,7 @@ const SSO: React.FC = () => {
:
undefined
;
const
[
logined
,
setLogined
]
=
useState
(
false
);
const
navigate
=
useNavigate
();
useEffect
(()
=>
{
if
(
!
sso
)
{
...
...
@@ -25,7 +27,7 @@ const SSO: React.FC = () => {
if
(
user
)
{
accountStore
.
login
(
user
);
setLogined
(
true
);
// TODO: navigate
navigate
(
"
/home
"
);
}
},
[]);
...
...
src/ui/Start/index.module.scss
View file @
112a3952
...
...
@@ -146,7 +146,7 @@ body * {
width
:
$particleSize
+
px
;
height
:
$particleSize
+
px
;
$startPositionY
:
random
(
10
)
+
8
0
;
$startPositionY
:
random
(
10
)
+
6
0
;
$framesName
:
"move-frames"
+
$i
;
$moveDuration
:
28000
+
random
(
9000
)
+
ms
;
...
...
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