three实现简单三维人物角色修改配件效果代码
代码语言:html
所属分类:三维
代码描述:three实现简单三维人物角色修改配件效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
html,
body {
margin: 0;
padding: 0;
overflow: hidden;
}
.background {
background-color: #242424;
}
.attachment {
content: " ";
position: absolute;
display: inline-flex;
}
.attachment-legs {
left: 60%;
top: 70%;
}
.attachment-weapon {
left: 34%;
top: 36%;
}
.attachment {
width: 3rem;
height: 3rem;
border: 1px solid grey;
cursor: pointer;
}
.attachment:hover .attachment__button-content {
margin: 5%;
height: 90%;
width: 90%;
background-color: rgba(255, 255, 255, 0.3);
}
.attachment__button-content {
position: relative;
margin: 10%;
height: 80%;
width: 80%;
background-color: rgba(255, 255, 255, 0.1);
transition: background-color 0.15s ease, margin 0.15s ease, height 0.15s ease, width 0.15s ease;
}
.add-sign-plus {
transition: transform 0.2s ease;
}
.add-sign {
color: lightgrey;
top: 50%;
left: 50%;
position: absolute;
transform: translate(-50%, -50%);
font-size: 1.75rem;
}
.options {
transition: opacity 0.2s ease;
opacity: 0;
visibility: hidden;
}
.attachment-options-legs {
left: calc(60% + 3.1rem);
top: 70%;
}
.attachment-options-weapon {
left: calc(34% - 6.3rem);
top: 36%;
}
.attachment-options {
display: flex;
position: absolute;
height: min-content;
width: auto;
height: 3rem;
cursor: pointer;
}
.option {
position: relative;
margin-left: 1px;
height: 80%;
width: 100%;
height: 100%;
transition: background-color 0.15s ease, margin 0.15s ease, height 0.15s ease, width 0.15s ease;
opacity: 0.5;
transition: opacity 0.2s ease;
background-color: rgba(255, 255, 255, 0.1);
border: 1px solid #4e4e4e;
}
.option:hover {
opacity: 1;
}
.pegleg-svg,
.leg-svg,
.sword-svg,
.axe-svg {
width: 30px;
height: 30px;
margin-left: 0.55rem;
margin-right: 0.5rem;
margin-top: 0.5rem;
}
.tip {
position: absolute;
left: 50%;
top: 1rem;
transform: translateX(-50%);
text-transform: uppercase;
font-family: sans-serif;
font-weight: 600;
opacity: 0.35;
font-size: 0.75rem;
}
</style>
</head>
<body>
<div id="background" class="background"></div>
<div class="tip">Drag the screen to look around</div>
<div class="attachment attachment-weapon" onclick="toggleWeaponsMenu()">
<div class="attachment__button-content">
<div class="add-sign">
<div class="add-sign-plus add-sign-weapon">
+
</div>
</div>
</div>
</div>
<div class="options weapon-options">
<div class="attachment-options attachment-options-weapon">
<div class="option" onclick="applyWeapon(0)">
<svg class="axe-svg" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 20"><path d="M7 1a1 1 0 112 0v18a1 1 0 11-2 0V1z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.5 2.618a.5.5 0 00-.724-.447L9.275 4.42a.5.5 0 00.048.916l4.501 1.688a.5.5 0 00.676-.468V2.618zm-1.17-1.342a1.5 1.5 0 012.17 1.342v3.939a1.5 1.5 0 01-2.027 1.404L8.972 6.273c-1.227-.46-1.316-2.16-.144-2.746l4.501-2.25z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.618a.5.5 0 01.724-.447l4.501 2.25a.5.5 0 01-.048.916L2..........完整代码请登录后点击上方下载按钮下载查看
















网友评论0