代码

Html代码:

<h2 data-text="Loading...">Loading...</h2>

CSS代码:

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #252839;
}

h2 {
    position: relative;
    font-size: 14vw;
    color: #252839;
    -webkit-text-stroke: 0.3vw #383d52;  
    text-transform: uppercase;
}

h2::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    -webkit-text-stroke: 0vw #383d52;
    color: #01fe87;
    border-right: 1px solid #01fe87;
    overflow: hidden;
    animation: animate 6s linear infinite;
}

@keyframes animate {
    0%, 10%, 100% {
        width: 0;
    }
    70%, 90% {
        width: 100%;
    }
}

说点什么
你是我一生只会遇见一次的惊喜...
支持Markdown语法
好耶,沙发还空着ヾ(≧▽≦*)o
Loading...