Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 07430e1

Browse files
authored
Merge pull request #1086 from shizhouxing/dev
Fix #995 - Stats row in the dashboard (mobile view)
2 parents 9092315 + 9451289 commit 07430e1

File tree

3 files changed

+98
-34
lines changed

3 files changed

+98
-34
lines changed

app/directives/responsive-carousel/responsive-carousel.directive.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,10 @@ import angular from 'angular'
4545
} else if(width >= 1010) {
4646
// desktop
4747
buildCarouselSlide(5)
48-
} else if(width < 1010 && width >= 768) {
49-
// tablet
48+
} else if(width < 1010) {
49+
// tablet & mobile
5050
buildCarouselSlide(4)
51-
} else {
52-
// we don't need to build carousel for mobile as we show horizontal scroll
53-
// phone
54-
buildCarouselSlide(2)
55-
}
51+
}
5652
}
5753

5854

assets/css/directives/responsive-carousel.scss

+52-22
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,30 @@
88
margin: 0 auto;
99
@media only screen and (max-width: 767px) {
1010
display: none;
11+
width: auto;
1112
}
12-
&[slide-count="1"] {
13-
width: 170px;
14-
}
15-
&[slide-count="2"] {
16-
width: 340px;
17-
}
18-
&[slide-count="3"] {
19-
width: 510px;
20-
}
21-
&[slide-count="4"] {
22-
width: 680px;
23-
}
24-
&[slide-count="5"] {
25-
width: 850px;
26-
}
27-
&[slide-count="6"] {
28-
width: 1020px;
29-
}
30-
&[slide-count="7"] {
31-
width: 1190px;
13+
@media only screen and (min-width: 768px) {
14+
&[slide-count="1"] {
15+
width: 170px;
16+
}
17+
&[slide-count="2"] {
18+
width: 340px;
19+
}
20+
&[slide-count="3"] {
21+
width: 510px;
22+
}
23+
&[slide-count="4"] {
24+
width: 680px;
25+
}
26+
&[slide-count="5"] {
27+
width: 850px;
28+
}
29+
&[slide-count="6"] {
30+
width: 1020px;
31+
}
32+
&[slide-count="7"] {
33+
width: 1190px;
34+
}
3235
}
3336

3437
li {
@@ -96,6 +99,10 @@
9699

97100
.slide {
98101
display: inline-block;
102+
103+
@media only screen and (max-width: 767px) {
104+
display: block;
105+
}
99106
}
100107

101108
// .carousel-elem-list {
@@ -107,22 +114,45 @@
107114
position: absolute;
108115
top: 32px;
109116
left: -30px;
110-
@include forward-slash(1px, 60px, 0, 2px, 30deg);
111117
background-color: $gray-light;
112118
@media only screen and (min-width: 768px) {
113119
top: 32px;
114120
left: -18px;
121+
@include forward-slash(1px, 60px, 0, 2px, 30deg);
115122
}
123+
@media only screen and (max-width: 767px) {
124+
top: -30px;
125+
left: 60px;
126+
@include forward-slash(1px, 70px, 0, 2px, 90deg);
127+
}
116128
}
117129
}
118130
}
131+
132+
133+
ul[slide-count="3"] {
134+
@media only screen and (min-width: 575px) {
135+
.slide {
136+
display: inline-block;
137+
138+
&:not(:first-child) {
139+
.carousel-elem:before {
140+
top: 32px;
141+
left: -18px;
142+
@include forward-slash(1px, 60px, 0, 2px, 30deg);
143+
}
144+
}
145+
}
146+
}
147+
}
148+
119149
.carousel-elem {
120150
position: relative;
121151
display: inline-block;
122152
margin-right: 65px;
123153
padding: 20px 0;
154+
width: 130px;
124155
@media only screen and (min-width: 768px) {
125-
width: 130px;
126156
margin-right: 35px;
127157
padding: 30px 20px;
128158

assets/css/profile/subtrack.scss

+43-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
margin: 30px auto 40px;
1717

1818
.nav-right {
19-
padding-top: 15px;
19+
padding-top: 10px;
2020
padding-left: 15px;
2121
i:hover {
2222
cursor: pointer;
@@ -108,6 +108,13 @@
108108
}
109109
}
110110

111+
.page-state-header {
112+
.page-info {
113+
display: flex;
114+
justify-content: center;
115+
}
116+
}
117+
111118
.subtrack-stats {
112119
// @include module-l;
113120
width: 100%;
@@ -183,15 +190,15 @@
183190
h2.detailed {
184191
margin: 30px auto 0;
185192
text-align: center;
186-
@include sofia-pro-medium;
187-
font-size: 18px;
188-
line-height: 21px;
189-
font-weight: bold;
193+
@include sofia-pro-regular;
194+
font-size: 24px;
195+
line-height: 30px;
190196
text-transform: uppercase;
191197
}
192198
ul.vertical-stats {
193199
width: 90%;
194200
margin: 0 auto;
201+
margin-top: 30px;
195202
li {
196203
@include sofia-pro-regular;
197204
font-size: 15px;
@@ -329,10 +336,20 @@
329336
}
330337
}
331338
}
339+
332340
@media (min-width: 768px) {
333341
.profile-subtrack-container {
334342

335343
.content {
344+
.page-info {
345+
display: flex;
346+
justify-content: center;
347+
}
348+
349+
.nav-right {
350+
padding-top: 15px;
351+
}
352+
336353
.nav {
337354
display: flex;
338355
flex-direction: row;
@@ -544,3 +561,24 @@
544561
}
545562

546563
}
564+
565+
@media only screen and (max-width: 767px) {
566+
.profile-subtrack-container {
567+
.content {
568+
.tc-carousel ul {
569+
display: block;
570+
height: auto;
571+
padding-bottom: 40px;
572+
573+
> li {
574+
position: relative;
575+
text-align: center;
576+
577+
.slide {
578+
text-align: center;
579+
}
580+
}
581+
}
582+
}
583+
}
584+
}

0 commit comments

Comments
 (0)