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

clean

parent b03882eb
......@@ -29,7 +29,7 @@
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"sourceMap": true,
"extractCss": true,
"namedChunks": false,
"aot": true,
......
{
"name": "mycard-mobile",
"version": "1.0.22",
"version": "1.0.23",
"license": "UNLISENCED",
"scripts": {
"ng": "ng",
......
......@@ -79,6 +79,9 @@
<mat-grid-tile>
<button mat-raised-button (click)="ygopro.backHome()"><span class="icon">233</span><br>直连</button>
</mat-grid-tile>
<!--<mat-grid-tile><a mat-raised-button>-->
<!--<mat-icon>casino</mat-icon>-->
<!--<br>轮抽 (开发中)</a></mat-grid-tile>-->
</mat-grid-list>
<mat-card *ngIf="ygopro.points">
......
......@@ -4,7 +4,6 @@ import { LoginService } from '../login.service';
import { routerTransition } from '../router.animations';
import { YGOProService } from '../ygopro.service';
@Component({
selector: 'app-new-room',
templateUrl: 'new-room.component.html',
......@@ -12,42 +11,39 @@ import { YGOProService } from '../ygopro.service';
animations: [routerTransition]
})
export class NewRoomComponent {
@HostBinding('@routerTransition') animation = '';
@HostBinding('@routerTransition')
animation = '';
@ViewChild('hostPasswordInput')
hostPasswordInput: ElementRef;
@ViewChild('hostPasswordInput') hostPasswordInput: ElementRef;
host_password = (this.login.user.external_id ^ 0x54321).toString();
room = {
title: this.login.user.username + '的房间',
'private': false,
options: {...this.ygopro.default_options}
private: false,
options: { ...this.ygopro.default_options }
};
constructor(public ygopro: YGOProService, private login: LoginService, private snackBar: MatSnackBar) {
}
copy(host_password: string) {
try {
this.hostPasswordInput.nativeElement.select();
if (document.execCommand('copy')) {
this.snackBar.open(`房间密码 ${host_password} 已复制到剪贴板`, undefined, {duration: 3000});
this.snackBar.open(`房间密码 ${host_password} 已复制到剪贴板`, undefined, { duration: 3000 });
} else {
console.log('Oops, unable to copy');
}
} catch (error) {
console.log(error);
}
}
share(host_password: string) {
this.ygopro.share('房间密码是' + host_password);
return navigator.share({
text: '房间密码是' + host_password
});
}
set_start_lp() {
......@@ -57,5 +53,4 @@ export class NewRoomComponent {
this.room.options.start_lp = 8000;
}
}
}
......@@ -396,15 +396,6 @@ export class YGOProService {
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 =
......
......@@ -5,7 +5,7 @@
<title>MyCard Mobile</title>
<base href="/">
<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">
</head>
<body>
......
/* SystemJS module definition */
declare var module: NodeModule;
interface NodeModule {
id: string;
}
interface Window {
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
openDrawer(): void
backHome(): void
share(text: string): void
updateUser(name: string, avatar: string, status: string): void
readFile(path: string): string
writeFile(path: string, data: string): string
readdir(path: string): string
unlink(path: string): boolean
getFileLastModified(path: string): number
setFileLastModified(path: string, time: number): void
puzzle_mode(): void;
openDrawer(): void;
backHome(): void;
updateUser(name: string, avatar: string, status: string): void;
readFile(path: string): string;
writeFile(path: string, data: string): string;
readdir(path: string): string;
unlink(path: string): boolean;
getFileLastModified(path: string): number;
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