div+css布局实现金属边框走光动画按钮代码

代码语言:html

所属分类:布局界面

代码描述:div+css布局实现金属边框走光动画按钮代码

代码标签: div css 布局 金属 边框 走光 动画 按钮 代码

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

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8"/>
<style>
    body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #0d0d0f;
  gap: 40px;
  flex-wrap: wrap;
  padding: 48px;
}

.icon-outer {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 28px;
  cursor: pointer;
  padding: 3px;
  box-sizing: border-box;
  background-size: 200% 100%;
  animation: metalSlide 6s linear infinite;
  box-shadow: 0 0 0 3px #0d0d0f, 0 8px 24px rgba(0,0,0,0.8);
  transition: box-shadow 0.3s;
}

@keyframes metalSlide {
  from { background-position: 0% 50%; }
  to   { background-position: 200% 50%; }
}

.icon-mid {
  width: 100%;
  height: 100%;
  border-radius: calc(28px - 3px);
  background: #0a0a0c;
  padding: 3px;
  box-sizing: border-box;
}

.icon-face {
  width: 100%;
  height: 100%;
  border-radius: calc(28px - 6px);
  background: radial-gradient(ellipse at 38% 20%, #2c2c2e 0%, #1c1c1e 55%, #111 100%);
  display: flex;
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0