Skip to content

Commit df79a0f

Browse files
committed
show less button -> stick on bottom
1 parent 3cfca0b commit df79a0f

4 files changed

Lines changed: 30 additions & 7 deletions

File tree

‎index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ <h1>{{project.name}}</h1>
181181
</div>
182182
</div>
183183

184-
<div ng-class="{ buttonMore: projLast == 100 }" ng-hide="(projects | projectsFilter:this).length < 10">
184+
<div ng-class="{ buttonMore: projLast > 10, buttonLess : projLast == 10 }" ng-hide="(projects | projectsFilter:this).length < 10">
185185
<div class="row text-center">
186186
<button class="button" ng-click="showHideProj()">
187187
<span ng-hide="projLast == 100">Show more...</span>

‎js/script.js‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,15 @@ $(function(){
403403

404404
$(window).scroll(function () {
405405
scrollTop = $(window).scrollTop();
406-
407-
$(".buttonMore").css({top: scrollTop});
406+
407+
var endOfProjects = scrollTop + $(window).height() - $('.top').height() - $('.header').height();
408+
console.info(endOfProjects);
409+
if (endOfProjects < 50 ) {
410+
$(".buttonMore").css({position: 'fixed', bottom: 50});
411+
}
412+
else {
413+
$(".buttonMore").css({position: 'relative', bottom: 0});
414+
}
408415

409416
// ----------------------------------------------------------------------------
410417
// First parallax: header

‎stylesheets/app.css‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7672,15 +7672,23 @@ a.th {
76727672
}
76737673
/* line 475, sass/app.scss */
76747674
.main .buttonMore {
7675-
position: absolute;
7675+
position: fixed;
7676+
left: 0;
7677+
bottom: 50px;
7678+
width: 100%;
7679+
}
7680+
/* line 482, sass/app.scss */
7681+
.main .buttonLess {
7682+
bottom: 0 !important;
7683+
position: relative !important;
76767684
}
7677-
/* line 479, sass/app.scss */
7685+
/* line 487, sass/app.scss */
76787686
.main .clear {
76797687
clear: both;
76807688
}
76817689

76827690
/* For reseting magellan on top :) */
7683-
/* line 486, sass/app.scss */
7691+
/* line 494, sass/app.scss */
76847692
.featured {
76857693
position: absolute;
76867694
top: 0;

‎stylesheets/sass/app.scss‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,16 @@ $header-font-family: 'Open Sans', Cambria, 'Times New Roman', Times, sans-serif
473473
.org { height: 100px; }
474474

475475
.buttonMore {
476-
position: absolute;
476+
position: fixed;
477+
left: 0;
478+
bottom: 50px;
479+
width: 100%;
477480
}
481+
482+
.buttonLess {
483+
bottom: 0 !important;
484+
position: relative !important;
485+
}
478486

479487
.clear {
480488
clear: both;

0 commit comments

Comments
 (0)