Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <h1>CSS EMOJIS</h1>
<div class="emojis-wrapper">
    <div class="emoji emoji1">
        <div class="mouth"></div>
    </div>
    <div class="emoji emoji2">
        <div class="mouth"></div>
    </div>
    <div class="emoji emoji3">
        <div class="mouth"></div>
    </div>
</div>





<!-- Link to my website -->
<a id="ajerez" href="http://www.ajerez.es/en/" target="_blank"><img src="https://i.imgur.com/AI4BS2I.png"/></a>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Patrick+Hand+SC);

$color1: #FFEB96;
$color2: #414141;
$color3: #F7AA86;
$color4: #A4D3DD;
$color5: #F3F3F3;

body {
    background-color: $color4;
}

*, *:before, *:after {
  box-sizing: border-box;
}

h1 {
    font-family: 'Patrick Hand SC', cursive;
    font-size: 50px;
    color: $color1;
    text-align: center;

}
.emojis-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
    margin-top:40px;
}

.emoji {
    border-radius: 50%;
    position: relative;
    width: 100px;
    height: 100px;
    background-color: $color1;
}

.emoji1 {
   
    &:after, &:before {
        position: absolute;
        content: "";
        height: 10px;
        width: 10px;
        background-color: $color2;
        border-radius: 50%;
        top: 48px;
        animation: emoji1-face-move 5s ease-in-out infinite, emoji1-eyes-blink 2s ease-in-out infinite;
        animation-direction: alternate;
    }
    
    &:after {
        left: 30px;
        
    }
    
    &:before {
        
        left: 85px;
    }
    
    .mouth {
        position: absolute;
        height: 3px;
        width: 35px;
        background-color: $color2;
        border-radius: 5px;
        top: 68px;
        left:45px;
        animation: emoji1-face-move 5s ease-in-out infinite;
        animation-direction: alternate;
    }
}

@keyframes emoji1-eyes-blink {
    0% {
        height: 10px;
    }
    97% {
        height: 10px;
    }
    100% {
        height: 0px;
    }
}

@keyframes emoji1-face-move {
    0% {
        transform: translateX(0);
    }
    30% {
        transform: translateX(0);
    }
    35% {
        transform: translateX(-20px);
    }
    65% {
        transform: translateX(-20px);
    }
    70% {
        transform: translateX(-10px);
    }
    85% {
        transform: translateX(-10px);
    }
    90% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(0);
    }
}

.emoji2 {
   
    &:after, &:before {
        position: absolute;
        content: "";
        height: 10px;
        width: 10px;
        background-color: $color2;
        border-radius: 50%;
        top: 48px;
        animation: emoji2-face-move 4s ease-in-out infinite, emoji1-eyes-blink 2s ease-in-out infinite;
    }
    
    &:after {
        left: 18px;
        
    }
    
    &:before {
        
        left: 72px;
    }
    
    .mouth {
        position: absolute;
        height: 22px;
        overflow: hidden;
        border-top: 4px solid $color5;
        width: 30px;
        background-color: $color3;
        border-radius: 25px;
        top: 68px;
        left:35px;
        animation: emoji2-face-move 4s ease-in-out infinite, emoji2-mouth-move 4s ease-in-out infinite;
    }
}

@keyframes emoji2-face-move {
    0% {
        transform: translateY(0);
    }
    55% {
        transform: translateY(0);
    }
    60% {
        transform: translateY(-10px);
    }
    95% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes emoji2-mouth-move {
    0% {
        height: 22px;
        border-top: 4px solid $color5;
    }
    55% {
        height: 22px;
        width: 30px;
        left:35px;
        border-top: 4px solid $color5;
    }
    60% {
        height: 10px;
        width: 15px;
        left:42px;
        border-top: 4px solid $color1;
    }
    95% {
        height: 10px;
        width: 15px;
        left:42px;
        border-top: 4px solid $color1;
    }
    100% {
        height: 22px;
        width: 30px;
        left:35px;
        border-top: 4px solid $color5;
    }
}

.emoji3 {
   
    &:after, &:before {
        position: absolute;
        content: "";
        height: 10px;
        width: 10px;
        background-color: $color2;
        border-radius: 50%;
        top: 48px;
        animation: emoji3-face-move 0.25s ease-in-out infinite, emoji1-eyes-blink 2s ease-in-out infinite;
        animation-direction: alternate;

    }
    
    &:after {
        left: 18px;
        
    }
    
    &:before {
        
        left: 72px;
    }
    
    .mouth {
        position: absolute;
        height: 22px;
        top: 68px;
        left:35px;
        animation: emoji3-mouth-move 0.25s ease-in-out infinite;
        animation-direction: alternate;
        
        &:before, &:after {
            content: '';
            border-radius: 100%;
            position: absolute;

            border: 3px solid transparent;
            border-top: 3px solid $color2;
            border-left: 3px solid $color2;
            transform-origin: center center;
        }

        &:before {
            height: 15px;
            width: 15px;
            transform: rotate(-45deg);
            top: 0;
            left: 5px;
        }
        
        &:after {
            height: 10px;
            width: 10px;
            transform: rotate(-90deg);
            top: 12px;
            left: 8px;
        }
    }
}

@keyframes emoji3-face-move {
    0% {
        transform: translatex(0);
    }
    100% {
        transform: translateX(-3px);
    }
}

@keyframes emoji3-mouth-move {
    0% {
        transform: translatex(0);
    }
    100% {
        transform: translateX(-5px);
    }
}
              
            
!

JS

              
                /* Inspiration: https://dribbble.com/shots/1925708-Emojis
 * CSS Emojis
 * A pen by Alberto Jerez
 * www.ajerez.es
 */

              
            
!
999px

Console