Skip to content

Commit

Permalink
Mobile Resolution incompatible
Browse files Browse the repository at this point in the history
  • Loading branch information
eufelipemateus committed Mar 12, 2021
1 parent cd439c9 commit fbed694
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "domino-game",
"version": "2.0.5",
"version": "2.0.6",
"description": "Domino is a game multiplayer made in node socket.io, typescript, node.js and html5.",
"main": "./._build/Server.js",
"engines": {
Expand Down Expand Up @@ -43,15 +43,14 @@
"geek",
"dom-html",
"dev-junior",
"runtime",
"DOM-Element",
"runtime",
"DOM-Element",
"brazil",
"gme",
"jogo-tabuleiro",
"fun",
"full-stack-developer",
"Dom"

"full-stack-developer",
"Dom"
],
"author": {
"name": "Felipe Mateus",
Expand Down
2 changes: 1 addition & 1 deletion public/css/forkme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion public/css/ui.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
body{
min-width:1024px !important;

}
.card{
text-align:center;
Expand Down Expand Up @@ -146,4 +146,21 @@ body{
height:162px;
display:inline-block;
float:right;
}

#mobile_message{
background-color: #FFF;
height: 100%;
width: 100%;
left: 0;
top: 0;
overflow: hidden;
position: fixed;
display: none;
align-items: center;
justify-content: center;
}

#mobile_message h1{
font-size: 1.5em;
}
5 changes: 4 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<head>
<body>
<div>
<div id="game">
<div id="tabuleiro">
<!-- Cartas no Tabuleiro -->
</div>
Expand Down Expand Up @@ -65,6 +65,9 @@ <h1>Estastiticas</h1>
</div>
</div>
</div>
<div id="mobile_message">
<h1>⚠️Resolução Incompatível!</h1>
</div>
<span id="forkongithub"><a href="https://github.com/eufelipemateus/domino-game">Fork me on GitHub</a></span>
</body>

Expand Down
2 changes: 1 addition & 1 deletion public/js/App.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Game } from './Game.js'

declare global {
interface Window { game: Game; }
interface Window { game: Game; io: any }
}

window.game = new Game(window.io);
11 changes: 10 additions & 1 deletion public/js/Game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class Game {

constructor(io) {
this.socket = io();
this.listen();
this.sizeScreen();
this.modal = new Modal(this);
}

Expand Down Expand Up @@ -173,4 +173,13 @@ export class Game {
document.getElementById('cards_in_hand').innerHTML = msg.cardsInHand;
});
}

private sizeScreen() {
if (window.screen.width >= 1024 && window.screen.height >= 768) {
this.listen();
}else{
document.getElementById("game").style.display = 'none';
document.getElementById('mobile_message').style.display = "flex";
}
}
}

0 comments on commit fbed694

Please sign in to comment.