Skip to main content

Featured

Play Emoji - Development Series #3

HTML <!DOCTYPE html> <html lang="en"> <head>     <link rel="stylesheet" href="playemoji.css">     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>Document</title> </head> <body>     <div class="face">         <div class="eyes">             <div class="eye"></div>             <div class="eye"></div>         </div>     </div>     <script>         document.querySelector('body').addEventListener('mousemove', eyeball);         function eyeball()         {             var eye = document.querySelectorAll('.eye');      ...

Play Emoji - Development Series #3










HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <link rel="stylesheet" href="playemoji.css">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="face">
        <div class="eyes">
            <div class="eye"></div>
            <div class="eye"></div>
        </div>
    </div>
    <script>
        document.querySelector('body').addEventListener('mousemove', eyeball);
        function eyeball()
        {
            var eye = document.querySelectorAll('.eye');
            eye.forEach(function(eye){
                let x = (eye.getBoundingClientRect().left) + (eye.clientWidth / 2);
                let y = (eye.getBoundingClientRect().top) + (eye.clientHeight / 2);
                let radian = Math.atan2(event.pageX - x, event.pageY - y);
                let rot = (radian * (180 / Math.PI) * -1) + 270;
                eye.style.transform = "rotate("+ rot +"deg)";
            })
        }
    </script>
</body>
</html>


CSS
*
{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body
{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #5d3800;
}
.face
{
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: #ffcd00;
    display: flex;
    justify-content: center;
    align-items: center;
}
.face::before
{
    content: '';
    position: absolute;
    top: 180px;
    width: 150px;
    height: 70px;
    background: #b57700;
    border-bottom-left-radius: 70px;
    border-bottom-right-radius: 70px;
    transition: 0.5s;
}
.face:hover::before
{
    top: 210px;
    width: 150px;
    height: 20px;
    background: #b57700;
    border-bottom-left-radius: 0px;
    border-bottom-right-radius: 0px;
}
.eyes
{
    position: relative;
    top: -40px;
    display: flex;
}
.eyes .eye
{
    position: relative;
    width: 80px;
    height: 80px;
    display: block;
    background: #fff;
    margin: 0 15px;
    border-radius: 50%;
}
.eyes .eye::before
{
    content: '';
    position: absolute;
    top: 50%;
    left: 25px;
    transform: translate(-50%,-50%);
    width: 40px;
    height: 40px;
    background: #333;
    border-radius: 50%;

}

Comments

Popular posts from this blog

Technological evolution

Theory of technological evolution Mankind In Transition ; A View of the Distant Past, the Present and the Far Future , Masefield Books, 1993.  Technology  (which Richta defines as "a material entity created by the application of mental and physical effort to nature in order to achieve some value") evolves in three stages: tools, machine,  automation . This evolution, he says, follows two trends: Development The pre-technological period, in which all other animal species remain today - aside from some avian and primate species - was a non-rational period of the early  prehistoric man . The emergence of technology, made possible by the development of the rational faculty, paved the way for the first stage: the tool. A tool provides a mechanical advantage in accomplishing a physical task, such as an arrow, plow, or hammer that augments physical labour to more efficiently achieve his objective. Later animal-powered tools such as the plow and the hors...

Why a Discord Bot needs very deep and complex coding??

What is Discord?? Many people who are connected with YouTube and Gaming Industry know What is Discord .Let me tell you, Discord is a platform which allows anyone to create his/her personal server without any kind of charge and one is not supposed to tell Discord the topic of the server. These days, Discord is a very important part of Gaming Industries. Specially for Indian Gaming Creators Discord is the one and only platform to connect with their followers and fans. And now there are a lots of servers of Indian YT Creators like, Dynamo Gaming  , Casetoo  , The RawKnee Games .                           What is Discord Bot?? Discord Bot is a digital Assistant for admins and managers of server and it's also used to make server fun and used to pass the time of any member.There are many kind of Discord Bots.And the number of Discord bots is increasing day by day.There are many Bots with different ability...