加载占位图 Skeleton Screen Loading
<view class="item">
 <view class="skeleton-image animated-background"></view>
 <view class="skeleton-right">
  <view class="title animated-background"></view>
  <view class="description animated-background"></view>
 </view>
</view>


.item{
  width: 700rpx;
  height: 100rpx;
  margin: 10rpx auto;
  display: flex;
  justify-content: space-between;
  .skeleton-image{
    width: 100rpx;
    height: 100rpx;
  }
  .skeleton-right{
    width: 580rpx;
    height: 100rpx;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    .title{
      width: 100%;
      height: 30rpx;
    }
    .description{
      width: 100%;
      height: 50rpx;
    }
  }
}

@keyframes placeHolderShimmer {
  0% {background-position: -468px 0}
  100% {background-position: 468px 0}
}

.animated-background {
  animation-duration: 1s;
  animation-fill-mode: forwards;
  animation-iteration-count: infinite;
  animation-name: placeHolderShimmer;
  animation-timing-function: linear;
  background: #f6f7f8;
  background: linear-gradient(to right, #eeeeee 8%, #dddddd 18%, #eeeeee 33%);
  background-size: 800px 104px;
  height: 40px;
  position: relative;
}


修改时间 2022-05-19

声明:本站所有文章和图片,如无特殊说明,均为原创发布。商业转载请联系作者获得授权,非商业转载请注明出处。
随机推荐
WordPress 添加自定义接口
Node.js process 模块
JavaScript 的历史
Express 使用 body-parser 处理 HTTP 请求
用 JavaScript 实现数字增加滚动动画
JavaScript 类操作 classList
Linux 网络流量监控 iftop
curl 的用法指南