js实现led显示屏文字走动动画效果

代码语言:html

所属分类:动画

代码描述:js实现led显示屏文字走动动画效果,可以自己提交英文文字提交后显示

代码标签: 显示屏 文字 走动 动画 效果

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


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

<head>

  <meta charset="UTF-8">

  
  
  
  
<style>
* {
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  font-family: "Roboto", sans-serif;
  box-sizing: border-box;
}

.container .screen {
  width: 400px;
  height: 280px;
  background: linear-gradient(to bottom right, #004040, #00c8c8);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border: 20px #004040 solid;
  position: relative;
}

.container .screen .digit {
  margin: 2px;
}

.container .screen .digit {
  background-color: rgba(0, 0, 0, 0.2);
}

.container .screen .digit.on {
  background-color: rgba(255, 255, 255, 0.8);
}

.container .screen .glass {
  position: absolute;
  width: calc(30px * 12);
  height: calc(30px * 8);
  top: 0px;
  left: 0px;
  background: linear-gradient(rgba(255, 255, 255, 0.5) 5%, transparent 45%);
  clip-path: polygon(0px 0px, 0px 90px, 360px 30px, 360px 0px);
}

.container .input-box {
  display: flex;
  width: 400px;
  padding: 5px 0;
}

.container .input-box #sentence {
  flex-grow: 1;
  border-radius: 2px;
  border: 2px #404040 solid;
  margin-right: 5px;
  font-size: 1.2rem;
}

.container .input-box #sentence:focus {
  border: 2px #004040 solid;
}

.container .input-box #submit-btn {
  background-color: #004040;
  color: #ffffff;
  padding: 5px;
  font-size: 1rem;
  border-radius: 2px;
}

.container .input-box #submit-btn:hover {
  background-color: #008080;
  cursor: pointer;
}

body {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom right, #008080, #00c8c8);
}
</style>



</head>

<body translate="no" >
  <div class="container">
      <div class="input-box">
        <input type="text" id="sentence" />
        <button id="submit-btn">Submit</button>
      </div>
      <div class="screen">
        <div class="digit" data-row="1" data-column="1"></div>
        <div class="digit" data-row="1" data-column="2"></div>
        <div class="digit" data-row="1" data-column="3"></div>
        <div class="digit" data-row="1" data-column="4"></div>
        <div class="digit" data-row="1" data-column="5"></div>
        <div class="digit" data-row="1" data-column="6"></div>
        <div class="digit" data-row="1" data-column="7"></div>
        <div class="digit" data-row="1" data-column="8"></div>
        <div class="digit" data-row="1" data-column="9"></div>
        <div class="digit" data-row="1" data-column="10"></div>
        <div class="digit" data-row="1" data-column="11"></div>
        <div class="digit" data-row="1" data-column="12"></div>
        <div class="digit" data-row="2" data-column="1"></div>
        <div class="digit" data-row="2" data-column="2"></div>
        <div class="digit" data-row="2" data-column="3"></div>
        <div class="digit" data-row="2" data-column="4"></div>
        <div class="digit" data-row="2" data-column="5"></div>
        <div class="digit" data-row="2" data-column="6"></div>
        <div class="digit" data-row="2" data-column="7"></div>
        <div class="digit" data-row="2" data-column="8"></div>
        <div class="digit" data-row="2" data-column="9"></div>
        <div class="digit" data-row="2" data-column="10"></div>
        <div class="digit" data-row="2" data-column="11"></div>
        <div class="digit" data-row="2" data-column="12"></div>
        <div class="digit" data-row="3" data-column="1"></div>
        <div class="digit" data-row="3" data-column="2"></div>
        <div class="digit" data-row="3" data-column="3"></div>
        <div class="digit" data-row="3" data-column="4"></div>
        <div class="digit" data-row="3" data-column="5"></div>
        <div class="digit" data-row="3" data-column="6"></div>
        <div class="digit" data-row="3" data-column="7"></div>
        <div class="digit" data-row="3" data-column="8"></div>
        <div class="digit" data-row="3" data-column="9"></div>
        <div class="digit" data-row="3" data-column="10"></div>
        <div class="digit" data-row="3" data-column="11"></div>
        <div class="digit" data-row="3" data-column="12"></div>
        <div class="digit" data-row="4" data-column="1"></div>
        <div class="digit" data-row="4" data-column="2"></div>
        <div class="digit" data-row="4" data-column="3"></div>
        <div class="digit" data-row="4" data-column="4"></div>
        <div class="digit" data-row="4" data-column="5"></div>
        <div class="digit" data-row="4" data-column="6"></div>
        <div class="digit" data-row="4" data-column="7"></div>
        <div class="digit" data-row="4" data-column="8"></div>
        <div class="digit" data-row="4" data-column="9"></div>
        <div class="digit" data-row="4" data-column="10"></div>
        <div class="digit" data-row="4" data-column="11"></div>
        <div class="digit" data-row="4" data-column="12"></div>
        <div class="digit" data-row="5" data-column="1"></div>
        <div class="digit" data-row="5" data-column="2"></div>
        <div class="digit" data-row="5" data-column="3"></div>
        <div class="digit" data-row="5" data-column="4"></div>
        <div class="digit" data-row="5" data-column="5"></div>
        <div class="digit" data-row="5" data-column="6"></div>
        <div class="digit" data-row="5" data-column="7"></div>
        <div class="digit" data-row="5" data-column="8"></div>
        <div class="digit" data-row="5" data-column="9"></div>
        <div class="digit" data-row="5" data-column="10"></div>
        <div class="digit" data-row="5" data-column="11"></div>
        <div class="digit" data-row="5" data-column="12"></div>
        <div class="digit" data-row="6" data-column="1"></div>
        <div class="digit" data-row="6" data-column="2"></div>
        <div class="digit" data-row="6" data-column="3"></div>
        <div class="digit" data-row="6" data-column="4"></div>
        <div class="digit" data-row="6" data-column="5".........完整代码请登录后点击上方下载按钮下载查看

网友评论0