Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Moecube Store
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
MyCard
Moecube Store
Commits
8d2b131d
Commit
8d2b131d
authored
Jul 09, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete layout
parent
21cf81d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
9 deletions
+44
-9
src/app/layout/layout.component.html
src/app/layout/layout.component.html
+5
-5
src/app/layout/layout.component.ts
src/app/layout/layout.component.ts
+39
-4
No files found.
src/app/layout/layout.component.html
View file @
8d2b131d
...
...
@@ -25,7 +25,7 @@
<br
/>
<img
class=
"no-select"
draggable=
"false"
style=
"margin:0 auto;width:580px;position: relative;top:40px;"
src=
"assets/img/desc.png"
/>
<div
style=
"margin:0 auto;position: relative; top:-50px;"
>
<a
href=
"{{ latest_current
| async
}}"
>
<a
href=
"{{ latest_current }}"
>
<!--<button nz-button nzType="primary" nzSize="large" nzShape="round"><i nz-icon type="download"></i>下载游戏
</button>-->
<img
...
...
@@ -206,9 +206,9 @@
排表、打印实卡比赛卡表等特色功能
<br
/>
</p>
<p
style=
"font-size: 20px;color:#313154;"
>
2019年7月进行了 1521293
场对战
</p>
<p
style=
"font-size: 20px;color:#313154;"
>
{{matchCount.year}}年{{matchCount.month}}月进行了 {{matchCount.count}}
场对战
</p>
<!-- <nz-statistic [nzValueStyle]="{ color: '#000D1E' }" [nzValue]="stats_online | async | number" [nzTitle]=""></nz-statistic>-->
<button
nz-button
nzType=
"primary"
nzSize=
"large"
><i
nz-icon
nzType=
"double-right"
nzTheme=
"outline"
></i>
进入决斗数据库
</button>
<button
nz-button
nzType=
"primary"
nzSize=
"large"
(click)=
'navigateToUrl("https://mycard.moe/ygopro/arena")'
><i
nz-icon
nzType=
"double-right"
nzTheme=
"outline"
></i>
进入决斗数据库
</button>
</div>
<div
nz-col
>
...
...
@@ -221,7 +221,7 @@
让你的游戏人生有趣起来
<br
/>
</p>
<!-- <nz-statistic [nzValueStyle]="{ color: '#000D1E' }" [nzValue]="1949101 | number" [nzTitle]=""></nz-statistic>-->
<button
nz-button
nzType=
"primary"
nzSize=
"large"
><i
nz-icon
nzType=
"double-right"
nzTheme=
"outline"
></i>
查看近期赛事
</button>
<button
nz-button
nzType=
"primary"
nzSize=
"large"
(click)=
'navigateToUrl("https://event.ygobbs.com")'
><i
nz-icon
nzType=
"double-right"
nzTheme=
"outline"
></i>
查看近期赛事
</button>
</div>
<!--
<div nz-col nzSpan="8">
...
...
@@ -239,7 +239,7 @@
</section>
<section
class=
"foot"
>
<p>
© MyCard 20
19
all rights reserved.
</p>
<p>
© MyCard 20
21
all rights reserved.
</p>
</section>
</nz-content>
</nz-layout>
src/app/layout/layout.component.ts
View file @
8d2b131d
...
...
@@ -3,21 +3,37 @@ import {HttpClient} from "@angular/common/http";
import
{
map
}
from
"
rxjs/operators
"
;
import
yaml
from
'
yaml
'
;
interface
HomePageMatchCountDto
{
count
:
number
;
year
:
number
;
month
:
number
;
}
@
Component
({
selector
:
'
app-layout
'
,
templateUrl
:
'
./layout.component.html
'
,
styleUrls
:
[
'
./layout.component.css
'
]
})
export
class
LayoutComponent
{
export
class
LayoutComponent
implements
OnInit
{
matchCount
:
HomePageMatchCountDto
=
{
count
:
100
,
year
:
1000
,
month
:
1
}
latest_win32
=
this
.
http
.
get
(
'
https://cdn01.moecube.com/downloads/latest.yml
'
,
{
responseType
:
'
text
'
})
.
pipe
(
map
(
rawData
=>
'
https://cdn01.moecube.com/downloads/
'
+
yaml
.
parse
(
rawData
).
path
));
latest_linux
=
this
.
http
.
get
(
'
https://cdn01.moecube.com/downloads/latest-linux.yml
'
,
{
responseType
:
'
text
'
})
.
pipe
(
map
(
rawData
=>
'
https://cdn01.moecube.com/downloads/
'
+
yaml
.
parse
(
rawData
).
path
));
latest_drawin
=
this
.
http
.
get
(
'
https://cdn01.moecube.com/downloads/latest-mac.yml
'
,
{
responseType
:
'
text
'
})
.
get
(
'
https://cdn01.moecube.com/downloads/latest-mac.yml
'
,
{
responseType
:
'
text
'
})
.
pipe
(
map
((
rawData
)
=>
'
https://cdn01.moecube.com/downloads/
'
+
yaml
.
parse
(
rawData
).
path
.
replace
(
'
-mac.zip
'
,
'
.dmg
'
)));
latest_current
=
navigator
.
platform
.
match
(
/Mac/i
)
?
this
.
latest_drawin
:
this
.
latest_win32
;
latest_current
=
''
stats_signups
=
this
.
http
.
get
(
'
https://ygobbs.com/admin/dashboard.json
'
,
{
...
...
@@ -33,10 +49,29 @@ export class LayoutComponent{
})
);
constructor
(
private
http
:
HttpClient
,
@
Inject
(
LOCALE_ID
)
public
locale
:
string
)
{}
constructor
(
private
http
:
HttpClient
,
@
Inject
(
LOCALE_ID
)
public
locale
:
string
)
{
}
async
ngOnInit
()
{
if
(
navigator
.
platform
.
match
(
/Mac/i
))
{
this
.
latest_current
=
await
this
.
latest_drawin
.
toPromise
();
}
else
if
(
navigator
.
platform
.
match
(
/Linux/i
))
{
this
.
latest_current
=
await
this
.
latest_linux
.
toPromise
();
}
else
{
this
.
latest_current
=
await
this
.
latest_win32
.
toPromise
();
}
this
.
matchCount
=
await
this
.
http
.
get
<
HomePageMatchCountDto
>
(
'
https://api.mycard.moe/ygopro/arena/homepageCount
'
,
{
responseType
:
'
json
'
}).
toPromise
();
}
setLocale
(
locale
)
{
document
.
cookie
=
`locale=
${
locale
}
`
;
location
.
reload
();
}
navigateToUrl
(
url
:
string
)
{
location
.
href
=
url
;
}
}
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