three实现三维彩色鸡蛋掉落草坪动画效果代码
代码语言:html
所属分类:三维
代码描述:three实现三维彩色鸡蛋掉落草坪动画效果代码,鼠标移动,视角也平移。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Montserrat);
body {
margin: 0;
}
canvas {
display: block;
}
/* Modal styles */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 9999;
justify-content: center;
align-items: center;
font-family: Montserrat;
}
.modal-content {
background-color: #aaffaa;
padding: 20px;
border-radius: 10px;
box-shadow: inset 0px 0px 5px 5px rgba(0,0,0,0.3);
animation: fadeInModal 1s ease-in-out forwards;
}
button {
position: relative;
left: 50%;
transform: translate(-50%, 0);
background-color: #c2fbd7;
border-radius: 100px;
box-shadow: rgba(44, 187, 99, .2) 0 -25px 18px -14px inset,rgba(44, 187, 99, .15) 0 1px 2px,rgba(44, 187, 99, .15) 0 2px 4px,rgba(44, 187, 99, .15) 0 4px 8px,rgba(44, 187, 99, .15) 0 8px 16px,rgba(44, 187, 99, .15) 0 16px 32px;
color: green;
cursor: pointer;
display: inline-block;
font-family: CerebriSans-Regular,-apple-system,system-ui,Roboto,sans-serif;
padding: 7px 20px;
text-align: center;
text-decoration: none;
transition: all 250ms;
border: 0;
font-size: 16px;
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
&:hover {
box-shadow: rgba(44,187,99,.35) 0 -25px 18px -14px inset,rgba(44,187,99,.25) 0 1px 2px,rgba(44,187,99,.25) 0 2px 4px,rgba(44,187,99,.25) 0 4px 8px,rgba(44,187,99,.25) 0 8px 16px,rgba(44,187,99,.25) 0 16px 32px;
transform: translate(-50%, 0) scale(1.3) rotate(-4deg);
}
}
@keyframes fadeInModal {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
</style>
</head>
<body translate="no">
<!-- Modal -->
<div id="modal" class="modal">
<div class="modal-content">
<h2> good job</h2>
<button onclick="modal.style.display = 'none';">Close</button>
</div>
</div>
<script.........完整代码请登录后点击上方下载按钮下载查看
网友评论0