Skip to content

Commit 617c724

Browse files
authored
Merge pull request #388 from coopdevs/fix/first-pages-on-mobile
Optimised first pages on mobile
2 parents 60718d5 + 2833dcb commit 617c724

File tree

6 files changed

+53
-11
lines changed

6 files changed

+53
-11
lines changed

app/assets/images/home_back.jpg

-804 KB
Loading
281 KB
Loading

app/assets/stylesheets/_footer.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.footer {
22
padding: 8px 0;
3-
line-height: 40px;
3+
line-height: 34px;
44
width: 100%;
55
background: rgba($palette-dark-turkey ,0.8);
66

@@ -63,6 +63,7 @@
6363
& {
6464
background-color: transparent;
6565
border: 1px solid white;
66+
padding: 4px 8px;
6667
}
6768

6869
&:hover {

app/assets/stylesheets/application.css.scss

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ html {
1313
}
1414

1515
.content {
16-
min-height: 500px;
1716
margin-bottom: 76px;
1817
}
1918

@@ -31,7 +30,8 @@ html {
3130
padding: 10px 16px;
3231

3332
@media(max-width: $screen-sm-min) {
34-
padding: 10px;
33+
padding: 8px;
34+
font-size: 15px;
3535
}
3636
}
3737

@@ -50,7 +50,7 @@ html {
5050
border: 0;
5151
border-radius: 0.3rem;
5252
margin: 0;
53-
padding: 1rem 0 1.4rem 0;
53+
padding: 0;
5454
}
5555

5656
form .material-icons {
@@ -112,10 +112,15 @@ html {
112112

113113
.input-group-addon {
114114
border-radius: 0.3rem 0 0 0.3rem;
115+
116+
@media(max-width: $screen-sm-min) {
117+
padding: 10px;
118+
}
115119
}
116120

117121
.input-lg, #user_email {
118122
border-radius: 0 0.3rem 0.3rem 0;
123+
padding: 0 4px;
119124
}
120125

121126
#user_password {
@@ -129,12 +134,20 @@ html {
129134
color: $form-input-glyph;
130135
font-size: 2.24rem;
131136
letter-spacing: -0.0040rem;
137+
138+
@media(max-width: $screen-sm-min) {
139+
font-size: 1.8rem;
140+
}
132141
}
133142

134143
.form-control {
135144
border: 0;
136145
font-weight: 400;
137146
height: 7.5rem;
147+
148+
@media(max-width: $screen-sm-min) {
149+
height: 6rem;
150+
}
138151
}
139152

140153
.form-control:focus {
@@ -379,18 +392,36 @@ label[required]::after{
379392
background: image-url('home_back.jpg') no-repeat center center fixed;
380393
background-size: cover;
381394

395+
@media(max-width: $screen-sm-min) {
396+
background: image-url('home_back_mobile.jpg') no-repeat center center fixed;
397+
background-size: cover;
398+
}
399+
382400
.back-overlay {
383401
display: block;
384402
filter: alpha(opacity = 60); /* For IE8 and earlier */
385403
opacity: 0.2;
386404
}
387405

388-
.vertical-align {
406+
.login-wrapper {
389407
position: absolute;
390-
top: 46%;
391-
left: 50%;
392-
transform: translate(-50%, -50%);
408+
top: 20%;
409+
left: 0;
393410
width: 100%;
411+
z-index: 1;
412+
413+
@media(max-width: $screen-sm-min) {
414+
top: 60px;
415+
}
416+
}
417+
418+
.home-wrapper {
419+
position: absolute;
420+
top: 20%;
421+
left: 0;
422+
padding: 26px;
423+
width: 100%;
424+
z-index: 1;
394425
}
395426

396427
.container-inner {
@@ -414,6 +445,11 @@ label[required]::after{
414445
background-size: cover;
415446
text-align: center;
416447

448+
@media(max-width: $screen-sm-min) {
449+
background: image-url('home_back_mobile.jpg') no-repeat center center fixed;
450+
background-size: cover;
451+
}
452+
417453
.back-overlay {
418454
filter: alpha(opacity = 15); /* For IE8 and earlier */
419455
opacity: 0.15;
@@ -610,6 +646,11 @@ label[required]::after{
610646
padding: 8rem 1rem;
611647
text-align: center;
612648

649+
@media(max-width: $screen-sm-min) {
650+
background: image-url('home_back_mobile.jpg') no-repeat center center fixed;
651+
background-size: cover;
652+
}
653+
613654
h2 {
614655
font-size: 2.88em;
615656
font-weight: 600;

app/views/devise/sessions/new.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="vertical-align">
1+
<div class="login-wrapper">
22
<div class="col-xs-12 col-sm-8 col-md-6 col-lg-6 col-sm-offset-2 col-md-offset-3 col-lg-offset-3">
33
<div class="panel" id="login-box">
44
<div class="panel-body">

app/views/home/index.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="content">
2-
<div class="vertical-align">
2+
<div class="home-wrapper">
33
<h2><%= t("application.landing.slogan") %></h2>
44
<h3><%= t("application.landing.sub_slogan") %></h3>
55
<a href="/login" class="btn btn-info" role="button"><%= t("application.landing.button") %></a>
66
</div>
7-
</div>
7+
</div>

0 commit comments

Comments
 (0)