matter实现可交互的文字标签物理下落碰撞效果代码
代码语言:html
所属分类:动画
代码描述:matter实现可交互的文字标签物理下落碰撞效果代码
代码标签: matter 交互的 文字 标签 物理 下落 碰撞
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@500&display=swap" rel="stylesheet"> <style> :root { --color-pink: #fe92ff; --color-orange: #f7ad55; --color-blue: #4f7bf4; --color-green: #5bdb98; --color-cyan: #19ced8; --color-red: #f44545; } body { margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f0f2f0; font-family: "Poppins", sans-serif; font-weight: 500; font-style: normal; } .tag-canvas { width: 90%; max-width: 600px; height: 50vh; border: 1px solid #000; position: relative; overflow: hidden; background-color: #fff; } .title { position: absolute; top: 10px; left: 10px; font-size: 18px; font-weight: bold; color: #000; text-transform: uppercase; margin: 0; } .tag { position: absolute; display: inline-flex; justify-content: center; align-items: center; padding: 0 10px; height: 40px; font-size: 14px; text-transform: uppercase; color: white; border-radius: 20px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); pointer-events: none; } /* Custom colors for tags */ .tag:nth-child(2) { background-color: var(--color-pink); } .tag:nth-child(3) { background-color: var(--color-orange); } .tag:nth-child(4) { background-color: var(--color-blue); } .tag:nth-child(5) { background-color: var(--color-green); } .tag:nth-child(6) { background-color: var(--color-cyan); } .tag:nth-child(7) { background-color: var(--color-red); } .tag:nth-child(8) { background-color: var(--color-green); } </style> </head> <body translate="no"> <div class="tag-canvas"> <h2 class="title">My Too.........完整代码请登录后点击上方下载按钮下载查看
网友评论0