输入文本自动朗读特效

代码语言:html

所属分类:多媒体

代码描述:输入文本自动朗读特效

代码标签: 朗读 特效

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


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

<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Lilita+One&amp;display=swap'>
<style>
body {
  padding: 0;
  margin: 0;
  font-family: "Lilita One", sans-serif;
}

.word {
  position: relative;
  background: #e5f7ff;
  display: -webkit-box;
  display: flex;
  -webkit-box-pack: center;
          justify-content: center;
  -webkit-box-align: center;
          align-items: center;
  height: 100vh;
  width: 100vw;
  font-size: 20vw;
  text-transform: uppercase;
  overflow: hidden;
  text-align: center;
  line-height: 1;
}

input {
font-size: 1rem;
  width:1rem;
}

.word:after {
  content: " ";
  background: rgb(255, 255, 255);
  display: inline-block;
  width: 0.1em;
  height: .75em;
  -webkit-animation: flash 0.5s alternate infinite;
          animation: flash 0.5s alternate infinite;
  margin: 0 0.1em;
  position: relative;
}

.letter {
  position: relative;
  display: inline-block;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-stroke: .05em white;
  -webkit-text-fill-color: transparent;
  -webkit-filter: drop-shadow(0.4vh 0.4vh 0.4vh rgba(0, 0, 0, 0.3));
          filter: drop-shadow(0.4vh 0.4vh 0.4vh rgba(0, 0, 0, 0.3));
  -webkit-animation-duration: 0.2s;
          animation-duration: 0.2s;
  -webkit-animation-name: slidein;
          animation-name: slidein;
  background-size: 75px 75px;
  background-repeat: repeat;
  min-width: 0.2em;
  z-index: 1;
}

@-webkit-keyframes slidein {
  from {
    -webkit-transform: scale(2.5) rotate(10deg);
            transform: scale(2.5) rotate(10deg);
  }

  to {
    -webkit-transform: scale(1) rotate(0deg);
            transform: scale(1) rotate(0deg);
  }
}

@keyframes slidein {
  from {
    -webkit-transform: scale(2.5) rotate(10deg);
            transform: scale(2.5) rotate(10deg);
  }

  to {
    -webkit-transform: scale(1) rotate(0deg);
            transform: scale(1) rotate(0deg);
  }
}

