From 5d6e3fc0897ca468f2326c294a03a7cd88da0073 Mon Sep 17 00:00:00 2001 From: HardiReady Date: Tue, 26 Feb 2019 15:42:06 +0100 Subject: [PATCH] Make army oveview mobile responsive --- static/src/app/app.config.ts | 1 + .../army/army-squad/army-squad.component.scss | 17 +++++- static/src/app/army/army.component.html | 22 ++++++-- static/src/app/army/army.component.scss | 55 +++++++++++++++++++ static/src/app/army/army.component.ts | 17 +++++- .../rank-overview.component.scss | 4 +- 6 files changed, 107 insertions(+), 9 deletions(-) diff --git a/static/src/app/app.config.ts b/static/src/app/app.config.ts index 9499120..ec695f6 100644 --- a/static/src/app/app.config.ts +++ b/static/src/app/app.config.ts @@ -44,6 +44,7 @@ export const RouteConfig = { export const BaseConfig = { responsive: { + breakpointSmallPx: 599, breakpointPx: 959, }, i18n: { diff --git a/static/src/app/army/army-squad/army-squad.component.scss b/static/src/app/army/army-squad/army-squad.component.scss index d00e68e..771a292 100644 --- a/static/src/app/army/army-squad/army-squad.component.scss +++ b/static/src/app/army/army-squad/army-squad.component.scss @@ -3,6 +3,21 @@ padding: 6px 0; } +@media all and (max-width: 599px) { + .squad-layout { + width: 100vw; + padding: 1vh 1vw; + } + + img { + right: 3vw; + } + + div.name-cell { + margin-left: 2vw; + } +} + .squad-layout > div { clear: both; } @@ -24,7 +39,7 @@ } .squad-member-count { - float:left; + float: left; color: whitesmoke; margin-left: 42px } diff --git a/static/src/app/army/army.component.html b/static/src/app/army/army.component.html index 3caa90b..92b49aa 100644 --- a/static/src/app/army/army.component.html +++ b/static/src/app/army/army.component.html @@ -1,8 +1,14 @@ -
+

{{'public.army.headline' | translate}}

-
-

{{fraction.BLUFOR}}

+
+

+ {{fraction.BLUFOR}} + +

{{'public.army.members' | translate}} {{army[0].memberCount}}
-
-

{{fraction.OPFOR}}

+
+

+ + {{fraction.OPFOR}} +

{ this.army = army; }); + + this.isSmallLayout = (window.innerWidth <= BaseConfig.responsive.breakpointSmallPx); + Observable.fromEvent(window, 'resize').subscribe(event => { + this.isSmallLayout = event.target['innerWidth'] <= BaseConfig.responsive.breakpointSmallPx; + }); }; select(memberId) { this.router.navigate(['member', memberId], {relativeTo: this.route}); } + + singleViewSwitch(switchFraction: Fraction) { + this.singleViewSelected = switchFraction; + } } diff --git a/static/src/app/pub/rank-overview/rank-overview.component.scss b/static/src/app/pub/rank-overview/rank-overview.component.scss index 36016f6..dc92687 100644 --- a/static/src/app/pub/rank-overview/rank-overview.component.scss +++ b/static/src/app/pub/rank-overview/rank-overview.component.scss @@ -8,11 +8,11 @@ @media all and (max-width: 959px) { .rank-overview-container { - width: 100vw; + width: 100%; } div.column-container { - width: 49vw; + width: 49%; } h1 {