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

feat: add animated background #3266

Merged
merged 4 commits into from
Jun 11, 2020
Merged

Conversation

radium-v
Copy link
Collaborator

Description

This adds the animated background to the new homepage, adapted from Parker's original animation deliverable.

Issue type checklist

  • Chore: A change that does not impact distributed packages.
  • Bug fix: A change that fixes an issue, link to the issue above.
  • New feature: A change that adds functionality.

Is this a breaking change?

  • This change causes current functionality to break.

Adding or modifying component(s) in @microsoft/fast-components checklist

Process & policy checklist

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Copy link
Contributor

@nicholasrice nicholasrice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulled it down - looks awesome and far better performance! Nice!

display: flex;
height: 100vh;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that the title of features is being cut off when it is scrolled to on edge, and in safari features is being rendered on top of the bottom of frameworks. If height is changed back to min-height it seems to fix these issues.
edge:
Screen Shot 2020-06-10 at 9 41 11 AM
safari:
Screen Shot 2020-06-10 at 9 46 11 AM

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oof, my bad

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I too was seeing sections overlap in Edge, Firefox, Chrome, Opera, and Safari. Changing height in .section fixes most of it. At 750px wide and below when the community section changes to single column it overlaps the footer. Perhaps an adjustment to the .community-section margin-bottom property for smaller screen widths. The animation looks great!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll move the negative margin declarations into media queries to prevent issues on smaller screens, and change the height back to min-height.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking awesome now. I do still see some footer overlap at 750px and under when the community section goes to single column (except for Safari oddly enough), but everything else is looking great. Very smooth.

);

let last = window.performance.now();
const performAnimation = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to use the timestamp provided to the rAF callback by the platform?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a lead to fixing some performance issues in Firefox. I'll switch and see if there's any impact.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out this was part of the culprit! Firefox reduces precision for performance.now() for security reasons: https://developer.mozilla.org/en-US/docs/Web/API/Performance/now#Reduced_time_precision

Copy link
Contributor

@SamanthaAO SamanthaAO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@radium-v radium-v force-pushed the users/jokreitl/site-bg-wave branch from ca6f762 to e7d5aa5 Compare June 10, 2020 23:32
@radium-v radium-v force-pushed the users/jokreitl/site-bg-wave branch from e7d5aa5 to dd37532 Compare June 11, 2020 16:59
- Switch to ref directive to target canvas element
- Use built-in rAF timing
- Fix slow frametime rejection
@radium-v radium-v force-pushed the users/jokreitl/site-bg-wave branch from dd37532 to 347f134 Compare June 11, 2020 17:01
@radium-v radium-v merged commit 8191745 into feature/fast-frame Jun 11, 2020
@radium-v radium-v deleted the users/jokreitl/site-bg-wave branch June 11, 2020 17:41
chrisdholt pushed a commit that referenced this pull request Jun 11, 2020
* Add animated background

* fix footer logo collision

* fix section height and account for header and footer

* improve background animation

- Switch to ref directive to target canvas element
- Use built-in rAF timing
- Fix slow frametime rejection
chrisdholt pushed a commit that referenced this pull request Jun 16, 2020
* Add animated background

* fix footer logo collision

* fix section height and account for header and footer

* improve background animation

- Switch to ref directive to target canvas element
- Use built-in rAF timing
- Fix slow frametime rejection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants