js+css实现2d图标挤压3d动画调节代码
代码语言:html
所属分类:动画
代码描述:js+css实现2d图标挤压3d动画调节代码
代码标签: js css 2d 图标 挤压 3d 动画 调节 代码
下面为部分代码预览,完整代码请点击下载或在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>2D → 3D Extrusion Icon</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Syne:wght@600;700&family=DM+Mono:wght@400&display=swap" rel="stylesheet">
<style>
:root {
--bg: #0a0a0f;
--surface: #12121a;
--accent: #00e5a0;
--accent2: #00b4ff;
--face-front: #1a2a4a;
--face-top: #243660;
--face-side: #111d38;
--face-front-lit: #2a4a7a;
--text: #e8e6e1;
--muted: #5a5868;
--glow: rgba(0, 229, 160, 0.15);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: var(--bg);
font-family: 'DM Mono', monospace;
color: var(--text);
overflow: hidden;
}
body::before {
content: '';
position: fixed;
inset: 0;
background:
radial-gradient(ellipse at 30% 60%, rgba(0, 229, 160, 0.04) 0%, transparent 50%),
radial-gradient(ellipse at 70% 30%, rgba(0, 180, 255, 0.03) 0%, transparent 50%);
pointer-events: none;
}
/* Grain overlay */
body::after {
content: '';
position: fixed;
inset: 0;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
opacity: 0.03;
pointer-events: none;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
gap: 3rem;
}
h1 {
font-family: 'Syne', sans-serif;
font-weight: 700;
font-size: 1.6rem;
letter-spacing: 0.08em;
text-transform: uppercase;
background: linear-gradient(135deg, var(--accent), var(--accent2));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
opacity: 0;
animation: fadeDown 0.8s ease forwards 0.3s;
}
.........完整代码请登录后点击上方下载按钮下载查看















网友评论0