Make an Animation design with Text using HTML,CSS

 Make an Animation design with Text using HTML, CSS

This design uses HTML, CSS. Here is the code

CSS:

@import url('https://fonts.googleapis.com/css?family=Roboto:700');

.container {
    color: #e5e5e5;
    font-size: 2.26rem;
    text-transform: uppercase;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

h1 {
    text-shadow: 0 0 7px rgb(255, 255, 255, .3), 0 0 3px rgba(255, 255, 255, .3);
    color: white;
    text-align: center;
}

body {
    font-family: 'Roboto';
    background-color: #131417;
}

.myname {
    padding: 10px;
    height: 50px;
    overflow: hidden;
    margin-left: 1.5rem;
}

.myname div div {
    padding: 0.25rem 0.75rem;
    height: 2.81rem;
    margin-bottom: 2.81rem;
    display: inline-block;
    color: rgb(255, 255, 255);

}

.myname div:first-child {
    animation: text-animation 8s infinite;
}

.myname .displayname div {
    background-color: #20a7d8;
}

.myname .proname div {
    background-color: #d89520;
}

.myname .othername div {
    background-color: #3a16c7;
}

@keyframes text-animation {
    0% {
        margin-top: 0;
    }

    10% {
        margin-top: 0;
    }

    20% {
        margin-top: -5.62rem;
    }

    30% {
        margin-top: -5.62rem;
    }

    40% {
        margin-top: -11.24rem;
    }

    60% {
        margin-top: -11.24rem;
    }

    70% {
        margin-top: -5.62rem;
    }

    80% {
        margin-top: -5.62rem;
    }

    90% {
        margin-top: 0;
    }

    100% {
        margin-top: 0;
    }
}

HTML:

<!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">
    <link rel="stylesheet" href="styles.css">
    <title>Document</title>
</head>

<body>
    <main class="container">
        <h1>HELLO 👋 I'M</h1>
        <section class="myname">
            <div class="displayname">
                <div>AURNAB DAS</div>
            </div>
            <div class="proname">
                <div>SOFTWARE ENGINEER</div>
            </div>
            <div class="othername">
                <div>WEB DEVELOPER</div>
            </div>
        </section>

    </main>
</body>

</html>

Post a Comment

Previous Post Next Post