css实现吉他点击换色代码

代码语言:html

所属分类:布局界面

代码描述:css实现吉他点击换色代码,带背景音乐开关

代码标签: css 吉他 点击 换色 代码

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


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">


<style>
body {
  --text-color: #fdc100;
  --bg-color: #764000;
  --transition: all 0.55s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --yellow-bg: transparent linear-gradient(114deg, #fdc100 0%, #dd7d00 100%) 0%
    0% no-repeat padding-box;
  color: white;
  margin: 0;
  background: black;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  margin: 0;
  height: 100vh;
}
#guitar {
  width: 100%;
  height: 70vh;
  object-fit: contain;
  border: 1px solid black;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
.cta {
  position: relative;
  padding: 12px 18px;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  background: none;
}

.cta:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  border-radius: 50px;
  background: var(--bg-color);
  width: 45px;
  height: 45px;
  transition: all 0.3s ease;
}

.cta span {
  position: relative;
  font-family: "Ubuntu", sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-color);
}

.cta svg {
  position: relative;
  top: 0;
  margin-left: 10px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke: var(--text-color);
  stroke-width: 2;
  transform: translateX(-5px);
  transition: all 0.3s ease;
}

.cta:hover:before {
  width: 100%;
  background: var(--bg-color);
}

.cta:hover svg {
  transform: translateX(0);
}

.cta:active {
  transform: scale(0.95);
}

.btn {
  border-radius: 23px;
  letter-spacing: 0.8px;
  font-size: 14px;
  font-weight: 300;
  color: var(--bg-color);
  white-space: nowrap;
  margin: 20px auto;
  width: 166px;
  height: 45px;
  cursor: pointer;
  position: relative;
  border: 1px solid #dd7d00;
  background: transparent;
}

.btn::before {
  -webkit-transition: var(--transition);
  transition: var(--transition);
  content: "";
  width: 50%;
  height: 100%;
  background: black;
  position: absolute;
  top: 0;
  right: 0;
}

.btn:hover::before {
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0