LoginSignup
0
0

More than 1 year has passed since last update.

[CSS] clip-pathとsvgで作る表っぽい読み込み中プレースホルダ

Last updated at Posted at 2021-11-30

これはなに?

表の読み込み中を示すアニメーションをCSS(とSVG)で作りました。

デモ

作ったもの

HTMLとしてはこれだけです。背景をグラデーションにして、アニメさせています。

<div class="loading-placeholder"></div>

CSSのclip-pathで、表のセルっぽく背景色が見えるようにしています。

clip-path: url(#loading-placeholder-mask);

作りたい表の分だけ、SVGが大きくなります。まあこれは仕方ない。

<svg width="0" height="0">
  <defs>
    <clipPath id="loading-placeholder-mask">
     (snip)
    </clipPath>
  </defs>
</svg>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0