Skip to content
Advertisements

CSS Text Animation


HTML CODE:

<!DOCTYPE html>
<html>
<head>
    <title>page</title>
     <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="1.page.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
</head>
<body>
    
    <div class="center">
        <h1>
            <span>CODEBLOGGER</span>
            <span>CODEBLOGGER</span>
            <span>CODEBLOGGER</span>
        </h1>
    </div>
    <p>HTML - CSS - PYTHON - C++</p>

</body>
</html>

CSS CODE:

body{
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background: #000;
    overflow: hidden;
}
.center{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: perspective(1000px) translate(-50%,-50%) skewY(15deg);
    transition: .5s;
}
.center:hover{
    transform: perspective(1000px) translate(-50%,-50%) skewY(0deg); 
}
.center h1 span{
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(-50%,-50%);
    color: #fff;
    margin: 0;
    padding: 0;
    text-transform: uppercase;
    font-size: 12em;
    transform-style: preserve-3d;
    transition: .5s;
}
.center h1 span:nth-child(1){
    color: #efeeee;
    -webkit-clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}
.center h1 span:nth-child(2){
    color: #e91e61;
    transform: translate(-50%,-50%) skewX(-60deg);
    left: -38px;
    -webkit-clip-path: polygon(0 45%, 100% 45%, 100% 55%, 0 55%);
    clip-path: polygon(0 45%, 100% 45%, 100% 55%, 0 55%);
}
.center h1 span:nth-child(3){
    color: #efeeee;
    transform: translate(-50%,-50%) skewX(0deg);
    left: -76px;
    -webkit-clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}
.center:hover h1 span:nth-child(2),
.center:hover h1 span:nth-child(3){
    transform: translate(-50%,-50%) skewX(0);
    left: 0;
    color: #fff;
}
.center:hover h1 span:nth-child(1){
    color: #fff;
}
p{
    color: #e91e61;
    font-family:arial;
    font-size: 5em;
    position: absolute;
    top:60%;
    left: 50%;
    transform: perspective(1000px) translate(-50%,-50%) skewY(15deg);
    border:3px solid #fff;
    padding: 8px;
    transition: .5s;
}
.center:hover ~ p{
    transform: perspective(1000px) translate(-50%,-50%) skewY(0deg);
    border:none;
    font-size: 6em;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: