three实现将svg图标转成3d立体图标代码
代码语言:html
所属分类:三维
代码描述:three实现将svg图标转成3d立体图标代码,svg中不能包含png、jpeg等图片。
代码标签: three svg 图标 转成 3d 立体 图标 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
margin: 0;
overflow: hidden;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif
}
canvas {
display: block;
vertical-align: bottom
}
#background-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
background: #34495e
}
#background-container::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: linear-gradient(45deg, #2c3e50 25%, transparent 25%), linear-gradient(-45deg, #2c3e50 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #2c3e50 75%), linear-gradient(-45deg, transparent 75%, #2c3e50 75%);
background-size: 40px 40px;
background-position: 0 0, 0 20px, 20px -20px, -20px 0;
pointer-events: none
}
#svg-upload {
display: none
}
.dg.ac {
z-index: 200 !important
}
.lil-gui {
opacity: 0;
transition: all 1s esae
}
.color-picker-popover {
position: fixed;
z-index: 10000;
background: #fff;
border-radius: 8px;
box-shadow: 0 4px 20px rgb(0 0 0 / .3);
display: none
}
.color-picker {
background: #131313;
border: 1px solid #8E8888;
border-radius: 5px;
user-select: none;
padding: 10px;
box-shadow: 0 4px 8px rgb(0 0 0 / .2)
}
.color-square {
position: relative;
width: 120px;
height: 120px;
overflow: hidden;
outline: 1px solid #787575;
cursor: crosshair;
float: left
}
.color-overlay1,
.color-overlay2 {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
pointer-events: none
}
.color-overlay1 {
background: linear-gradient(to right, white 0%, #fff0 100%)
}
.color-overlay2 {
background: linear-gradient(to bottom, #fff0 0%, black 100%)
}
.color-selector-outer {
position: absolute;
width: 11px;
height: 11px;
margin: -6px 0 0 -6px;
border: 1px solid #000;
border-radius: 50%;
pointer-events: none;
z-index: 10
}
.color-selector-inner {
position: absolute;
width: 9px;
height: 9px;
border: 1px solid #FFF;
border-radius: 50%;
pointer-events: none
}
.hue-bar {
position: relative;
width: 20px;
height: 120px;
border: 1px solid #787575;
cursor: ns-resize;
float: left;
margin-left: 10px;
background: linear-gradient(to bottom, #ff0000 0%, #ff0080 8.33%, #ff00ff 16.67%, #8000ff 25%, #0000ff 33.33%, #0080ff 41.67%, #00ffff 50%, #00ff80 58.33%, #00ff00 66.67%, #80ff00 75%, #ffff00 83.33%, #ff8000 91.67%, #ff0000 100%)
}
.hue-selector {
position: absolute;
width: 100%;
height: 7px;
margin: -7.5px 0 0 0;
pointer-events: none;
left: 0;
z-index: 10
}
.hue-arrow-left,
.hue-arrow-right {
position: absolute;
width: 0;
height: 0;
border-top: 6px solid #fff0;
border-bottom: 6px solid #fff0
}
.hue-arrow-left {
left: -7px;
border-left: 7px solid #858585
}
.hue-arrow-right {
right: -7px;
border-right: 7px solid #858585
}
.clearfix:after {
content: "";
display: table;
clear: both
}
.color-preview {
width: 100%;
height: 20px;
margin-top: 10px;
border-radius: 5px;
border: 1px solid #787575;
transition: background-color 0.1s
}
.help-button {
position: fixed;
bottom: 20px;
left: 20px;
width: 48px;
height: 48px;
border-radius: 50%;
background: #fff;
color: #000;
border: solid 4px #000;
cursor: pointer;
box-shadow: 0 4px 15px rgb(0 0 0 / .3);
font-size: 24px;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.2s, box-shadow 0.2s;
z-index: 10000;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif
}
.help-button:hover {
transform: scale(1.1);
box-shadow: 0 6px 20px rgb(0 0 0 / .4)
}
.help-modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgb(0 0 0 / .7);
z-index: 10001;
justify-content: center;
align-items: center;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif
}
.help-modal.active {
display: flex
}
.help-modal-content {
background: #fff;
border-radius: 20px;
padding: 0;
max-width: 680px;
width: 90%;
box-shadow: 0 20px 60px rgb(0 0 0 / .5);
animation: modalSlideIn 0.3s ease;
overflow: hidden
}
@keyframes modalSlideIn {
from {
opacity: 0;
transform: translateY(-30px)
}
to {
opacity: 1;
transform: translateY(0)
}
}
.help-modal-header {
background: #fff;
padding: 20px;
text-align: center;
position: relative
}
.help-modal-header h2 {
margin: 0;
font-size: 24px
}
.close-modal {
position: absolute;
top: 15px;
right: 20px;
background: rgb(255 255 255 / .2);
border: none;
color: #000;
font-size: 24px;
cursor: pointer;
width: 32px;
height: 32px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.2s
}
.close-modal:hover {
background: rgb(255 255 255 / .3)
}
.language-tabs {
display: flex;
justify-content: center;
gap: 10px;
padding: 15px;
background: rgb(0 0 0 / .3);
flex-wrap: wrap
}
.lang-btn {
background: rgb(255 255 255 / .1);
border: none;
padding: 8px 20px;
border-radius: 25px;
cursor: pointer;
font-size: 14px;
font-weight: 600;
transition: all 0.2s
}
.lang-btn:hover {
background: rgb(255 255 255 / .2);
transform: translateY(-2px)
}
.lang-btn.active {
background: wheat;
box-shadow: 0 2px 10px rgb(102 126 234 / .4)
}
.notice-content {
padding: 25px;
line-height: 1.6;
min-height: 200px
}
.notice-content p {
margin: 15px 0
}
.notice-content ul {
margin: 15px 0;
padding-left: 25px
}
.notice-content li {
margin: 10px 0
}
.notice-content .warning {
color: tomato;
font-weight: 700
}
.notice-content .icon {
font-size: 48px;
text-align: center;
margin-bottom: 15px
}
.notice-footer {
padding: 15px 25px;
background: rgb(0 0 0 / .2);
text-align: center;
font-size: 12px;
color: #888
}
.copy {
position: fixed;
top: 20px;
left: 20px;
color: #000;
background: rgb(255 255 255 / .9);
padding: 10px;
border-radius: 5px;
font-size: 12px;
z-index: 100
}
@media (max-width:600px) {
.help-button {
width: 40px;
height: 40px;
font-size: 20px;
bottom: 15px;
right: 15px
}
.lang-btn {
padding: 6px 15px;
font-size: 12px
}
.notice-content {
padding: .........完整代码请登录后点击上方下载按钮下载查看















网友评论0