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
Create Skeleton components #392
Conversation
Here's some css to get you started with a 'shimmer' effect. you'd have to change the colors to ours of course but it could be a good starting point. .shimmering {
animation : shimmer 2s infinite linear;
background: linear-gradient(to right, #eff1f3 4%, #e2e2e2 25%, #eff1f3 36%);
background-size: 1000px 100%;
}
@keyframes shimmer {
0% {
background-position: -1000px 0;
}
100% {
background-position: 1000px 0;
}
} These look great! I think it might be helpful if there was like a
@WordPress/openverse-frontend might have other ideas for what things could be props on that component. Great work! |
LGTM aside from the screen reader issue I pointed out.
<div | ||
class="flex-shrink-0 h-20 w-20 mr-4 bg-dark-charcoal-10 rounded shimmering" | ||
> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the space necessary to accomplish this? I tested this in VoiceOver with Safari and while the element is not tabbable of course, if you use arrow key navigation (which is common for reading through paragraphs) VoiceOver will read "space" for each of the skeleton elements becasue of this single space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reminding me about this, @sarayourfriend. I used the non-breaking space entity to avoid lint errors about empty elements, but later I changed to auto closed div
s for fewer characters, but non-void void HTML elements –as divs– technically are not valid in HTML5 (tested with W3C HTML validator), only allowed in XHTML syntax so I was wondering if this could be a bad practice
I deleted the entities but an alternative could be to disable that rule in these files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if you render a "void" looking div
element in Vue, it knows that div's can't be void, so it will automatically render an opening and closing tag for it. You can see this in this codesandbox: https://codesandbox.io/s/keen-fermi-jv1y7?file=/src/App.vue
Inspect the elements or look at the console output to see how the <div class="testing" />
gets expanded out to <div class="testing"></div>
during rendering.
So we should be able to avoid the linter complaining about empty elements by just rendering a "void" style div tag and letting Vue expand it out for us (unless the linter still complains about that, in which case we can just disable it for that line I guess).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also wondered if this is something Vue does under the hood or just the browser autocompleting tags, as this example fails the W3C validator test, but opening in a browser shows the closing tag.
<!DOCTYPE xhtml>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="myvoiddiv" />
</body>
</html>
Anyway, it's just a curiosity that I had. As you said this way works so I'll merge it. Thank you!
@zackkrida Thank you for your suggestion, that animation looks great! At least in my view CleanShot.2021-11-08.at.18.02.20.mp4 |
It looks great. I think it is crucial to see it live, with real results. I was also considering a pulsing effect instead. Here is a post about it and worth going back to this once we have the public version. Great work |
Oooh, the pulse is nice too @panchovm |
* main: Replace PDM logo (#411) Add playwright e2e tests (#394) Update breakpoints to the new Tailwind config (#408) Create a global audio player (amongst many smaller improvements) (#399) Create Skeleton components (#392) Tailwind breakpoints (#403) Avoid error using only local translation files (#367) Add base Button component (#372) Use Tailwind RTL styles everywhere (#355) Add a dependencies section and remove the redundant title (#379)🔄 Synced file(s) with WordPress/openverse (#384) Fix filters not being set on SSR (#386)
krysal commentedOct 29, 2021
•
edited
Loading
Fixes
Fixes #376 by @krysal
Description
This PR creates the skeleton components for the search results view/tab, as modeled in Figma mockups. It adds a grid of squares for mixed results, a grid of rectangles of variable height for images results, and finally, a list of audio track skeletons for the audio results tab. There is also randomness in the length of smaller lines of the audio track skeleton, similar to the data expected.
It would be nice to add a subtle shimmer effect to these elements but I have to figure out how to do it.
Testing Instructions
Run storybook and compare the appearance of mentioned components with the mockups in Figma (links in the linked issue).
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin
The text was updated successfully, but these errors were encountered: