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

Try adding a CSS-only announcement bar marquee option #1777

Closed
wants to merge 14 commits into from

Conversation

kjellr
Copy link
Contributor

@kjellr kjellr commented Jun 10, 2022

PR Summary:

Adds a "Scrolling marquee" option to the announcement bar.

10-32-uwyun-2p4vy.mp4

Why are these changes introduced?

Just a proof of concept.

What approach did you take?

The PR uses a simple CSS animation to create an endlessly scrolling marquee. It borrows this idea for using text shadows to repeat the text. This generally works for text, but breaks if you use emoji. 😞

Aside from the emoji issue, I don't think this is actually a viable option for a couple reasons though:

  1. It relies on a hardcoded width for the text. This breaks on smaller screens.
  2. The speed of the animation generally to be adjusted depending on the amount of text present as well.

Both of these could theoretically be handled by JS, but I think we'd want to explore that outside of this PR anyway. Keeping this as a draft for now, but it should probably be closed once we've taken a look at it.

Other considerations

The PR automatically turns the scrolling off if the user's device has Prefers reduced motion set.

Testing steps/scenarios

  • Visit the link here.
  • Try toggling on and off the marquee setting.
  • Try changing the text. (Add lots of text, notice that it breaks)
  • Check it out at other screen sizes (Notice that it breaks)

@kjellr kjellr added the Category: Enhancement New feature or request label Jun 10, 2022
@kjellr kjellr self-assigned this Jun 10, 2022
@ghost ghost added the cla-needed label Jun 10, 2022
@melissaperreault
Copy link
Contributor

melissaperreault commented Jun 10, 2022

Hey @svinkle , this is only a proof of concept PR but would like to learn if turning off automatically the scrolling if user's device has Prefers reduced motion set is enough in this feature ability?

I suspect we would need to offer control to play/pause the animation additionally?

@Oliviammarcello
Copy link
Contributor

Oliviammarcello commented Jun 13, 2022

+1 to Melissa's comment. I think we will need to add a play/pause button. When working on header improvements, I designed one here if that is helpful.

Also, not sure if a setting to control the speed could be helpful. We have a speed setting on the slideshow. Screenshot

@kjellr
Copy link
Contributor Author

kjellr commented Jun 14, 2022

The more I sit on this one, the less sure I am that it should be in Dawn in the first place. Marquees are super-trendy right now, but they're not a great pattern from a usability perspective (hence all the questions above about accessibility and pause buttons). Because of that, I'm weary of unleashing it on all of our themes at once.

I'm also not sure it makes sense to include it from a theme framework perspective: marquees will fade in trendiness at some point, and we'll still have this built-in to Dawn. I'm not convinced it's a feature that's core to commerce. Instead, it might make sense to make this a quick app, or even just a feature in one or two specific themes that are designed to be more trendy/ephemeral.

@svinkle
Copy link
Member

svinkle commented Jun 16, 2022

text-shadow is not supported in Windows High Contrast themes resulting in only the first instance being visible.

Implementing a non-rotating fallback via prefers-reduced-motion media query is one approach, but this assumes the user knows about this setting. This could be considered a "power user" setting.

As with any wide-sweeping motion, an explicit method to pause is recommended.

@andrewetchen
Copy link
Contributor

andrewetchen commented Aug 19, 2022

Hey @kjellr,

The probot-CLA was recently deprecated. This pull request will now need to refer to new shopify-cla CLA check.

One way to achieve this is by closing and reopening this pull request.

I apologize for the noise. Feel free to message me if you have any questions 😄


Update

Looks like the shopify[bot] might be preventing the CLA check to pass:

image

@translation-platform
Copy link
Contributor

We have received a translation request but there is a question blocking translation work. Your help is needed.

Please answer the following questions.

Warning
Replies in GitHub are not visible to translators. Use the provided "Answer here" links. 🙅‍♀️


Note
Not your issue? Forward it to someone with more context; please don't leave it pending. 🙏
Questions? Hop in the #help-i18n-and-translation Slack channel.

@kjellr
Copy link
Contributor Author

kjellr commented Aug 29, 2022

I'm just going to go ahead and close this one — it was just a proof of concept, and I think the method used here isn't viable anyway due to issues with long text strings and different viewports.

@kjellr kjellr closed this Aug 29, 2022
@kjellr kjellr deleted the try/announcement-bar-marquee branch August 29, 2022 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants