css实现一个三维旋转的生日蛋糕动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现一个三维旋转的生日蛋糕动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { display: flex; justify-content: center; align-items: center; background: #006bf4; height: 100vh; overflow: hidden; } .cake { width: 270px; height: 270px; display: flex; flex-direction: column; transform-style: preserve-3d; transform: rotateY(0); } .body { height: 120px; border-radius: 20px 20px 0 0; background: #ff0059; position: relative; overflow: hidden; white-space: nowrap; /* for safari border-radius overflow and transform fix */ -webkit-mask-image: -webkit-radial-gradient(white, black); } .tray { width: 100%; height: 3px; background: #cac9c9; box-shadow: 0px 5px 0px 2px #9E9E9E; } .cream { height: 32px; background: #fff; width: 100%; } .cream-wrap { display: inline-block; width: 100%; animation: rotate-cake 8s linear infinite; } .--copy { animation: rotate-cake2 8s linear infinite; animation-delay: -4s; left: -35px; position: relative; } .cream-line { width: 30px; height: 60px; background: #fff; border-radius: 0 0 20px 20px; box-shadow: inset 0px -7px 0px 0px #e5e5e6; position: absolute; top: 29px; left: 0; } .cream-line:nth-child(2) { left: 60px; height: 65px; } .cream-wrap:not(.--copy) .cream-line:nth-child(2) { left: 60px; height: 65px; .........完整代码请登录后点击上方下载按钮下载查看
网友评论0