盲文打字背景效果

代码语言:html

所属分类:动画

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

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
body {
  background: rgb(100, 85, 135);
  margin: 0 auto;
  overflow: hidden;
  font-family: 'Special Elite', cursive;
}
p{
  font-size:0.5em;
}
#wordsAndStuff {
  font-size: calc(3vw + 10px);
  position: absolute;
  left: 50%;
  top:50%;
  transform: translate(-50%,-50%);
  text-align: center;
  z-index: 50;
  border-radius: 5px;
  padding:2px;
  margin:2px;
  color:white;
  min-width:20px;
}
#wordsAndStuff:focus{
  outline:0;
  border:1px solid white;
  animation:blink 2s linear infinite;
}
#container {
  height: 100vh;
  width: 100vw;
  cursor: default;
}
#brailleBG{
  height: 100%;
  width: 100%;
  word-wrap: break-word;
  z-index:1;
  font-size:4em;
  color: rgb(120, 105, 155);
  text-shadow: 1px 2px 4px rgb(80, 65, 115), -1px -2px 4px rgb(140, 125, 175)
}
@keyframes blink{
  0%{
    border:1px solid white;
  }
  50%{
    border:1px solid rgba(255,255,255,0);
  }
  100%{
    border:1px solid white;
  }
}
</style>

</head>
<body translate="no">
<div id="container">
<div id="brailleBG"></div>
<div id="wordsAndStuff">The spectacle before us was indeed sublime.<br /><br /><p>Words typed here make the braille version texture the background</p></div>
</div>

<script>
 /*
   * Array that maps English letters
   * to Braille symbols. 
   * http://symbolcodes.tlt.psu.edu/bylanguage/braillechart.html
  */
/*
  var map ={
    'a' : '&#10241;',
    'b' : '&#10243;',
    'c' : '&#10249;',
    'd' : '&#10265;',
    'e' : '&#10257;',
    'f' : '&#10251;',
    'g' : '&#10267;',
    'h' : '&#10259;',
    'i' : '&#10250;',
    'j' : '&#10266;',
    'k' : '&#10245;',
    'l' : '&#10247;',
    'm' : '&#10281;',
    'n' : '&#10269;',
    'o' : '&#10261;.........完整代码请登录后点击上方下载按钮下载查看

网友评论0