css+div布局实现礼盒点击打开三维效果代码
代码语言:html
所属分类:三维
代码描述:css+div布局实现礼盒点击打开三维效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Mountains+of+Christmas:wght@400;700&family=Noto+Color+Emoji&display=swap");
:root {
--rotate-speed: 50s;
--primary-col: #001f3f;
--secondary-col: #3a6d8c;
--tertiary-col: #6a9ab0;
}
div {
transition: transform 0.6s ease, box-shadow 0.6s ease;
}
body {
font-family: "Noto Color Emoji", sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #1d1e22;
font-size: 16px;
}
p {
text-align:center;
font-size: 3rem;
color: white;
font-family: "Mountains of Christmas", serif;
font-weight: 700;
font-style: normal;
display: none;
color: var(--tertiary-col);
text-shadow: 2px 2px 4px var(--primary-col), 0 0 2px var(--primary-col),
0 0 1px var(--primary-col), 3px 3px 5px white, 0 0 3px white, 0 0 2px white;
}
.active p {
display: flex;
}
span {
font-size: 3rem;
text-align:center;
font-weight: 400;
font-style: normal;
}
.cube-container {
width: 200px;
height: 200px;
perspective: 600px;
}
.cube {
width: 100%;
height: 100%;
transform-style: preserve-3d;
transform: rotateX(-30deg) rotateY(45deg);
animation: rotate var(--rotate-speed) in.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0