Skip to content

🖍 [Story icons] Replaced icons and styles#37122

Merged
mszylkowski merged 18 commits intoampproject:mainfrom
mszylkowski:replaceIcons
Dec 13, 2021
Merged

🖍 [Story icons] Replaced icons and styles#37122
mszylkowski merged 18 commits intoampproject:mainfrom
mszylkowski:replaceIcons

Conversation

@mszylkowski
Copy link
Copy Markdown
Contributor

@mszylkowski mszylkowski commented Dec 6, 2021

Contributes to #36951

First step in adopting the new UI:

  • Replaces the current icons with the new versions.
  • Updates progress bar and icons with updated margins.
  • Shows correctly ltr and rtl.
  • Updates pagination buttons with new icons.
  • Removes the audio notifications ("sound on/off", "page has no sound").
  • Reduces overall size of amp-story.js by -0.72KB
  • Removed the three dots pagination button that's not used anymore (fwd-more).

Supports landscape demo
Portrait demo
Portrait:
image
Player:
image
Supports landscape:
image

@mszylkowski mszylkowski self-assigned this Dec 6, 2021
@amp-owners-bot
Copy link
Copy Markdown

amp-owners-bot bot commented Dec 6, 2021

Hey @gmajoulet, @newmuis! These files were changed:

extensions/amp-story/1.0/amp-story-desktop-one-panel.css
extensions/amp-story/1.0/amp-story-system-layer.css
extensions/amp-story/1.0/amp-story-system-layer.js
extensions/amp-story/1.0/amp-story.css
extensions/amp-story/1.0/pagination-buttons.css

@gmajoulet
Copy link
Copy Markdown
Contributor

Can you file one (or two) tickets for the followups plz?


- Will remove localization strings in followup PR.
- Story has audio flag is not used anymore since we rely on current-page-has-audio for the audio icon, can be removed in followup PR

flex-direction: row !important;
justify-content: flex-end !important;
padding-top: 6px !important;
padding: 8px 4px !important;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Double checking that we want this updated margin on full-bleed mobile as well as desktop-one-panel.
Screen Shot 2021-12-06 at 2 51 09 PM

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The thoughts on mobile is that many platforms (in apps and through AmpStoryPlayer) will want to add border radiuses to the viewers, which is why we add the margins in mobile view as well (for example the Discover feed has small radiuses now because it would hide the progress bar otherwise). We thought about being able to toggle this through a viewer message or config, but it would be more inconsistent overall, especially if viewers don't configure things properly (most of the times people don't read every sentence in the docs).

So yes, it's intended to have the added margins in mobile as well, so viewers can use larger border radiuses (which looks more modern).

.i-amphtml-story-system-layer-buttons button[disabled] {
opacity: 0.3 !important;
cursor: initial !important;
.i-amphtml-story-system-layer-buttons button[disabled][disabled] {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think i've seen [disabled][disabled] before.
Out of curiosity, how is this different than [disabled]?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's just a compact way of increasing the specificity of the selector, it doesn't technically change anything else.

@@ -321,70 +269,42 @@
display: block !important;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We might be able to remove this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this helps for keyboard users (part of the a11y efforts), that it shows the pause button for them to tab through and select, right?

}

.i-amphtml-story-player-panel-prev, .i-amphtml-story-player-panel-next {
background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" fill="none"><path stroke="#fff" stroke-linecap="round" stroke-width="1.9" d="M17 29.2V18.8c0-1.2 1.4-2 2.5-1.3l7.5 5.2c1 .6 1 2 0 2.6l-7.5 5.2c-1 .7-2.5 0-2.5-1.3Z"/><rect width="1.8" height="15.6" x="30.2" y="16.2" fill="#fff" rx=".9"/></svg>') !important;
Copy link
Copy Markdown
Contributor Author

@mszylkowski mszylkowski Dec 8, 2021

Choose a reason for hiding this comment

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

This is the SVG that I effectively changed in this file, the rest of the changes are that I used translateY(-50%) rotate(180deg) instead of adding a new SVG for the left arrow.

All the other lines changed were just a formatting issue with the original file where there was extra indentation in most of the file :( I ran the autoformatter to fix it so it will show many lines were changed (you can hide most of the autoformatter changes with hide whitespaces in the settings menu here)

Copy link
Copy Markdown
Contributor

@gmajoulet gmajoulet left a comment

Choose a reason for hiding this comment

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

This PR does way too much at once, it is very hard to review. Each bullet point in your description should have been a separate PR. I wouldn't be surprised if I missed one or more bugs in my review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants