js+css实现电子吉他弹奏乐器效果代码
代码语言:html
所属分类:多媒体
代码描述:js+css实现电子吉他弹奏乐器效果代码,鼠标悬浮在音调按钮上可出声。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/font-awesome-4.7.0/css/font-awesome.min.css">
<style>
nav {
background-color: #221C44;
height: 52px;
font-family: "Roboto", sans-serif;
color: #969DA2;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 40px;
font-size: 14px;
line-height: 17px;
position: relative;
z-index: 2;
}
nav .rewind {
margin-left: 28px;
height: 16px;
cursor: pointer;
}
nav .play {
margin-left: 24px;
height: 24px;
cursor: pointer;
}
nav .play-icon:hover path, nav .play-icon:hover rect,
nav .rewind-icon:hover path,
nav .rewind-icon:hover rect,
nav .pause-icon:hover path,
nav .pause-icon:hover rect {
fill: #566574;
}
nav .pause-icon {
display: none;
}
nav .controls {
display: flex;
align-items: center;
}
nav .social a {
font-size: 24px;
color: #A8B5C2;
margin-left: 18px;
}
nav .social a:hover {
color: #566574;
}
.loading {
display: flex;
justify-content: center;
margin-top: 24px;
position: relative;
z-index: 1;
}
.loading .progress {
transition: width 0.3s linear;
}
.notes {
display: flex;
height: 0;
opacity: 0;
transition: opacity 1s ease;
justify-content: center;
position: relative;
z-index: 2;
overflow: hidden;
}
.notes .note {
height: 132px;
}
.notes .note > div {
height: 100%;
width: 32px;
border-radius: 16px;
background-color: #D8D8D8;
color: #541F5D;
font-family: "Roboto", sans-serif;
font-size: 20px;
font-weight: 700;
line-height: 23px;
text-align: center;
box-sizing: border-box;
padding: 5px 0;
box-shadow: 0 7px 8px rgba(0, 0, 0, 0.16);
}
.notes .note:hover div {
background-color: #FF6545;
color: #fff;
}
.notes .note.key {
height: 172px;
}
.notes .note.key > div {
background-color: #ECDCCA;
}
.notes .note.key:hover > div {
background-color: #FF6545;
color: #fff;
}
.notes .note:not(:first-child) > div {
margin-left: 8px;
}
.notes .note:not(:last-child) > div {
margin-right: 8px;
}
.notes .note span {
font-size: 0.7em;
}
.guitar {
width: 96%;
min-width: 772px;
position: fixed;
bottom: 0;
right: 0;
}
.guitar.visible {
transition: opacity 0.5s ease;
}
.guitar img {
width: 100%;
display: block;
pointer-events: none;
}
.guitar .circle {
background-image: url(//repo.bfw.wiki/bfwrepo/sound/guitar/switch.png);
background-size: 100%;
background-repeat: no-repeat;
width: 5vw;
height: 5vw;
min-width: 40px;
min-height: 40px;
border-radius: 50%;
position: absolute;
right: 44.5%;
top: 33.5%;
cursor: pointer;
}
.guitar .circle.rock {
background-position: 0 100%;
}
.guitar .circle.rock:before {
color: #FFF;
}
.guitar .circle.rock:after {
color: #C17CA4;
}
.guitar .circle:before, .guitar .circle:after {
font-weight: 700;
font-size: 12px;
line-height: 13px;
text-align: center;
display: block;
position: relative;
transition: color 0.3s ease;
}
.guitar .circle:before {
content: "ROCK";
top: -14px;
co.........完整代码请登录后点击上方下载按钮下载查看
网友评论0