CSS3實現各種表情

来源:https://www.cnblogs.com/yidaixiaohui/archive/2018/08/20/8447148.html
-Advertisement-
Play Games

CSS3實現各種表情 效果圖: 代碼如下,複製即可使用: 如有錯誤,歡迎聯繫我改正,非常感謝!!! ...


 CSS3實現各種表情

 效果圖:

 

 代碼如下,複製即可使用:

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style type="text/css">
        body {
  text-align: center;
  margin: 80px auto 0;
  font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
}

.emoji {
  width: 120px;
  height: 120px;
  margin: 15px;
  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__eyebrows, .emoji__eyes, .emoji__mouth, .emoji__tongue, .emoji__heart, .emoji__hand, .emoji__thumb {
  position: absolute;
}
.emoji__face:before, .emoji__face:after, .emoji__eyebrows:before, .emoji__eyebrows:after, .emoji__eyes:before, .emoji__eyes:after, .emoji__mouth:before, .emoji__mouth:after, .emoji__tongue:before, .emoji__tongue:after, .emoji__heart:before, .emoji__heart:after, .emoji__hand:before, .emoji__hand:after, .emoji__thumb:before, .emoji__thumb:after {
  position: absolute;
  content: '';
}

.emoji__face {
  width: inherit;
  height: inherit;
}

.emoji--like {
  background: #548DFF;
}
.emoji--like:after {
  content: 'Like';
}
.emoji--like .emoji__hand {
  left: 25px;
  bottom: 30px;
  width: 20px;
  height: 40px;
  background: #FFFFFF;
  border-radius: 5px;
  z-index: 0;
  animation: hands-up 2s linear infinite;
}
.emoji--like .emoji__hand:before {
  left: 25px;
  bottom: 5px;
  width: 40px;
  background: inherit;
  height: 10px;
  border-radius: 2px 10px 10px 2px;
  box-shadow: 1px -9px 0 1px #FFFFFF, 2px -19px 0 2px #FFFFFF, 3px -29px 0 3px #FFFFFF;
}
.emoji--like .emoji__thumb {
  border-bottom: 20px solid #FFFFFF;
  border-left: 20px solid transparent;
  top: -25px;
  right: -25px;
  z-index: 2;
  transform: rotate(5deg);
  transform-origin: 0% 100%;
  animation: thumbs-up 2s linear infinite;
}
.emoji--like .emoji__thumb:before {
  border-radius: 50% 50% 0 0;
  background: #FFFFFF;
  width: 10px;
  height: 12px;
  left: -10px;
  top: -8px;
  transform: rotate(-15deg);
  transform-origin: 100% 100%;
  box-shadow: -1px 4px 0 -1px #FFFFFF;
}

.emoji--love {
  background: #F55064;
}
.emoji--love:after {
  content: 'Love';
}
.emoji--love .emoji__heart {
  left: calc(50% - 40px);
  top: calc(50% - 40px);
  width: 80px;
  height: 80px;
  animation: heart-beat 1s linear infinite alternate;
}
.emoji--love .emoji__heart:before, .emoji--love .emoji__heart:after {
  left: calc(50% - 20px);
  top: calc(50% - 32px);
  width: 40px;
  height: 64px;
  background: #FFFFFF;
  border-radius: 20px 20px 0 0;
}
.emoji--love .emoji__heart:before {
  transform: translate(20px) rotate(-45deg);
  transform-origin: 0 100%;
}
.emoji--love .emoji__heart:after {
  transform: translate(-20px) rotate(45deg);
  transform-origin: 100% 100%;
}

.emoji--haha:after {
  content: 'Haha';
}
.emoji--haha .emoji__face {
  animation: haha-face 2s linear infinite;
}
.emoji--haha .emoji__eyes {
  width: 26px;
  height: 6px;
  border-radius: 2px;
  left: calc(50% - 13px);
  top: 35px;
  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;
  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;
  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%;
}

.emoji--yay:after {
  content: 'Yay';
  animation: yay-reverse 1s linear infinite;
}
.emoji--yay .emoji__face {
  animation: yay 1s linear infinite alternate;
}
.emoji--yay .emoji__eyebrows {
  left: calc(50% - 3px);
  top: 30px;
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: transparent;
  box-shadow: -6px 0 0 0 #000000, -36px 0 0 0px #000000, 6px 0 0 0 #000000, 36px 0 0 0px #000000;
}
.emoji--yay .emoji__eyebrows:before, .emoji--yay .emoji__eyebrows:after {
  width: 36px;
  height: 18px;
  border-radius: 60px 60px 0 0;
  background: transparent;
  border: 6px solid black;
  box-sizing: border-box;
  border-bottom: 0;
  bottom: 3px;
  left: calc(50% - 18px);
}
.emoji--yay .emoji__eyebrows:before {
  margin-left: -21px;
}
.emoji--yay .emoji__eyebrows:after {
  margin-left: 21px;
}
.emoji--yay .emoji__mouth {
  top: 60px;
  background: transparent;
  left: 50%;
}
.emoji--yay .emoji__mouth:after {
  width: 80px;
  height: 80px;
  left: calc(50% - 40px);
  top: -75px;
  border-radius: 50%;
  background: transparent;
  border: 6px solid #000000;
  box-sizing: border-box;
  border-top-color: transparent;
  border-left-color: transparent;
  border-right-color: transparent;
  z-index: 1;
}
.emoji--yay .emoji__mouth:before {
  width: 6px;
  height: 6px;
  background: transparent;
  border-radius: 50%;
  bottom: 5px;
  left: calc(50% - 3px);
  box-shadow: -25px 0 0 0 #000000, 25px 0 0 0 #000000, -35px -2px 30px 10px #D5234C, 35px -2px 30px 10px #D5234C;
}

.emoji--wow:after {
  content: 'Wow';
}
.emoji--wow .emoji__face {
  animation: wow-face 3s linear infinite;
}
.emoji--wow .emoji__eyebrows {
  left: calc(50% - 3px);
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: transparent;
  box-shadow: -18px 0 0 0 #000000, -33px 0 0 0 #000000, 18px 0 0 0 #000000, 33px 0 0 0 #000000;
  animation: wow-brow 3s linear infinite;
}
.emoji--wow .emoji__eyebrows:before, .emoji--wow .emoji__eyebrows:after {
  width: 24px;
  height: 20px;
  border: 6px solid #000000;
  box-sizing: border-box;
  border-radius: 50%;
  border-bottom-color: transparent;
  border-left-color: transparent;
  border-right-color: transparent;
  top: -3px;
  left: calc(50% - 12px);
}
.emoji--wow .emoji__eyebrows:before {
  margin-left: -25px;
}
.emoji--wow .emoji__eyebrows:after {
  margin-left: 25px;
}
.emoji--wow .emoji__eyes {
  width: 16px;
  height: 24px;
  left: calc(50% - 8px);
  top: 35px;
  border-radius: 50%;
  background: transparent;
  box-shadow: 25px 0 0 0 #000000, -25px 0 0 0 #000000;
}
.emoji--wow .emoji__mouth {
  width: 30px;
  height: 45px;
  left: calc(50% - 15px);
  top: 50%;
  border-radius: 50%;
  background: #000000;
  animation: wow-mouth 3s linear infinite;
}

.emoji--sad:after {
  content: 'Sad';
}
.emoji--sad .emoji__face {
  animation: sad-face 2s ease-in infinite;
}
.emoji--sad .emoji__eyebrows {
  left: calc(50% - 3px);
  top: 35px;
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: transparent;
  box-shadow: -40px 9px 0 0 #000000, -25px 0 0 0 #000000, 25px 0 0 0 #000000, 40px 9px 0 0 #000000;
}
.emoji--sad .emoji__eyebrows:before, .emoji--sad .emoji__eyebrows:after {
  width: 30px;
  height: 20px;
  border: 6px solid #000000;
              
您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • Android系統的運行時庫層代碼是用C++來編寫的,用C\++ 來寫代碼最容易出錯的地方就是指針了,一旦使用不當,輕則造成記憶體泄漏,重則造成系統崩潰。不過系統為我們提供了智能指針,避免出現上述問題,本文將系統地分析Android系統智能指針(輕量級指針、強指針和弱指針)的實現原理。 在使用C++來 ...
  • TextView EditText Button imageView Spinner下拉列表 RadioGroup(覆選框) / Checkbox(單選框) ProgressBar進度條 RatingBar星級控制項 SeekBar進度條控制項 ...
  • "Android項目刮刮獎詳解(一)" 前言 上期我們簡單地實現了一個畫板的功能,用戶可以在上面亂寫亂畫,其實,刮刮獎也是如此,用戶刮獎的時候也是亂寫亂畫的。 刮刮獎原理 一共有兩層畫布,底層畫布存放中獎信息的圖片,上層畫布則是一個遮蓋層,我們將底層畫布成為信息層,上層畫布稱作為遮蓋層。 用戶再遮蓋 ...
  • Element.getBoundingClientRect()返回元素的大小及相對於視窗的位置 語法: rectObject=object.getBoundingClientRect(); 返回值是一個DOMRect對象,即DOMRect={x:scrollLeft,y:scrollY,width: ...
  • css sprites:精靈圖(雪碧圖):把一堆小圖片整合在一張大圖上,通過背景圖片相關設置(背景圖片、背景圖是否重覆、背景圖定位),顯示圖片,減輕伺服器對圖片的請求數量 優點: 1、減少網頁的HTTP請求,提高頁面性能 2、圖片命名上的困擾 3、更換風格方便 缺點: 1、必須限定容器大小,符合背景 ...
  • 一般性的,當我們需要載入js文件的時候都會使用script標簽來實現,類似於如下代碼: 代碼如下: <script type="text/javascript" src="example.js"></script> 但是直接使用script標簽來載入js文件會有如下一些缺點: 1.嚴格的讀取順序。由 ...
  • angularjs學習筆記,系統學習整理angular。angularjs、$scope、$parse、$interpolate ...
  • 這個系列將從基礎語法講起,把react全家桶都講到,然後到具體的使用,最後完成後,會寫一個完整的demo。 前置要求: 基本的CSS,JS要熟練。 部分ES6語法需要瞭解。可以參考下麵提到的阮一峰老師的《ECMAScript 6 入門》和MDN文檔。 目前已經完成的內容: "react教程(零)安裝 ...
一周排行
    -Advertisement-
    Play Games
  • 示例項目結構 在 Visual Studio 中創建一個 WinForms 應用程式後,項目結構如下所示: MyWinFormsApp/ │ ├───Properties/ │ └───Settings.settings │ ├───bin/ │ ├───Debug/ │ └───Release/ ...
  • [STAThread] 特性用於需要與 COM 組件交互的應用程式,尤其是依賴單線程模型(如 Windows Forms 應用程式)的組件。在 STA 模式下,線程擁有自己的消息迴圈,這對於處理用戶界面和某些 COM 組件是必要的。 [STAThread] static void Main(stri ...
  • 在WinForm中使用全局異常捕獲處理 在WinForm應用程式中,全局異常捕獲是確保程式穩定性的關鍵。通過在Program類的Main方法中設置全局異常處理,可以有效地捕獲並處理未預見的異常,從而避免程式崩潰。 註冊全局異常事件 [STAThread] static void Main() { / ...
  • 前言 給大家推薦一款開源的 Winform 控制項庫,可以幫助我們開發更加美觀、漂亮的 WinForm 界面。 項目介紹 SunnyUI.NET 是一個基於 .NET Framework 4.0+、.NET 6、.NET 7 和 .NET 8 的 WinForm 開源控制項庫,同時也提供了工具類庫、擴展 ...
  • 說明 該文章是屬於OverallAuth2.0系列文章,每周更新一篇該系列文章(從0到1完成系統開發)。 該系統文章,我會儘量說的非常詳細,做到不管新手、老手都能看懂。 說明:OverallAuth2.0 是一個簡單、易懂、功能強大的許可權+可視化流程管理系統。 有興趣的朋友,請關註我吧(*^▽^*) ...
  • 一、下載安裝 1.下載git 必須先下載並安裝git,再TortoiseGit下載安裝 git安裝參考教程:https://blog.csdn.net/mukes/article/details/115693833 2.TortoiseGit下載與安裝 TortoiseGit,Git客戶端,32/6 ...
  • 前言 在項目開發過程中,理解數據結構和演算法如同掌握蓋房子的秘訣。演算法不僅能幫助我們編寫高效、優質的代碼,還能解決項目中遇到的各種難題。 給大家推薦一個支持C#的開源免費、新手友好的數據結構與演算法入門教程:Hello演算法。 項目介紹 《Hello Algo》是一本開源免費、新手友好的數據結構與演算法入門 ...
  • 1.生成單個Proto.bat內容 @rem Copyright 2016, Google Inc. @rem All rights reserved. @rem @rem Redistribution and use in source and binary forms, with or with ...
  • 一:背景 1. 講故事 前段時間有位朋友找到我,說他的窗體程式在客戶這邊出現了卡死,讓我幫忙看下怎麼回事?dump也生成了,既然有dump了那就上 windbg 分析吧。 二:WinDbg 分析 1. 為什麼會卡死 窗體程式的卡死,入口門檻很低,後續往下分析就不一定了,不管怎麼說先用 !clrsta ...
  • 前言 人工智慧時代,人臉識別技術已成為安全驗證、身份識別和用戶交互的關鍵工具。 給大家推薦一款.NET 開源提供了強大的人臉識別 API,工具不僅易於集成,還具備高效處理能力。 本文將介紹一款如何利用這些API,為我們的項目添加智能識別的亮點。 項目介紹 GitHub 上擁有 1.2k 星標的 C# ...