three实现三维人物名片 签名卡片代码

代码语言:html

所属分类:三维

代码描述:three实现三维人物名片 签名卡片代码

代码标签: three 三维 人物 名片 签名 卡片 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="author" content="Grant Jenkins" />
    <meta
      name="description"
      content="A glassy 3D email signature created with THREE.js."
    />
    <title>3D Email Signature</title>

    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link
      href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap"
      rel="stylesheet"
    />
<style>
    * {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #e8e4dc;
  font-family: "Roboto", sans-serif;
}

button {
  font-family: "Roboto", sans-serif;
}

#scene {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.controls {
  position: fixed;
  left: 22px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#rotateButton {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

#rotateButton:hover {
  background: rgba(255, 255, 255, 0.2);
}

.themes {
  display: flex;
  align-items: center;
  gap: 6px;
}

.themeButton {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease;
}

.themeButton:hover {
  transform: scale(1.08);
}

.themeButton.active {
  border-color: #ffffff;
  outline: 1px solid rgba(0, 0, 0, 0.35);
}

.themeButton[data-theme="sunset"] {
  background: #f4a261;
}

.themeButton[data-theme="ocean"] {
  background: #58c4dc;
}

.themeButton[data-theme="berry"] {
  background: #d46a92;
}

.hint {
  position: fixed;
  right: 22px;
  bottom: 22px;
  color: #ffffff88;
  font-size: 12px;
  font-weight: 400;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 600px) {
  .controls {
    left: 14px;
    bottom: 14px;
  }

  .hint {
    right: 14px;
    bottom: 16px;
    font-size: 10px;
  }
}

.details-panel {
  --panel-background: rgba(43, 33, 28, 0.82);
  --panel-border: rgba(255, 168, 94, 0.4);
  --panel-accent: #ffa85e;
  --panel-secondary: #3e7180;
  --panel-field: rgba(62, 113, 128, 0.18);

  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  width: 340px;
  height: 100%;
  transform: translateX(100%);
  border-left: 1px solid var(--panel-border);
  background: var(--panel-background);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  transition: transform 0.35s ease;
}

.details-panel.open {
  transform: translateX(0);
}

.details-panel-toggle {
  position: absolute;
  top: 50%;
  left: -44px;
  width: 44px;
  height: 64px;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid var(--panel-border);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: var(--panel-background);
  color: #ffffff;
  font-size: 26px;
  cursor: pointer;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.details-panel-t.........完整代码请登录后点击上方下载按钮下载查看

网友评论0