Created
November 1, 2021 17:53
-
-
Save rosnovsky/d208e3ec674e2ac226347c4f0bef6535 to your computer and use it in GitHub Desktop.
shimmer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const shimmer = (w: number, h: number): string => ` | |
<svg width="${w}" height="${h}" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | |
<defs> | |
<linearGradient id="g"> | |
<stop stop-color="#EFEFEF" offset="20%" /> | |
<stop stop-color="#DFDFDF" offset="50%" /> | |
<stop stop-color="#EFEFEF" offset="70%" /> | |
</linearGradient> | |
</defs> | |
<rect width="${w}" height="${h}" fill="#EFEFEF" /> | |
<rect id="r" width="${w}" height="${h}" fill="url(#g)" /> | |
<animate xlink:href="#r" attributeName="x" from="-${w}" to="${w}" dur="2s" repeatCount="indefinite" /> | |
</svg>` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment