• 文字抽烟效果


    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <style>
            *{
                margin: 0;
                padding: 0;
            }
            div{
                background: #111111;
                height: 100vh;
                display: flex;
                justify-content: center;
                align-items: center;
            }
            div .text{
                color: #ffffff;
                user-select: none;
            }
            span{
                display: inline-block;
            }
            .active{
                animation: smoke 2s linear forwards;
            }
            @keyframes smoke {
                0% {
                    opacity: 1;
                    filter: blur(0);
                    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
                }
                100% {
                    opacity: 0;
                    filter: blur(20px);
                    transform: translateX(300px) translateY(-300px) rotate(720deg) scale(8);
                }
            }
        </style>
    </head>
    <body>
        <div>
            <p class="text">
                Lorem ipsum dolor sit amet,
                consectetur adipisicing elit. Animi a
                ssumenda dolores ex mollitia nisi rerum
                soluta sunt tempore, tenetur voluptates? A des
                erunt, esse iste nulla odio quibusdam quidem quos
                voluptates!
                Lorem ipsum dolor sit amet,
                consectetur adipisicing elit. Animi a
                ssumenda dolores ex mollitia nisi rerum
                soluta sunt tempore, tenetur voluptates? A des
                erunt, esse iste nulla odio quibusdam quidem quos
                voluptates!
            </p>
        </div>
    <script>
        const text = document.querySelector('.text')
        text.innerHTML = text.textContent.replace(/w/g,'<span>$&</span>')
        const allSpan = document.querySelectorAll('span')
        allSpan.forEach( i =>{
            i.addEventListener('mouseover',function (){
                i.classList.add('active')
            })
        })
    </script>
    </body>
    </html>
  • 相关阅读:
    leetcode目录
    Windows下tuxedo配置
    实习总结
    n人比赛,可轮空,比赛轮数和场数
    Ubuntu中Eclipse安装与配置
    Lunix中文乱码解决方案
    tuxedo入门
    useradd和adduser的区别
    每个位上都是素数
    TUXEDO错误解决方案
  • 原文地址:https://www.cnblogs.com/javascript9527/p/14724991.html
Copyright © 2020-2023  润新知