Skip to content

其它小样式实现

圆点

Details
vue
<template>
  <div class="radius">
    <div class="shape"></div>
    <div class="range">
      <div class="shadow ani"></div>
    </div>
  </div>
</template>

<style scoped>
@keyframes scale {
  0% {
    opacity: 1;
    transform: scale(0);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}
.radius {
  width: 15px;
  height: 15px;
  position: relative;
  margin: 100px;
}
.shape {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: -1;
  border-radius: 50%;
  box-shadow: 0 5px 5px var(--shadow-color), 0 -5px 5px var(--shadow-color),
    10px 0px 10px var(--shadow-color), -10px 0 10px var(--shadow-color);
  background-color: #f3c800;
}

.range {
  width: 500%;
  height: 500%;
  box-sizing: border-box;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.range .shadow {
  width: 100%;
  height: 100%;
  opacity: 0;
  border-radius: 50%;
  background-color: rgba(243, 200, 0, 0.5);
}
.range .shadow.ani {
  animation: scale 4s 0s ease infinite;
}
</style>

过渡下划线

Migrating From MySQL to YugabyteDB Using YugabyteDB Voyager
Details
vue
<template>
  <span> Migrating From MySQL to YugabyteDB Using YugabyteDB Voyager</span>
</template>

<style scoped>
span {
  line-height: 1.5em;
  background: linear-gradient(to right, #ec695c, #61c454) no-repeat right bottom;
  background-size: 0 2px;
  transition: background-size 1300ms;
}
span:hover {
  background-position-x: left;
  background-size: 100% 2px;
}
</style>

loading

Details
vue
<template>
  <div class="loading-radius-pass">
    <div class="fragments">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </div>
  </div>
</template>
<style lang="less" scoped>
.loading-radius-pass {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.fragments {
  position: relative;
  width: 100%;
  height: 40px;
  padding: 0 20px;
  box-sizing: border-box;
  > div {
    width: 12px;
    height: 12px;
    margin: 0 5px;
    &::after {
      content: '';
      display: block;
      width: 100%;
      height: 100%;
      border-radius: 50%;
      background-color: rgb(67, 174, 255);
    }
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    @keyframes move {
      0% {
        opacity: 0;
        transform: translateX(-(12px + 5px) * 3);
      }
      14.28% {
        opacity: 0;
        transform: translateX((12px + 5px) * 3);
      }
      57.12% {
        opacity: 1;
        transform: translateX(0);
      }
      100% {
        opacity: 0;
        transform: translateX(-(12px + 5px) * 3);
      }
    }
    @keyframes scale {
      0% {
        transform: scale(0);
      }
      14.28% {
        transform: scale(0);
      }
      57.12% {
        transform: scale(1);
      }
      100% {
        transform: scale(0);
      }
    }
    &:first-child {
      animation: move 6000ms -5000ms linear infinite;
      &::after {
        animation: scale 6000ms -5000ms linear infinite;
      }
    }
    &:nth-child(2) {
      animation: move 6000ms -4000ms linear infinite;
      &::after {
        animation: scale 6000ms -4000ms linear infinite;
      }
    }
    &:nth-child(3) {
      animation: move 6000ms -3000ms linear infinite;
      &::after {
        animation: scale 6000ms -3000ms linear infinite;
      }
    }
    &:nth-child(4) {
      animation: move 6000ms -2000ms linear infinite;
      &::after {
        animation: scale 6000ms -2000ms linear infinite;
      }
    }
    &:nth-child(5) {
      animation: move 6000ms -1000ms linear infinite;
      &::after {
        animation: scale 6000ms -1000ms linear infinite;
      }
    }
    &:nth-child(6) {
      animation: move 6000ms 0ms linear infinite;
      &::after {
        animation: scale 6000ms 0ms linear infinite;
      }
    }
  }
}
</style>