css实现文字光照阴影动画效果代码

代码语言:html

所属分类:动画

代码描述:css实现文字光照阴影动画效果代码

代码标签: cs 文字 光照 阴影 动画

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

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

<head>
    <meta charset="UTF-8">
    <style>
        @import url(https://fonts.googleapis.com/css?family=Anton);
    
    html {
      height: 100%;
    }
    
    body {
      height: 100%;
      margin: 0;
      overflow: hidden;
      background: #000 linear-gradient(#000 30%, #666);
      font: 150px/1 'Anton', sans-serif;
      letter-spacing: -0.02em;
      text-align: center;
    }
    
    .container {
      display: inline-block;
      position: relative;
      width: 940px;
      height: 100%;
    }
    
    .light {
      position: absolute;
      top: calc(50% - 160px);
      left: 50%;
      width: 0px;
      height: 0px;
      box-shadow: 0 0 140px 60px #fff;
      animation: light 16s ease-in-out infinite;
    }
    
    .text {
      position: absolute;
      width: 100%;
      top: calc(50% - 170px);
      color: #000;
      text-shadow: rgba(255, 255, 255, 0.3) 0 -1px;
    }
    
    .shadow-perspective {
      position: absolute;
      top: 50%;
      width: 100%;
      perspective: 200px;
      transform-style: preserve-3d;
      animation: shadow-perspective 16s ease-in-out infinite;
    }.........完整代码请登录后点击上方下载按钮下载查看

网友评论0