mars3d-制作一个科技感满满的动态文本框

这里是css样式代码

/**************** 蓝色科技感文本面板 ****************/
.hot-spot {
  background-image: url("../../img/marker/circleBlue.png");
  position: absolute;
  background-repeat: no-repeat;
  user-select: none;
  z-index: 100000;
  width: 70px;
  height: 44px;
  background-size: cover;
  bottom: -80px;
  left: -30px;
}

  .hot-spot-board {
    background-image: url("../../img/marker/divBlue.png");
    top: -165px;
    transform: translateX(-30%);
    width: 180px;
    height: 52px;
    padding: 15px 0;
    background-position: 50%;
    background-size: contain;
    cursor: pointer;
    position: absolute;
    background-repeat: no-repeat;
  }

  .hot-spot:hover {
    background-image: url("../../img/marker/divYellow.png");
    position: absolute;
    background-repeat: no-repeat;
    user-select: none;
    z-index: 999;
    width: 70px;
    height: 44px;
    background-size: cover;
    bottom: -60px;
    left: calc(50% - 3px);
  }

  .hot-spot-line {
    position: absolute;
    top: -108px;
    left: 35px;
    width: 2px;
    height: 140px;
    background: linear-gradient(180deg, #38c9ff, transparent);
  }


  .hot-spot-line:before {
      height: 40%;
      left: 6px;
      animation: rise 3s linear 2s infinite;
      -webkit-animation: rise 3s linear 2s infinite;
      content: "";
      display: block;
      width: 1px;
      background: linear-gradient(180deg, #38c9ff, transparent);
      position: absolute;
      cursor: pointer;
    }

  .hot-spot-line:after {
      content: "";
      display: block;
      width: 1px;
      background: linear-gradient(180deg, #38c9ff, transparent);
      position: absolute;
      cursor: pointer;
      height: 60%;
      left: -5px;
      animation: rise 3s linear infinite;
      -webkit-animation: rise 3s linear infinite;
    }
    .hot-spot-board h5{
      width: 100%;
      text-align: center;
      line-height: 24px;
      color: #beedff;
      font-size: 16px;
      margin: 0;
    }

这里是关于他的动画的设置,我作为初学者第一次使用annimation这个属性,但是实现效果还是非常不错的。总之非常好看而且自己试试很有成就感的!

@keyframes rise {
  0% {
    opacity: 0.1;
    transform: translate(0, 100%);
  }
  5% {
    opacity: 0.3;
    transform: translate(0, 95%);
  }
  10% {
    opacity: 0.6;
    transform: translate(0, 90%);
  }
  15% {
    opacity: 1;
    transform: translate(0, 85%);
  }
  75% {
    opacity: 1;
    transform: translate(0, 25%);
  }
  80% {
    opacity: 0.7;
    transform: translate(0, 20%);
  }
  90% {
    opacity: 0.3;
    transform: translate(0, 10%);
  }
  95% {
    opacity: 0.2;
    transform: translate(0, 5%);
  }
  100% {
    opacity: 0.1;
    transform: translate(0, 0);
  }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值