• 全屏数字预加载动画


    效果图
    在这里插入图片描述

    代码

    DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>全屏数字计时预加载title>
        <style>
            body {
                margin: 0;
                padding: 0;
                font-family: sans-serif;
            }
    
            .loader {
                position: absolute;
                top: 0;
                left: 0;
                height: 100%;
                background-color: #000;
            }
    
            section {
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100vh;
                background-color: #fff;
                pointer-events: none;
                animation: fadeout .5s linear forwards;
                animation-delay: 11s;
            }
    
            @keyframes fadeout {
                from {
                    opacity: 1;
                }
    
                to {
                    opacity: 0;
                }
            }
    
            .count {
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                font-size: 18vw;
                color: #fff;
                font-weight: 800;
                mix-blend-mode: difference;
                width: 550px;
                text-align: right;
            }
    
            .welcome {
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100vh;
                display: flex;
                justify-content: center;
                align-items: center;
                color: #fff;
            }
    
            h2 {
                margin: 0;
                padding: 0;
                font-size: 10vw;
                color: #000;
            }
        style>
    head>
    
    <body>
        <div class="welcome">
            <h2>welcomeh2>
        div>
        <section>
            <div class="loader">div>
            <div class="count">div>
        section>
        <script src="https://code.jquery.com/jquery-3.3.1.min.js">script>
        <script>
            $(document).ready(() => {
                var count = 0;
                var counter = setInterval(() => {
                    if (count < 1001) {
                        $('.count').text(Math.round(count / 10) + '%')
                        $('.loader').css('width', count / 10 + '%')
                        count++
                    }
                    else {
                        clearInterval(counter)
                    }
                }, 10);
            })
        script>
    body>
    
    html>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
  • 相关阅读:
    linux挂载u盘及卸载
    UE学习记录06----根据Actor大小自适应相机位置
    Delphi 报错 Type androidx.collection.ArraySet is defined multiple times
    Linux shell脚本进阶使用
    算法通关村第十五关:白银挑战-海量数据场景下的热门算法题
    docker jenkins 安装配置
    通过Forcebot压测实践简述“并发模式”与“RPS模式”两种模式的区别
    【面经】阿里数据研发面经
    【Linux】共享内存
    【Linux】命名管道
  • 原文地址:https://blog.csdn.net/weixin_44368963/article/details/126166649