Better display of the game page on tablets

This commit is contained in:
Liam Westby 2018-03-06 09:40:35 -06:00
parent d72e308de3
commit cdd4e94480
2 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,7 @@
import * as $ from 'jquery';
import { Component, OnInit } from '@angular/core';
import { Meta } from '@angular/platform-browser';
import { GameWebsocket } from '../net/websocket';
@Component({
@ -23,9 +24,10 @@ export class GameComponent implements OnInit {
canvas: any;
context: CanvasRenderingContext2D;
constructor() { }
constructor(private meta: Meta) { }
ngOnInit() {
this.meta.addTag({name: 'viewport', content: 'width=1600'}, true);
this.roundId = sessionStorage.getItem('roundId');
console.log(`Round ID: ${this.roundId}`);
this.serverHost = document.location.hostname;

View File

@ -1,4 +1,5 @@
import { Component, OnInit, NgZone } from '@angular/core';
import { Meta } from '@angular/platform-browser';
import { Router } from '@angular/router';
import * as $ from 'jquery';
@ -9,11 +10,13 @@ import * as $ from 'jquery';
styleUrls: ['./login.component.scss']
})
export class LoginComponent implements OnInit {
constructor(private router: Router, private ngZone: NgZone) {
constructor(private router: Router, private ngZone: NgZone, private meta: Meta) {
}
ngOnInit() {}
ngOnInit() {
this.meta.removeTag('viewport');
}
createRound() {
$.post(`http://${document.location.hostname}:8080/round/create`, function(data) {