css+js实现跟随鼠标交互的无望的机器人效果代码
代码语言:html
所属分类:其他
代码描述:css+js实现跟随鼠标交互的无望的机器人效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
:root {
--orange: hsl(30deg, 100%, 50%);
--eyeoffsetX: 0;
--eyeoffsetY: 0;
--earsrotation: 40deg;
--headrotation: 0deg;
--transitionInterval: 2s;
}
*,
*:before,
*:after {
box-sizing: border-box;
padding: 0;
margin: 0;
transition-property: all;
transition-duration: var(--transitionInterval);
}
body {
background-color: #331a00;
}
.head-wrapper {
position: fixed;
top: calc(50% - 200px);
left: calc(50% - 200px);
width: 400px;
height: 400px;
perspective: 500px;
}
.head-inner {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
perspective: 500px;
transform: rotateY(var(--headrotation));
}
.head {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 50%;
background-color: var(--orange);
}
.head:before {
position: absolute;
content: "";
left: -50px;
top: calc(50% - 20px);
height: 40px;
width: calc(100% + 100px);
background-color: #646464;
z-index: -3;
border-radius: 20px;
}
.head:after {
position: absolute;
content: "";
left: -20px;
top: calc(50% - 20px);
height: 40px;
width: calc(100% + 40px);
background-color: #646464;
z-index:.........完整代码请登录后点击上方下载按钮下载查看
网友评论0