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
defc2a80
Commit
defc2a80
authored
Jul 28, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: layout and start
parent
00b68aa0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
149 additions
and
89 deletions
+149
-89
neos-assets/neos.png
neos-assets/neos.png
+0
-0
src/styles/core.scss
src/styles/core.scss
+2
-1
src/ui/Layout/index.module.scss
src/ui/Layout/index.module.scss
+24
-0
src/ui/Layout/index.tsx
src/ui/Layout/index.tsx
+27
-0
src/ui/Neos.tsx
src/ui/Neos.tsx
+20
-1
src/ui/Start/index.module.scss
src/ui/Start/index.module.scss
+58
-54
src/ui/Start/index.tsx
src/ui/Start/index.tsx
+18
-33
No files found.
neos-assets/neos.png
0 → 100644
View file @
defc2a80
1.33 MB
src/styles/core.scss
View file @
defc2a80
...
@@ -107,7 +107,8 @@ p,
...
@@ -107,7 +107,8 @@ p,
section
,
section
,
span
,
span
,
image
,
image
,
img
{
img
,
nav
{
box-sizing
:
border-box
;
box-sizing
:
border-box
;
}
}
...
...
src/ui/Layout/index.module.scss
0 → 100644
View file @
defc2a80
.navbar
{
--height
:
48px
;
width
:
100%
;
height
:
var
(
--
height
);
display
:
flex
;
flex-wrap
:
wrap
;
align-content
:
center
;
padding
:
0
1rem
;
gap
:
1rem
;
box-sizing
:
border-box
;
.logo
{
height
:
100%
;
filter
:
brightness
(
1
.5
);
margin-right
:
-10px
;
// 以后删除这个,现在这么写是因为图片边框有点大
}
a
{
color
:
white
;
font-family
:
sans-serif
;
text-decoration
:
none
;
font-size
:
0
.825rem
;
line-height
:
var
(
--
height
);
// height: fit-content;
}
}
src/ui/Layout/index.tsx
0 → 100644
View file @
defc2a80
import
{
NavLink
,
Outlet
}
from
"
react-router-dom
"
;
import
{
useConfig
}
from
"
@/config
"
;
const
NeosConfig
=
useConfig
();
import
styles
from
"
./index.module.scss
"
;
export
const
NeosLayout
=
()
=>
{
return
(
<>
<
nav
className=
{
styles
.
navbar
}
>
<
img
className=
{
styles
.
logo
}
src=
{
`${NeosConfig.assetsPath}/neos_logo.png`
}
alt=
"NEOS"
/>
<
NavLink
to=
"/"
>
主页
</
NavLink
>
<
NavLink
to=
"/match"
>
匹配
</
NavLink
>
<
NavLink
to=
"/build"
>
组卡
</
NavLink
>
<
span
style=
{
{
flexGrow
:
1
}
}
/>
<
NavLink
to=
"/home"
>
我的
</
NavLink
>
</
nav
>
<
Outlet
/>
</>
);
};
src/ui/Neos.tsx
View file @
defc2a80
...
@@ -6,6 +6,7 @@ import {
...
@@ -6,6 +6,7 @@ import {
RouterProvider
,
RouterProvider
,
}
from
"
react-router-dom
"
;
}
from
"
react-router-dom
"
;
import
{
NeosLayout
}
from
"
./Layout
"
;
import
LazyLoad
,
{
Loading
}
from
"
./LazyLoad
"
;
import
LazyLoad
,
{
Loading
}
from
"
./LazyLoad
"
;
const
Start
=
React
.
lazy
(()
=>
import
(
"
./Start
"
));
const
Start
=
React
.
lazy
(()
=>
import
(
"
./Start
"
));
...
@@ -17,10 +18,28 @@ const Replay = React.lazy(() => import("./Replay"));
...
@@ -17,10 +18,28 @@ const Replay = React.lazy(() => import("./Replay"));
const
SSO
=
React
.
lazy
(()
=>
import
(
"
./SSO
"
));
const
SSO
=
React
.
lazy
(()
=>
import
(
"
./SSO
"
));
const
Home
=
React
.
lazy
(()
=>
import
(
"
./Home
"
));
const
Home
=
React
.
lazy
(()
=>
import
(
"
./Home
"
));
// TODO: finish this
const
_router
=
createBrowserRouter
([
{
path
:
"
/
"
,
element
:
<
NeosLayout
/>,
children
:
[
{
path
:
"
/
"
,
element
:
<
LazyLoad
lazy=
{
<
Start
/>
}
/>,
},
{
path
:
"
/match
"
,
element
:
<
LazyLoad
lazy=
{
<
Match
/>
}
/>,
},
],
},
]);
// 暂且先这么写,为后重构为createBrowserRouter打基础
// 暂且先这么写,为后重构为createBrowserRouter打基础
const
router
=
createBrowserRouter
(
const
router
=
createBrowserRouter
(
createRoutesFromElements
(
createRoutesFromElements
(
<
Route
>
<
Route
path=
"/"
element=
{
<
NeosLayout
/>
}
>
<
Route
path=
"/"
element=
{
<
LazyLoad
lazy=
{
<
Start
/>
}
/>
}
/>
<
Route
path=
"/"
element=
{
<
LazyLoad
lazy=
{
<
Start
/>
}
/>
}
/>
<
Route
path=
"/home"
element=
{
<
LazyLoad
lazy=
{
<
Home
/>
}
/>
}
/>
<
Route
path=
"/home"
element=
{
<
LazyLoad
lazy=
{
<
Home
/>
}
/>
}
/>
<
Route
path=
"/match"
element=
{
<
LazyLoad
lazy=
{
<
Match
/>
}
/>
}
/>
<
Route
path=
"/match"
element=
{
<
LazyLoad
lazy=
{
<
Match
/>
}
/>
}
/>
...
...
src/ui/Start/index.module.scss
View file @
defc2a80
...
@@ -11,24 +11,6 @@ body * {
...
@@ -11,24 +11,6 @@ body * {
font-size
:
1em
;
font-size
:
1em
;
}
}
.mycard-header
{
position
:
relative
;
z-index
:
5000
;
top
:
0
;
left
:
0
;
background
:
rgba
(
0
,
0
,
0
,
.6
);
border-bottom
:
1px
solid
rgba
(
150
,
150
,
150
,
.2
);
width
:
100%
;
height
:
40px
;
}
.mycard-header
>
a
:first-child
{
display
:
inline-block
;
position
:
absolute
;
left
:
2%
;
top
:
0
;
}
.wrapper
{
.wrapper
{
position
:
relative
;
position
:
relative
;
}
}
...
@@ -37,49 +19,71 @@ body * {
...
@@ -37,49 +19,71 @@ body * {
z-index
:
20
;
z-index
:
20
;
}
}
.neos-header
{
.main
{
display
:
flex
;
height
:
650px
;
align-items
:
center
;
width
:
650px
;
justify-content
:
center
;
margin
:
auto
;
z-index
:
20
;
margin-top
:
50px
;
// FIXME
padding
:
22em
0
4em
;
}
.
neos-header
:
:
after
{
background-image
:
url(/neos-assets/monster.png)
;
background-position
:
center
-50px
;
content
:
""
;
position
:
absolute
;
width
:
100%
;
height
:
100%
;
left
:
0
;
top
:
0
;
background-repeat
:
no-repeat
;
z-index
:
1
;
}
.neos-header
h1
{
margin-bottom
:
1em
;
padding
:
0
1
.5em
;
position
:
relative
;
position
:
relative
;
z-index
:
2
;
.neos-pic
{
max-width
:
100%
;
max-height
:
100%
;
z-index
:
1
;
}
.neos-logo
{
filter
:
brightness
(
2
)
drop-shadow
(
0
0
0
.75rem
#ffffff
b8
)
drop-shadow
(
0
0
0
.1rem
#373737
c6
);
position
:
absolute
;
bottom
:
0%
;
width
:
100%
;
left
:
50%
;
transform
:
translateX
(
-50%
);
}
}
}
.neos-header
button
{
.start-btn
{
color
:
white
;
font-family
:
sans-serif
;
text-decoration
:
none
;
appearance
:
none
;
cursor
:
pointer
;
position
:
relative
;
position
:
relative
;
background-color
:
transparent
;
display
:
inline-flex
;
-webkit-box-align
:
center
;
align-items
:
center
;
-webkit-box-pack
:
center
;
justify-content
:
center
;
white-space-collapse
:
collapse
;
text-wrap
:
nowrap
;
user-select
:
none
;
max-width
:
100%
;
flex-shrink
:
0
;
height
:
48px
;
border-radius
:
9999px
;
text-shadow
:
rgba
(
0
,
0
,
0
,
0
.25
)
0px
3px
8px
;
gap
:
8px
;
margin
:
0px
;
font
:
inherit
inherit
inherit
inherit
inherit
inherit
inherit
inherit
inherit
inherit
inherit
inherit
inherit
;
transition
:
border
120ms
ease
0s
,
background-color
,
color
,
box-shadow
,
opacity
;
padding
:
0px
24px
;
border-width
:
initial
;
border-style
:
none
;
border-style
:
none
;
color
:
rgba
(
255
,
255
,
255
,
.8
);
border-color
:
initial
;
font-family
:
var
(
--
theme-font
);
border-image
:
initial
;
font-size
:
2
.5em
;
background
:
linear-gradient
(
font-weight
:
bold
;
92
.88deg
,
text-shadow
:
0
0
0
.5em
#a2162d
,
0
0
0
.5em
#f80000
d6
;
rgb
(
69
,
94
,
181
)
9
.16%
,
z-index
:
2
;
rgb
(
86
,
67
,
204
)
43
.89%
,
rgb
(
103
,
63
,
215
)
64
.72%
);
transition
:
0
.2s
;
&
:hover
{
filter
:
brightness
(
1
.2
);
}
}
}
.neos-header
button
:hover
{
// 以下是粒子动画的样式
text-shadow
:
0
0
0
.5em
#2137bd
,
0
0
0
.5em
#2137bd
;
}
.particles-container
{
.particles-container
{
width
:
100%
;
width
:
100%
;
...
...
src/ui/Start/index.tsx
View file @
defc2a80
import
React
from
"
react
"
;
import
React
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
Link
}
from
"
react-router-dom
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
...
@@ -7,46 +7,31 @@ import styles from "./index.module.scss";
...
@@ -7,46 +7,31 @@ import styles from "./index.module.scss";
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
const
Start
:
React
.
FC
=
()
=>
{
const
Start
:
React
.
FC
=
()
=>
{
const
navigate
=
useNavigate
();
return
(
return
(
<>
<>
<
div
className=
{
styles
[
"
mycard-header
"
]
}
>
<
a
href=
"https://mycard.moe/"
>
<
img
src=
{
`${NeosConfig.assetsPath}/mycard_logo.png`
}
alt=
"MyCard"
width=
{
130
}
height=
{
40
}
/>
</
a
>
</
div
>
<
div
className=
{
styles
.
wrapper
}
>
<
div
className=
{
styles
.
wrapper
}
>
<
div
className=
{
styles
[
"
particles-container
"
]
}
>
<
div
className=
{
styles
[
"
particles-container
"
]
}
>
{
Array
.
from
({
length
:
100
}).
map
((
_
)
=>
(
{
Array
.
from
({
length
:
100
}).
map
((
_
,
key
)
=>
(
<
div
className=
{
styles
[
"
particle-container
"
]
}
>
<
div
key=
{
key
}
className=
{
styles
[
"
particle-container
"
]
}
>
<
div
className=
{
styles
[
"
particle
"
]
}
/>
<
div
className=
{
styles
[
"
particle
"
]
}
/>
</
div
>
</
div
>
))
}
))
}
</
div
>
</
div
>
<
div
role=
"banner"
className=
{
styles
[
"
neos-header
"
]
}
>
<
main
className=
{
styles
[
"
main
"
]
}
>
<
div
>
<
img
<
h1
>
className=
{
styles
[
"
neos-logo
"
]
}
<
img
src=
{
`${NeosConfig.assetsPath}/neos_logo.png`
}
src=
{
`${NeosConfig.assetsPath}/neos_logo.png`
}
alt=
"YGO NEOS"
width=
{
540
}
/>
height=
{
250
}
<
img
alt=
"YGO NEOS"
className=
{
styles
[
"
neos-pic
"
]
}
/>
src=
{
`${NeosConfig.assetsPath}/neos.png`
}
</
h1
>
alt=
"neos"
<
button
/>
onClick=
{
()
=>
{
</
main
>
navigate
(
"
/sso
"
);
<
Link
to=
"/sso"
className=
{
styles
[
"
start-btn
"
]
}
>
}
}
登录游戏
>
</
Link
>
登录萌卡进行游玩
</
button
>
</
div
>
</
div
>
</
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