three实现本地上传svg图标转成立体3d模型glb下载本地代码
代码语言:html
所属分类:三维
代码描述:three实现本地上传svg图标转成立体3d模型glb下载本地代码
代码标签: three 本地 上传 svg 图标 转成 立体 3d 模型 glb 下载 本地 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SVG 3D 挤压 - 亮色版</title>
<style>
:root {
--bg: #f5f0eb;
--card-bg: #ffffff;
--text: #2c3e50;
--text-secondary: #5a6c7d;
--accent: #5b7fff;
--accent-hover: #4a6aee;
--accent-download: #10b981;
--accent-download-hover: #059669;
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
--shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
--shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
--radius: 16px;
--radius-sm: 10px;
--transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
background: var(--bg);
overflow: hidden;
height: 100vh;
width: 100vw;
-webkit-tap-highlight-color: transparent;
user-select: none;
-webkit-user-select: none;
}
canvas {
display: block;
}
/* 顶部工具栏 */
.toolbar {
position: fixed;
top: 24px;
left: 50%;
transform: translateX(-50%);
z-index: 100;
display: flex;
gap: 12px;
align-items: center;
background: var(--card-bg);
border-radius: 50px;
padding: 6px 8px;
box-shadow: var(--shadow);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
transition: box-shadow var(--transition);
}
.toolbar:hover {
box-shadow: var(--shadow-lg);
}
.toolbar-divider {
width: 1px;
height: 28px;
background: #e8e5e1;
border-radius: 1px;
margin: 0 4px;
}
.btn {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 20px;
border-radius: 40px;
border: none;
cursor: pointer;
font-size: 14px;
font-weight: 600;
letter-spacing: 0.01em;
transition: all var(--transition);
outline: none;
white-space: nowrap;
font-family: inherit;
position: relative;
overflow: hidden;
}
.btn:active {
transform: scale(0.96);
}
.btn svg {
width: 18px;
height: 18px;
flex-shrink: 0;
}
.btn-upload {
background: var(--accent);
color: #fff;
}
.btn-upload:hover {
background: var(--accent-hover);
box-shadow: 0 6px 20px rgba(91, 127, 255, 0.35);
transform: translateY(-1px);
}
.btn-download {
background: var(--accent-download);
color: #fff;
}
.btn-download:hover {
background: var(--accent-download-hover);
box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
transform: translateY(-1px);
}
.btn-download:disabled {
background: #cbd5e1;
color: #94a3b8;
cursor: not-allowed;
box-shadow: none;
transform: none;
}
.btn-download:disabled:hover {
background: #cbd5e1;
box-shadow: none;
transform: none;
}
.btn-reset {
background: #f1f5f9;
color: var(--text-secondary);
}
.btn-reset:hover {
background: #e2e8f0;
color: var(--text);
}
/* 状态提示 */
.toast {
position: fixed;
bottom: 32px;
left: 50%;
transform: translateX(-50%) translateY(20px);
background: var(--text);
color: #fff;
padding: 10px 24px;
border-radius: 40px;
font-size: 13px;
font-weight: 500;
letter-spacing: 0.02em;
opacity: 0;
pointer-events: none;
transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
z-index: 200;
box-shadow: var(--shadow-lg);
}
.toast.show {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
.toast.success {
background: #10b981;
}
.toast.info {
background: #5b7fff;
}
/* 底部提示 */
.hint {
position: fixed;
bottom: 24px;
left: 50%;
transform: translateX(-50%);
font-size: 12px;
color: #b0a89f;
letter-spacing: 0.03em;
pointer-events: none;
z-index: 50;
transition: opacity 0.6s;
}
/* 响应式 */
@me.........完整代码请登录后点击上方下载按钮下载查看















网友评论0