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

Polish and optimize desktop background #12629

Merged
merged 7 commits into from Jan 4, 2018

Conversation

alanorozco
Copy link
Member

  1. Ignores images hidden by media query when finding background source. In some cases, hidden images would be loaded by the background, causing a delay between correct image load and background image load.

  2. Fixes blur bleed.

  3. Sets background color to be the same as the amp-story-page element in case no image is present or when it fails to load.

  4. Waits for image to load before swap. On timeout, it will show the background color.

  5. Previous changes allow for crossfade transition to be re-enabled, with some changes in behavior.

Copy link
Member

@prateekbh prateekbh left a comment

Choose a reason for hiding this comment

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

just a few questions.
LGTM overall

background-size: cover !important;
background-color: transparent !important;
background-position: center center !important;
will-change: opacity, z-index !important;
Copy link
Member

Choose a reason for hiding this comment

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

are we trying to animate opacity?
last time we did this, opacity animation + page movement tend to get a little janky. please check

Copy link
Member Author

Choose a reason for hiding this comment

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

Confirmed as working, issues were caused by lack of transition sync/two transitions at the same time.

right: 0 !important;
bottom: 0 !important;
left: 0 !important;
top: -150px !important;
Copy link
Member

Choose a reason for hiding this comment

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

because?

Copy link
Member Author

Choose a reason for hiding this comment

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

Blur bleed :)

@alanorozco alanorozco merged commit 323b147 into ampproject:master Jan 4, 2018
@alanorozco alanorozco deleted the background branch January 4, 2018 15:15
gzgogo pushed a commit to gzgogo/amphtml that referenced this pull request Jan 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Stories - By Type
  
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

3 participants