Skip to content

Commit

Permalink
Merge pull request #157 from rl-institut/feature/animations
Browse files Browse the repository at this point in the history
Add animations and a link to credits
  • Loading branch information
Bachibouzouk authored Mar 24, 2020
2 parents c5b4755 + 3bebfb4 commit b71ee65
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ Here is a template for new release sections
- links from logo (#129)
- about-map page (#153)
- fadein for features (#155)

- automatic redraw of gauges when scrolling over (#157)
- automatic interval change of feature when section is in viewport (#157)
- link to web development credit page (#157)
### Changed
- allow use of variable via URL (#76)
- make table in about responsive and centered (#88)
Expand Down
44 changes: 43 additions & 1 deletion app/static/js/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,46 @@ $('.feature-previous').on("click", function() {
// Select the new tab and deselect the previously selected
selectedTab.className = 'opt--content';
prevTab.className = 'selected--opt--content';
});
});

// triggers a carousel of the features
var refreshInterval = 8000 //in ms
var featureInView = false;
var intervalID = null;
$(window).scroll(function() {
var hT = featureDiv.offset().top,
hH = featureDiv.outerHeight(),
wS = $(this).scrollTop();
if (wS < (hT + hH) && wS > hT - hH){
if(featureInView == false) {
intervalID = setInterval(function(){ $('.feature-next').click(); }, refreshInterval);
}
featureInView = true;
}
else{
if(featureInView == true) {
if(intervalID != undefined){
clearInterval(intervalID);
}
}
featureInView = false;
}
});

// triggers a redraw of the gauges when scrolling over the Our progress in number div
var inView = false;
var progressDiv = $("#landing-progress");
$(window).scroll(function() {
var hT = progressDiv.offset().top,
hH = progressDiv.outerHeight(),
wS = $(this).scrollTop();
if (wS < (hT + hH/2) && wS > hT - hH/2){
if(inView == false) {
$(".GaugeMeter").gaugeMeter()
}
inView = true;
}
else{
inView = false;
}
});
10 changes: 8 additions & 2 deletions app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,14 @@ <h1>Stay in touch</h1>
<div class="cell medium-4 center--align">
<p>&copy; {{ current_year }} All Rights Reserved by <b> nigeriase4all.gov.ng</b></p>
</div>
<div class="cell medium-4 large-3 footer-license__img">
<img src="{{ url_for('static', filename='logos/logo-5-blitz.png') }}">
<div class="cell medium-4 large-3 grid-x">
<div class="cell medium-offset-1 medium-9 center--align">
<a href="{{ url_for('about-map.about')}}" target="_blank">Web Development</a>
</div>
<div class="cell medium-2 footer-license__img">
<img src="{{ url_for('static', filename='logos/logo-5-blitz.png') }}">
</div>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit b71ee65

Please sign in to comment.