单个div+css实现聚光灯照射文字阴影动画效果代码

代码语言:html

所属分类:动画

代码描述:单个div+css实现聚光灯照射文字阴影动画效果代码

代码标签: 单个 div css 聚光灯 照射 文字 阴影 动画

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">



    <style>
        body {
          min-height: 250px;
          height: 100vh;
          position: relative;
          background-color: #333;
          text-align: center;
        }
        div {
          position: absolute;
          left: 50%;
          top: 50%;
        }
        div::before,
        div::after {
          display: block;
          content: '';
          position: absolute;
        }
        @media (max-width: 400px) {
          div:not(.no-scale) {
            transform: scale(0.8);
          }
        }
        #shadow {
          width: 400px;
          height: 300px;
          margin-left: -200px;
          margin-top: -150px;
          background-repeat: no-repeat;
          background-image: radial-gradient(circle, rgba(255,255,255,0.6) 25%, rgba(255,255,255,0) 60%);
          background-position: 50% 40%;
          background-size: 13em 13em;
          animation: shadow 3s ease-in-out infinite alternate-reverse;
        }
        #shadow::before,
        #shadow::after {
          width: 100%;
          height: 100%;
          display: grid;
          place-content: center;
          content: 'SHADOW';
          font-family: Helvetica, sans-serif;
          font.........完整代码请登录后点击上方下载按钮下载查看

网友评论0