js+css实现网格点击波浪涟漪变色动画效果代码

代码语言:html

所属分类:动画

代码描述:js+css实现网格点击波浪涟漪变色动画效果代码

代码标签: js css 网格 点击 波浪 涟漪 变色 动画

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

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

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

  
  
  
<style>
body {
  background: #000;
}
/* Grid container styles */
#grid-container {
  display: grid;
  grid-template-columns: repeat(5, 50px);
  grid-template-rows: repeat(5, 50px);
  justify-content: center;
  margin-top: 50px;
}

.cell {
  width: 50px;
  height: 50px;
  background-color: #fff;
  border: 1px solid #000;
  box-sizing: border-box;
}

.filled {
  background-color: #000;
}

.cell.pulse:not(.filled) {
  animation: pulse-animation 0.3s forwards;
}

@keyframes pulse-animation {
  0% {
    background-color: #fff;
    transform: scale(1);
  }
  50% {
    background-color: #76cefa;
    transform: scale(1.1);
  }
  100% {
    background-color: #fff;
    transform: scale(1);
  }
}
</style>

  
</head>

<body translate="no">
  <div id="grid-container">

  <div class="cell filled" data-row="0" data-col="0"></div>
  <div class="cell" data-row="0" data-col="1"></div>
  <div class="cell" data-row="0" data-col="2"></div>
  <div class="cell" data-row="0" data-col="3"></div>
  <div class="cell filled" data-row="0" data-col="4"></div>
  <div class="cell" data-row="1" data-col="0"></div>
  <div class="cell" data-row="1" data-col="1"></div>
  <div class="cell" data-row="1" data-col="2"></div>
  <div class="cell" data-row="1" data-col="3"></div>
  <div class="cell" data-row="1" data-col="4"></div>
  <div class="cell" data-row="2" data-col="0"></div>
  <div class="cell" data-row="2" data-col="1"></div>
  <div class="cell" data-row="2" data-col=&.........完整代码请登录后点击上方下载按钮下载查看

网友评论0