js+css实现数字提醒新消息铃铛动画效果代码

代码语言:html

所属分类:其他

代码描述:js+css实现数字提醒新消息铃铛动画效果代码,点击可清除。

代码标签: js css 数字 提醒 新消息 铃铛 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">

  
<style>
*{
  padding: 0;
  margin: 0;
}

body{
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}


.notification-count{
  display: none;
  justify-content: center;
  align-items: center;
  position: absolute;
  transform: translate(25px, -60px);
  height: 30px;
  width: 30px;
  border-radius: 20px;
  background-color: rgb(250, 0, 0); 
  text-align: center;
  font-weight: bold;
  color: white;
  text-shadow: -2px 0 black, 0 1.2px black, 2px 0 black, 0 -2px black;
}

.bell-con{
  fill: gray;
  cursor:pointer;
}

.line{
  display: block;
  position: absolute;
  height: 0px;
  width: 10px;
  border: 3px solid red;
}

.line1{
  transform: translateY(-25px) rotate(90deg);
}

.line2{
  transform: translate(20px, -20px) rotate(-45deg);
}

.line3{
  transform: translateX(25px);
}

.svgStyle{
  fill: rgb(255,255,0);
}

#alert1{
  display: none;
  position: absolute;
  transform: translate(-60px, -3px) rotate(-10deg);
}

#alert2{
  display: none;
  position: absolute;
  transform: translate(-12px, -2px) rotateY(180deg) rotate(-11deg);
}


@keyframes alert {
  0%{
    opacity: 0;
  }
  50%{
    opacity: 1;
  }
  100%{
    opacity: 0;
  }
}

@keyframes show {
  from{
    opacity: 0;
  }
  to{
    opacity: 1;
  }
}
</style>


</head>

<body translate="no">
  <div class="notification-bell" onclick="notification()">

  <svg id="bell-con" class="bell-con" viewBox="0 0 448 512" width="50" title="bell" stroke="black" stroke-width="10">
    <path d="M224 512c35.32 0 63.97-28.65 63.97-64H160.03c0 35.35 28.65 64 63.97 64zm215.39-149.71c-19.32-20.76-55.47-51.99-55.47-154.29 0-77.7-54.48-139.9-127.94-155.16V32c0-17.67-14.32-32-31.98-32s-31.98 14.33-31.98 32v20.84C118.56 68.1 64.08 130.3 64.08 208c0 102.3-36.15 133.53-55.47 154.29-6 6.45-8.6.........完整代码请登录后点击上方下载按钮下载查看

网友评论0