minirefresh.css 5.37 KB
.minirefresh-wrap {
  position: absolute;
/*
     * 标明了top和bottom  滑动的就是minirefresh-wrap而不再是document.body
     */
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
/*
     * 去除wrap层的滚动条,确保只有scrol层有滚动条
     */
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
/**
     * 使用3d加速时,尽可能的使用index,防止浏览器默认给后续的元素创建复合层渲染
     * 因为CSS3中,如果这个元素添加了硬件加速,并且index层级比较低,
     * 在这个元素的后面其它元素(层级比这个元素高的,或者相同的,并且releative或absolute属性相同的),会默认变为复合层渲染
     * 如果处理不当会极大的影响性能,可以用chrome的rending查看
     */
  z-index: 1;
}
.minirefresh-scroll {
  position: relative;
/*
     * 默认背景色改成白色,直接避免下拉和正文重叠现象,可以覆盖
     */
  background: #fff;
}
.body-scroll-wrap {
  position: relative;
}
.minirefresh-hardware-speedup {
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  transform: translateZ(0);
}
.minirefresh-hidden {
  display: none !important;
}
.minirefresh-wrap::-webkit-scrollbar-track {
  background-color: transparent;
}
.minirefresh-wrap::-webkit-scrollbar {
  width: 6px;
}
.minirefresh-hide-scrollbar::-webkit-scrollbar {
  width: 0;
}
.minirefresh-wrap::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background-color: #ccc;
}
.minirefresh-wrap::-webkit-scrollbar-thumb:hover {
  background-color: #aaa;
}
.minirefresh-rotate {
  -webkit-animation: minirefresh-rotate 0.6s linear infinite;
  animation: minirefresh-rotate 0.6s linear infinite;
}
.minirefresh-fade-in {
  -webkit-animation: minirefresh-fade-in 0.5s linear forwards;
  animation: minirefresh-fade-in 0.5s linear forwards;
}
.minirefresh-fade-out {
  pointer-events: none;
  -webkit-animation: minirefresh-fade-out 0.5s linear forwards;
  animation: minirefresh-fade-out 0.5s linear forwards;
}
.minirefresh-totop {
  position: fixed;
  z-index: 9990;
  right: 10px;
  bottom: 30px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-image: url("images/minirefresh-totop.png");
  background-size: 100% 100%;
}
@-moz-keyframes minirefresh-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@-webkit-keyframes minirefresh-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@-o-keyframes minirefresh-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes minirefresh-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@-moz-keyframes minirefresh-fade-out {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@-webkit-keyframes minirefresh-fade-out {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@-o-keyframes minirefresh-fade-out {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes minirefresh-fade-out {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@-moz-keyframes minirefresh-rotate {
  0% {
    -webkit-transform: rotateZ(0deg);
    transform: rotateZ(0deg);
    -moz-transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotateZ(360deg);
    transform: rotateZ(360deg);
    -moz-transform: rotate(360deg);
  }
}
@-webkit-keyframes minirefresh-rotate {
  0% {
    -webkit-transform: rotateZ(0deg);
    transform: rotateZ(0deg);
    -moz-transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotateZ(360deg);
    transform: rotateZ(360deg);
    -moz-transform: rotate(360deg);
  }
}
@-o-keyframes minirefresh-rotate {
  0% {
    -webkit-transform: rotateZ(0deg);
    transform: rotateZ(0deg);
    -moz-transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotateZ(360deg);
    transform: rotateZ(360deg);
    -moz-transform: rotate(360deg);
  }
}
@keyframes minirefresh-rotate {
  0% {
    -webkit-transform: rotateZ(0deg);
    transform: rotateZ(0deg);
    -moz-transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotateZ(360deg);
    transform: rotateZ(360deg);
    -moz-transform: rotate(360deg);
  }
}
/*
 * 引入默认的主题
 */
.minirefresh-theme-default .minirefresh-downwrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 75px;
}
.minirefresh-theme-default .minirefresh-upwrap {
  min-height: 30px;
  padding: 15px 0;
  text-align: center;
}
.minirefresh-theme-default .downwrap-content {
/*position: absolute;*/
  width: 100%;
  padding: 10px 0;
  text-align: center;
}
.minirefresh-theme-default .minirefresh-downwrap .downwrap-progress,
.minirefresh-theme-default .minirefresh-upwrap .upwrap-progress {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #808080;
  margin-right: 8px;
  border-bottom-color: transparent;
  vertical-align: middle;
}
.minirefresh-theme-default .minirefresh-downwrap .downwrap-success,
.minirefresh-theme-default .minirefresh-downwrap .downwrap-error {
/*border-bottom-color: gray;*/
  display: none;
}
.minirefresh-theme-default .minirefresh-downwrap .downwrap-tips,
.minirefresh-theme-default .minirefresh-upwrap .upwrap-tips {
  display: inline-block;
  font-size: 12px;
  color: #808080;
  vertical-align: middle;
}
.minirefresh-theme-default .status-nomore .upwrap-tips {
/*
             * vertical-align: middle;会导致显示不全,display:block也不起作用
             * 因此设置一个padding
             */
  padding: 15px 0;
}