Skip to content

Commit 1428bf4

Browse files
authored
Merge pull request #10 from radek2s/mobile_view
Mobile view
2 parents 0518b53 + 8746f9b commit 1428bf4

File tree

4 files changed

+46
-3
lines changed

4 files changed

+46
-3
lines changed

karcioszki-ui/src/app/layout/game/game.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</button>
66
<span id="room">Pokój numer: {{gameSession.id}}</span>
77
</div>
8-
<div class="flex-container">
8+
<div id="card-package" class="flex-container">
99
<span>Zestaw kart: {{gameSession.gameCardPackage.packageName}}</span>
1010
</div>
1111
</mat-toolbar>

karcioszki-ui/src/app/layout/game/game.component.scss

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,36 @@ $active: rgb(59, 138, 59);
114114

115115
}
116116

117+
// tablet resolution //
118+
@media screen and (max-width: 768px) {
119+
#card-package {
120+
display: none;
121+
}
122+
#cards {
123+
padding: 0 15px;
124+
display: flex;
125+
flex-wrap: wrap;
126+
justify-content: space-between;
127+
button {
128+
font-size: 0.8rem;
129+
margin: 5%;
130+
width: 100%;
131+
padding: 2px;
132+
}
133+
}
134+
}
135+
136+
// phone resolution //
137+
@media screen and (max-width: 425px) {
138+
#cards {
139+
padding: 0;
140+
button {
141+
font-size: 0.6rem;
142+
margin: 2%;
143+
flex-basis: auto;
144+
}
145+
}
146+
}
117147

118148
.fill-remaining-space {
119149
flex: 1 1 auto;

karcioszki-ui/src/app/services/WebSocketAPI.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import * as SockJS from 'sockjs-client';
33

44
export class WebSocket {
55

6-
private WS_END_POINT: String = 'http://localhost:8080/karcioszki-ws';
6+
private development: boolean = true;
7+
private WS_END_POINT_PRODUCTION: String = window.location.href;
8+
private WS_END_POINT_DEVELOPMNET: String = 'http://localhost:8080/karcioszki-ws';
79
private component: any;
810
private destinationTopic: string;
911
private stompClient: any;
@@ -32,7 +34,13 @@ export class WebSocket {
3234
}
3335

3436
private _connect(): void {
35-
let ws = new SockJS(this.WS_END_POINT);
37+
let ws;
38+
if(this.development) {
39+
ws = new SockJS(this.WS_END_POINT_DEVELOPMNET);
40+
} else {
41+
let address = this.WS_END_POINT_PRODUCTION.split("/")
42+
ws = new SockJS(`${address[0]}//${address[2]}/karcioszki-ws`);
43+
}
3644
this.stompClient = Stomp.over(ws);
3745
const _this = this;
3846
_this.stompClient.connect({}, function(frame) {

src/main/resources/application.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
spring.jpa.hibernate.ddl-auto=update
2+
#Development
3+
server.address=localhost
4+
#Production
5+
#server.address=0.0.0.0
6+
server.port=8080
27

38
### MySQL Database configuration:
49
#spring.datasource.url=jdbc:mysql://localhost:3306/tajniacy_dev?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

0 commit comments

Comments
 (0)