css实现煎蛋情人节表白动画效果代码
代码语言:html
所属分类:表白
代码描述:css实现煎蛋情人节表白动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css?family=Josefin+Sans:300"); body { background: #48befe; font-family: 'Josefin Sans', sans-serif; font-size: 12px; } .container { position: absolute; white-space: nowrap; left: 50%; top: 50%; transform: translate(-50%, -50%); } ul { margin: 0; padding: 0; } ul li { list-style: none; } .egg { width: 175px; height: 220px; border-radius: 100px 100px 0px 0px; background: #fdfeff; position: relative; display: inline-block; animation: floating 5s ease-out infinite; left: -5%; } .egg .face { width: 130px; height: 130px; background: #ffdb10; position: absolute; margin: 15% 15%; border-radius: 100%; box-shadow: inset -10px 1px 0 #ffcc24; } .egg .face .eyes { width: 15px; height: 15px; background: #000; border-radius: 100%; position: relative; top: 55px; left: 38px; animation: blink 3s infinite 2s; } .egg .face .eyes::after { content: ""; width: 15px; height: 15px; position: absolute; background: #000; border-radius: 100%; left: 50px; } .egg .face .smile { position: relative; border-bottom-left-radius: 90px; border-bottom-right-radius: 90px; width: 30px; height: 15px; background: #000; left: 55px; top: 60px; } .egg .face .smile::after { content: ""; position: absolute; width: 10px; height: 5px; background: #ff7e7e; border-radius: 100%; left: 10px; top: 8px; } .egg .face .cheeks { position: relative; width: 12px; height: 12px; background: #ff7e7e; border-radius: 100%; opacity: 0.5; top: 40px; left: 30px; } .egg .face .cheeks::after { content: ""; position: absolute; width: 12px; height: 12px; background: #ff7e7e; border-radius: 100%; left: 67px; } .egg .face .shine { position: relative; width: 8px; height: 20px; background: #fdfeff; border-radius: 200px; top: -10px; left: 12px; transform: rotate(20deg); } .egg .face .shine::after { position: absolute; content: ""; width: 8px; height: 8px; background: #fdfeff; border-radius: 200px; top: -15px; left: 6px; } .egg ul { display: flex; } .egg li { position: relative; border-radius: 200px; } .egg li:nth-child(odd) { background: #fdfeff; } .egg li:nth-child(even) { background: #48befe; } .egg li:nth-child(1) { width: 30px; height: 60px; top: 175px; animation: anim1 1.5s ease-out infinite; } .egg li:nth-child(2) { width: 20px; height: 50px; top: 185px; animation: anim2 3s ease-out infinite; } .egg li:nth-child(3) { width: 28.5px; height: 60px; top: 195px; animation: anim3 1s ease-in-out infinite; } .egg li:nth-child(4) { width: 20px; height: 50px; top: 210px; animation: anim4 2.2s ease-out infinite; } .egg li:nth-child(5) { width: 28.5px; height: 60px; top: 190px; animation: anim3 1.5s ease-out infinite; } .egg li:nth-child(6) { width: 20px; height: 60px; top: 200px; animation: anim2 4s ease-out infinite; } .egg li:nth-child(7) { width: 28.5px; height: 60px; top: 190px; animation: anim1 1.5s ease-out infinite; } .ghost { width: 175px; height: 220px; border-radius: 100px 100px 0px 0px; background: #fdfeff; position: relative; display: inline-block; animation: floating 2s ease-out infinite; opacity: 0.75; left: 5%; } .ghost::before { content: ""; width: 175px; height: 220px; border-radius: 100px 100px 0px 0px; background: #fdfeff; position: relative; display: inline-block; position: absolute; box-shadow: inset -15px 1px 0px #efefef; } .ghost .face { width: 130px; height: 130px; background: transparent; position: absolute; margin: -20% 10%; border-radius: 100%; } .ghost .face .eyes { opacity: 0.5; width: 15px; height: 15px; background: #000; border-radius: 100%; position: relative; top: 55px; left: 3px; animation: blink 5s infinite; } .ghost .face .eyes::after { content: ""; width: 15px; height: 15px; position: absolute; background: #000; border-radius: 100%; left: 50px; } .ghost .face .smile { position: relative; opacity: 0.5; border-bottom-left-radius: 50px; border-bottom-right-radius: 50px; width: 10px; height: 6px; background: transparent; border: 5px solid #000; left: 25px; top: 55px; } .ghost .face .smile::before { background: #fdfeff; width: 30px; height: 7px; content: ""; position: absolute; left: -10px; top: -5.5px; } .ghost .face .cheeks { position: relative; width: 12px; heigh.........完整代码请登录后点击上方下载按钮下载查看
网友评论0