Commit f970995f authored by 神楽坂玲奈's avatar 神楽坂玲奈

clean

parent b03882eb
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
"production": { "production": {
"optimization": true, "optimization": true,
"outputHashing": "all", "outputHashing": "all",
"sourceMap": false, "sourceMap": true,
"extractCss": true, "extractCss": true,
"namedChunks": false, "namedChunks": false,
"aot": true, "aot": true,
......
{ {
"name": "mycard-mobile", "name": "mycard-mobile",
"version": "1.0.22", "version": "1.0.23",
"license": "UNLISENCED", "license": "UNLISENCED",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
......
...@@ -79,6 +79,9 @@ ...@@ -79,6 +79,9 @@
<mat-grid-tile> <mat-grid-tile>
<button mat-raised-button (click)="ygopro.backHome()"><span class="icon">233</span><br>直连</button> <button mat-raised-button (click)="ygopro.backHome()"><span class="icon">233</span><br>直连</button>
</mat-grid-tile> </mat-grid-tile>
<!--<mat-grid-tile><a mat-raised-button>-->
<!--<mat-icon>casino</mat-icon>-->
<!--<br>轮抽 (开发中)</a></mat-grid-tile>-->
</mat-grid-list> </mat-grid-list>
<mat-card *ngIf="ygopro.points"> <mat-card *ngIf="ygopro.points">
......
...@@ -4,7 +4,6 @@ import { LoginService } from '../login.service'; ...@@ -4,7 +4,6 @@ import { LoginService } from '../login.service';
import { routerTransition } from '../router.animations'; import { routerTransition } from '../router.animations';
import { YGOProService } from '../ygopro.service'; import { YGOProService } from '../ygopro.service';
@Component({ @Component({
selector: 'app-new-room', selector: 'app-new-room',
templateUrl: 'new-room.component.html', templateUrl: 'new-room.component.html',
...@@ -12,42 +11,39 @@ import { YGOProService } from '../ygopro.service'; ...@@ -12,42 +11,39 @@ import { YGOProService } from '../ygopro.service';
animations: [routerTransition] animations: [routerTransition]
}) })
export class NewRoomComponent { export class NewRoomComponent {
@HostBinding('@routerTransition') animation = '';
@HostBinding('@routerTransition') @ViewChild('hostPasswordInput') hostPasswordInput: ElementRef;
animation = '';
@ViewChild('hostPasswordInput')
hostPasswordInput: ElementRef;
host_password = (this.login.user.external_id ^ 0x54321).toString(); host_password = (this.login.user.external_id ^ 0x54321).toString();
room = { room = {
title: this.login.user.username + '的房间', title: this.login.user.username + '的房间',
'private': false, private: false,
options: {...this.ygopro.default_options} options: { ...this.ygopro.default_options }
}; };
constructor(public ygopro: YGOProService, private login: LoginService, private snackBar: MatSnackBar) { constructor(public ygopro: YGOProService, private login: LoginService, private snackBar: MatSnackBar) {
} }
copy(host_password: string) { copy(host_password: string) {
try { try {
this.hostPasswordInput.nativeElement.select(); this.hostPasswordInput.nativeElement.select();
if (document.execCommand('copy')) { if (document.execCommand('copy')) {
this.snackBar.open(`房间密码 ${host_password} 已复制到剪贴板`, undefined, {duration: 3000}); this.snackBar.open(`房间密码 ${host_password} 已复制到剪贴板`, undefined, { duration: 3000 });
} else { } else {
console.log('Oops, unable to copy'); console.log('Oops, unable to copy');
} }
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
} }
share(host_password: string) { share(host_password: string) {
this.ygopro.share('房间密码是' + host_password); return navigator.share({
text: '房间密码是' + host_password
});
} }
set_start_lp() { set_start_lp() {
...@@ -57,5 +53,4 @@ export class NewRoomComponent { ...@@ -57,5 +53,4 @@ export class NewRoomComponent {
this.room.options.start_lp = 8000; this.room.options.start_lp = 8000;
} }
} }
} }
...@@ -396,15 +396,6 @@ export class YGOProService { ...@@ -396,15 +396,6 @@ export class YGOProService {
alert(JSON.stringify({ method: 'backHome', params: [] })); alert(JSON.stringify({ method: 'backHome', params: [] }));
} }
} }
share(text: string) {
try {
window.ygopro.share(text);
} catch (error) {
console.error(error);
alert(JSON.stringify({ method: 'share', params: [text] }));
}
}
} }
type Message = type Message =
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<title>MyCard Mobile</title> <title>MyCard Mobile</title>
<base href="/"> <base href="/">
<meta name="theme-color" content="#673ab7"> <meta name="theme-color" content="#673ab7">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
</head> </head>
<body> <body>
......
/* SystemJS module definition */
declare var module: NodeModule;
interface NodeModule {
id: string;
}
interface Window { interface Window {
ygopro: { ygopro: {
// 加入房间 // 加入房间
join (address: string, port: number, username: string, password: string): void join(address: string, port: number, username: string, password: string): void;
// 编辑卡组 // 编辑卡组
edit_deck (): void edit_deck(): void;
// 观看录像,进入观看录像界面 // 观看录像,进入观看录像界面
watch_replay(): void watch_replay(): void;
// 残局模式 // 残局模式
puzzle_mode(): void puzzle_mode(): void;
openDrawer(): void openDrawer(): void;
backHome(): void backHome(): void;
share(text: string): void updateUser(name: string, avatar: string, status: string): void;
updateUser(name: string, avatar: string, status: string): void
readFile(path: string): string;
readFile(path: string): string writeFile(path: string, data: string): string;
writeFile(path: string, data: string): string readdir(path: string): string;
readdir(path: string): string unlink(path: string): boolean;
unlink(path: string): boolean getFileLastModified(path: string): number;
getFileLastModified(path: string): number setFileLastModified(path: string, time: number): void;
setFileLastModified(path: string, time: number): void
}; };
} }
interface Navigator {
share: (options: { title?: string; text?: string; url?: string }) => Promise<{}>;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment