In This Video We Will Create A Facebook HAHA Emoji Reactions Using Pure CSS 😆
Getting started
It’s pretty easy to get started with Statusfy.
Create a new index.html file with this HTML code..
<div class="emoji emoji--haha">
<div class="emoji__face">
<div class="emoji__eyes"></div>
<div class="emoji__mouth">
<div class="emoji__tongue"></div>
</div>
</div>
</div>
body {
margin: 0;
width: 1200px;
max-width: 100%;
text-align: center;
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.emoji {
width: 120px;
height: 120px;
margin: 15px 15px 40px;
background: #FFDA6A;
display: inline-block;
border-radius: 50%;
position: relative;
}
.emoji:after {
position: absolute;
bottom: -40px;
font-size: 18px;
width: 60px;
left: calc(50% - 30px);
color: #8A8A8A;
}
.emoji__face, .emoji__eyes, .emoji__mouth, .emoji__tongue {
position: absolute;
}
.emoji__face:before, .emoji__face:after, .emoji__eyes:before, .emoji__eyes:after, .emoji__tongue:before, .emoji__tongue:after {
position: absolute;
content: '';
}
.emoji__face {
width: inherit;
height: inherit;
}
.emoji--haha:after {
content: 'Haha';
}
.emoji--haha .emoji__face {
-webkit-animation: haha-face 2s linear infinite;
animation: haha-face 2s linear infinite;
}
.emoji--haha .emoji__eyes {
width: 26px;
height: 6px;
border-radius: 2px;
left: calc(50% - 13px);
top: 35px;
-webkit-transform: rotate(20deg);
transform: rotate(20deg);
background: transparent;
box-shadow: -25px 5px 0 0 #000000, 25px -5px 0 0 #000000;
}
.emoji--haha .emoji__eyes:after {
left: 0;
top: 0;
width: 26px;
height: 6px;
border-radius: 2px;
-webkit-transform: rotate(-40deg);
transform: rotate(-40deg);
background: transparent;
box-shadow: -25px -5px 0 0 #000000, 25px 5px 0 0 #000000;
}
.emoji--haha .emoji__mouth {
width: 80px;
height: 40px;
left: calc(50% - 40px);
top: 50%;
background: #000000;
border-radius: 0 0 40px 40px;
overflow: hidden;
z-index: 1;
-webkit-animation: haha-mouth 2s linear infinite;
animation: haha-mouth 2s linear infinite;
}
.emoji--haha .emoji__tongue {
width: 70px;
height: 30px;
background: #F55064;
left: calc(50% - 35px);
bottom: -10px;
border-radius: 50%;
}
@keyframes haha-face {
10%, 30%, 50% {
-webkit-transform: translateY(25px);
transform: translateY(25px);
}
20%, 40% {
-webkit-transform: translateY(15px);
transform: translateY(15px);
}
60%, 80% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
70%, 90% {
-webkit-transform: translateY(-10px);
transform: translateY(-10px);
}
}
@keyframes haha-mouth {
10%, 30%, 50% {
-webkit-transform: scale(0.6);
transform: scale(0.6);
top: 45%;
}
20%, 40% {
-webkit-transform: scale(0.8);
transform: scale(0.8);
top: 45%;
}
60%, 80% {
-webkit-transform: scale(1);
transform: scale(1);
top: 50%;
}
70% {
-webkit-transform: scale(1.2);
transform: scale(1.2);
top: 50%;
}
90% {
-webkit-transform: scale(1.1);
transform: scale(1.1);
top: 50%;
}
}
then,
connect the style.css file in index.html file
I hope you know how to add css and js file in html. Or follow tutorial video..
0 Comments