@-webkit-keyframes flash {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes flash {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Hiding this as my daughter doesn't need to change voices */
.voices {
  position: absolute;
  top: 1em;
  left: 1em;
  opacity: 0;
}

.instructions {
  position: fixed;
  bottom: 0.5em;
  text-align: center;
  width: 100%;
  color: #1394ce;
}
</style>

</head>
<body translate="no">
<div class="word">
<span class="letter" style="background-image:url(&quot;data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20256%20256%22%3E%0A%20%20%3Cdefs%2F%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23FFF369%22%20d%3D%22M0%200h256v256H0z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23E6D617%22%20d%3D%22M38.5%2023L49%2044H28zM100.5%2044L111%2065H90zM143%2018l10%2021h-20zM223.5%2034L234%2055h-21zM128.5%2089l10.5%2020h-21zM49%2088l10%2021H39zM100.5%20149l10.5%2021H90zM180.5%2088l10.5%2021h-21zM32.5%20210L43%20231H22zM223.5%20128l10.5%2021h-21zM110.5%20200l10.5%2020h-21zM174.5%20182l10.5%2021h-21zM223.5%20203l10.5%2021h-21zM42%20141l10%2021H32z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E&quot;)">h</span><span class="letter" style="background-image:url(&quot;data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20256%20256%22%3E%0A%20%20%3Cdefs%2F%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23FF9B0F%22%20d%3D%22M0%200h256v256H0z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23DE8201%22%20d%3D%22M38.5%2023L49%2044H28zM100.5%2044L111%2065H90zM143%2018l10%2021h-20zM223.5%2034L234%2055h-21zM128.5%2089l10.5%2020h-21zM49%2088l10%2021H39zM100.5%20149l10.5%2021H90zM180.5%2088l10.5%2021h-21zM32.5%20210L43%20231H22zM223.5%20128l10.5%2021h-21zM110.5%20200l10.5%2020h-21zM174.5%20182l10.5%2021h-21zM223.5%20203l10.5%2021h-21zM42%20141l10%2021H32z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E&quot;)">e</span><span class="letter" style="background-image:url(&quot;data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20256%20256%22%3E%0A%20%20%3Cdefs%2F%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%233FCDFF%22%20d%3D%22M0%200h256v256H0z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23037FAA%22%20d%3D%22M26.5%2040.75l-9.698%205.099%201.852-10.8-7.846-7.648%2010.843-1.575L26.5%2016l4.849%209.826%2010.843%201.575-7.846%207.648%201.852%2010.8zM43.5%20131.75l-9.698%205.099%201.852-10.8-7.846-7.648%2010.843-1.575L43.5%20107l4.849%209.826%2010.843%201.575-7.846%207.648%201.852%2010.8zM175%2040.75l-9.992%205.099%201.908-10.8-8.084-7.648%2011.172-1.575L175%2016l4.996%209.826%2011.172%201.575-8.084%207.648%201.908%2010.8zM227.5%2098.5l-9.698%205.253%201.852-11.126-7.846-7.88%2010.843-1.624L227.5%2073l4.849%2010.123%2010.843%201.624-7.846%207.88%201.852%2011.126zM109%2091.5l-9.992%205.253%201.908-11.126-8.084-7.88%2011.172-1.624L109%2066l4.996%2010.123%2011.172%201.624-8.084%207.88%201.908%2011.126zM211%20213.75l-9.992%205.099%201.908-10.8-8.084-7.648%2011.172-1.575L211%20189l4.996%209.826%2011.172%201.575-8.084%207.648%201.908%2010.8zM141.5%20180.75l-9.698%205.099%201.852-10.8-7.846-7.648%2010.843-1.575L141.5%20156l4.849%209.826%2010.843%201.575-7.846%207.648%201.852%2010.8zM52%20222.75l-9.992%205.099%201.908-10.8-8.084-7.648%2011.172-1.575L52%20198l4.996%209.826%2011.172%201.575-8.084%207.648%201.908%2010.8z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E&quot;)">l</span><span class="letter" style="background-image:url(&quot;data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20256%20256%22%3E%0A%20%20%3Cdefs%2F%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%233FCDFF%22%20d%3D%22M0%200h256v256H0z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23037FAA%22%20d%3D%22M26.5%2040.75l-9.698%205.099%201.852-10.8-7.846-7.648%2010.843-1.575L26.5%2016l4.849%209.826%2010.843%201.575-7.846%207.648%201.852%2010.8zM43.5%20131.75l-9.698%205.099%201.852-10.8-7.846-7.648%2010.843-1.575L43.5%20107l4.849%209.826%2010.843%201.575-7.846%207.648%201.852%2010.8zM175%2040.75l-9.992%205.099%201.908-10.8-8.084-7.648%2011.172-1.575L175%2016l4.996%209.826%2011.172%201.575-8.084%207.648%201.908%2010.8zM227.5%2098.5l-9.698%205.253%201.852-11.126-7.846-7.88%2010.843-1.624L227.5%2073l4.849%2010.123%2010.843%201.624-7.846%207.88%201.852%2011.126zM109%2091.5l-9.992%205.253%201.908-11.126-8.084-7.88%2011.172-1.624L109%2066l4.996%2010.123%2011.172%201.624-8.084%207.88%201.908%2011.126zM211%20213.75l-9.992%205.099%201.908-10.8-8.084-7.648%2011.172-1.575L211%20189l4.996%209.826%2011.172%201.575-8.084%207.648%201.908%2010.8zM141.5%20180.75l-9.698%205.099%201.852-10.8-7.846-7.648%2010.843-1.575L141.5%20156l4.849%209.826%2010.843%201.575-7.846%207.648%201.852%2010.8zM52%20222.75l-9.992%205.099%201.908-10.8-8.084-7.648%2011.172-1.575L52%20198l4.996%209.826%2011.172%201.575-8.084%207.648%201.908%2010.8z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E&quot;)">l</span><span class="letter" style="background-image:url(&quot;data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%202.........完整代码请登录后点击上方下载按钮下载查看

网友评论0