【问题标题】:CSS loader/Progress spinner Material angular 2+CSS loader/Progress spinner Material angular 2+
【发布时间】:2018-06-08 13:54:47
【问题描述】:

我正在尝试从 Angular 材料中模仿 loader/Progress spinner。到目前为止,我制作了以下组件。但我不知道为什么破折号的长度没有改变。

body {
  background-color: white;
}

// demo-specific
.showbox {
position: absolute;
   
}
// end demo-specific

.loader {
  position: relative;
  margin: 0 auto;
  width: 100px;
  &:before {
    content: '';
    display: block;
    padding-top: 100%;
  }
}

.circular {
  animation: rotate 2s linear infinite;
  height: 100%;
  transform-origin: center center;
  width: 100%;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
}

.path {
  stroke-dasharray: 1, 200;
  stroke-dashoffset: 0;
  animation: dash 2s ease-in-out infinite;
  stroke-linecap: round;
  stroke: #0057e7;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 20, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 100, 200;
    stroke-dashoffset: -35px;
  }
  100% {
    stroke-dasharray: 200, 200;
    stroke-dashoffset: -125px;
  }
}
    <div class="showbox">
          <div class="loader">
            <svg class="circular" viewBox="25 25 50 50">
                <circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10"/>
              </svg>
          </div>
        </div>

【问题讨论】:

    标签: html css material-design angular-material2


    【解决方案1】:

    在我看来,问题是直接从 0% 到 50%,他们从 0% 到 10% 等过渡的示例在哪里等等等等。只需在 0 到 50% 之间包含更多步骤。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-26
      • 1970-01-01
      • 2023-02-21
      • 1970-01-01
      相关资源
      最近更新 更多