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

Skeleton-bg > change animation by using SVGToBase64 #20

Merged
merged 1 commit into from
May 5, 2023

Conversation

vuquangpham
Copy link
Contributor

@vuquangpham vuquangpham commented Apr 18, 2023

Problem

I have removed the animation of skeleton-bg (the way we did before) because it causes a conflict on pagespeed, more detail at #19.

Solution

  • Using animation in SVG and adding it to the background image by using SVG To Base64
  • SVG:
<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="0%">
      <stop offset="0%" style="stop-color:rgb(255,255,255);stop-opacity:0" />
      <stop offset="100%" style="stop-color:rgb(255,255,255);stop-opacity:0.8" />
    </linearGradient>
  </defs>
  <rect x="0" y="0" width="10" height="10" fill="#eee"></rect>
  <rect x="0" y="0" width="1" height="10" fill="url(#grad)">
    <animate
        attributeName="x"
        values="0;10"
        dur="1s"
        repeatCount="indefinite" />
  </rect>
</svg>

ezgif-4-a503dce400

@vuquangpham vuquangpham added the enhancement New feature or request label Apr 18, 2023
@vuquangpham vuquangpham requested a review from phucbm April 18, 2023 05:01
@vuquangpham vuquangpham self-assigned this Apr 18, 2023
@vuquangpham vuquangpham changed the base branch from main to 1.1.8 May 5, 2023 11:18
@vuquangpham vuquangpham merged commit dfba431 into 1.1.8 May 5, 2023
@phucbm phucbm deleted the skeleton-bg branch May 8, 2023 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSS issue: skeleton-shine unsupported background-position property on PageSpeed
1 participant