Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make features transition smoother #155

Merged
merged 4 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Here is a template for new release sections
- objectives route and blueprint (#128)
- links from logo (#129)
- about-map page (#153)
- fadein for features (#155)

### Changed
- allow use of variable via URL (#76)
Expand Down
5 changes: 2 additions & 3 deletions app/static/js/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ var bkgs = {
// Set the preselected background
featureDiv.css('background-image', "url('static/img/img-3-feature-developer.png')");

var fade1 = 0.3;
var fade2 = 1;
var fade1 = 0.2;
var fade2 = 1.5;


function apply_select(feature_type){
Expand Down Expand Up @@ -42,7 +42,6 @@ function hover_features() {
featureDiv.fadeTo('slow', fade1, function(){
$(this).css('background-image', "url('static/img/" + bkgs[ftId] + "')");
}).fadeTo('slow', fade2);

// Find the previously selected tab
var prevSelectedTab = $('.selected--opt--content')[0];
var prevFtId = prevSelectedTab.id
Expand Down
14 changes: 14 additions & 0 deletions app/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,14 @@ header a:focus{

.landing-feature {
background-image: url("img/img-3-feature-developer.png");
animation: animation: features_transition 2s ease-in;
-webkit-animation: features_transition 2s ease-in; /* Chrome, Safari, Opera */
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
padding-top: 10rem;
padding-bottom: 6rem;
height:650px;
}

.landing-feature h2,
Expand Down Expand Up @@ -1119,4 +1122,15 @@ Added this trick to fix it */
{
margin-top:-5.5rem; /* this is again negative value of the height of your header */

}

/* test */

.selected--opt--content {
animation: features_transition 1.5s ease-in;
}

@keyframes features_transition {
from {opacity: 0}
to {opacity: 1;}
}