css实现蛋糕效果代码
代码语言:html
所属分类:布局界面
代码描述:css实现蛋糕效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
box-sizing: border-box;
/*transition: transform 0.25s ease;*/
}
body {
background: #ffd6d6;
font: 500 16px "Product Sans Regular", sans-serif;
display: flex;
width: 100vw;
height: 100vh;
position: fixed;
margin: 0;
}
.canvas {
width: 600px;
height: 600px;
margin: auto;
position: relative;
display: flex;
/*background: #ffcccc;*/
transform-style: preserve-3d;
top: -100px;
}
.cake_sauce {
position: absolute;
background: #ff3a13;
width: 600px;
height: 600px;
border-radius: 50%;
transform: rotateX(80deg);
}
.cake_layer, .cake_shadow {
--cake_width: 250px;
--cake_height: 65px;
--cake_border: 0px solid black;
--layer_top: #F94821;
--layer_front: #f8f2b0;
--layer_right: #ece091;
position: absolute;
perspective: 1600px;
top: 200px;
left: 200px;
perspective-origin: 1500px -800px;
transform: scaleY(1.1) skewY(15deg);
}
.big_cake {
animation: float 4s ease-in-out infinite;
}
.cake_shadow {
filter: blur(2px);
animation: shadow_floating 4s ease-in-out infinite;
}
@keyframes float {
0% {
transform: translateY(0);
}
50% {
transform: translateY(7px);
}
}
@keyframes shadow_floating {
0% {
filter: blur(2px);
}
50% {
filter: blur(0);
}
}
.cake_shadow {
z-index: -1;
}
.cake_shadow_inner {
width: var(--cake_width);
aspect-ratio: 1/1;
top: 105px;
border: var(--cake_bor.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0